move method

void move(
  1. LatLng? center,
  2. double? zoom, {
  3. dynamic hasGesture = false,
})

Implementation

void move(LatLng? center, double? zoom, {hasGesture = false}) {
  zoom = fitZoomToBounds(zoom);
  final mapMoved = center != _lastCenter || zoom != _zoom;

  if (_lastCenter != null && (!mapMoved || !bounds!.isValid)) {
    return;
  }

  if (options.isOutOfBounds(center)) {
    if (!options.slideOnBoundaries) {
      return;
    }
    center = options.containPoint(center, _lastCenter ?? center);
  }

  var mapPosition = MapPosition(
      center: center, bounds: bounds, zoom: zoom, hasGesture: hasGesture);

  _zoom = zoom;
  _lastCenter = center;
  _lastPixelBounds = getPixelBounds(_zoom);
  _lastBounds = _calculateBounds();
  _pixelOrigin = getNewPixelOrigin(center);
  _onMoveSink.add(null);
  _positionSink.add(mapPosition);

  if (options.onPositionChanged != null) {
    options.onPositionChanged!(mapPosition, hasGesture);
  }
}