rotateRaw method

bool rotateRaw(
  1. double newRotation, {
  2. required bool hasGesture,
  3. required MapEventSource source,
  4. String? id,
})

Internal endpoint to rotate the MapCamera.

Implementation

bool rotateRaw(
  double newRotation, {
  required bool hasGesture,
  required MapEventSource source,
  String? id,
}) {
  if (newRotation == camera.rotation) return false;

  final newCamera = options.cameraConstraint.constrain(
    camera.withRotation(newRotation),
  );
  if (newCamera == null) return false;

  final oldCamera = camera;

  // Update camera then emit events and callbacks
  value = value.withMapCamera(newCamera);

  _emitMapEvent(
    MapEventRotate(
      id: id,
      source: source,
      oldCamera: oldCamera,
      camera: camera,
    ),
  );
  return true;
}