rotate method

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

Implementation

bool rotate(
  double newRotation, {
  bool hasGesture = false,
  required MapEventSource source,
  String? id,
}) {
  if (newRotation != _rotation) {
    final double oldRotation = _rotation;
    //Apply state then emit events and callbacks
    setState(() {
      _rotation = newRotation;
    });
    _updateSizeByOriginalSizeAndRotation();

    emitMapEvent(
      MapEventRotate(
        id: id,
        currentRotation: oldRotation,
        targetRotation: _rotation,
        center: _center,
        zoom: _zoom,
        source: source,
      ),
    );
    return true;
  }

  return false;
}