rotate method

bool rotate(
  1. double degree, {
  2. dynamic hasGesture = false,
  3. dynamic callOnMoveSink = true,
  4. required MapEventSource source,
  5. String? id,
})

Implementation

bool rotate(
  double degree, {
  hasGesture = false,
  callOnMoveSink = true,
  required MapEventSource source,
  String? id,
}) {
  if (degree != _rotation) {
    var oldRotation = _rotation;
    rotation = degree;
    _updateSizeByOriginalSizeAndRotation();

    onRotationChanged(_rotation);

    emitMapEvent(
      MapEventRotate(
        id: id,
        currentRotation: oldRotation,
        targetRotation: _rotation,
        center: _lastCenter!,
        zoom: _zoom,
        source: source,
      ),
    );

    if (callOnMoveSink) {
      _onMoveSink.add(null);
    }

    return true;
  }

  return false;
}