move method
bool
move(
- LatLng center,
- double zoom, {
- dynamic hasGesture = false,
- dynamic callOnMoveSink = true,
- required MapEventSource source,
- String? id,
Implementation
bool move(LatLng center, double zoom,
{hasGesture = false,
callOnMoveSink = true,
required MapEventSource source,
String? id}) {
zoom = fitZoomToBounds(zoom);
final mapMoved = center != _lastCenter || zoom != _zoom;
if (_lastCenter != null && (!mapMoved || !bounds.isValid)) {
return false;
}
if (options.isOutOfBounds(center)) {
if (!options.slideOnBoundaries) {
return false;
}
center = options.containPoint(center, _lastCenter ?? center);
}
_handleMoveEmit(center, zoom, hasGesture, source, id);
_zoom = zoom;
_lastCenter = center;
_lastPixelBounds = getPixelBounds(_zoom);
_lastBounds = _calculateBounds();
_pixelOrigin = getNewPixelOrigin(center);
if (callOnMoveSink) {
_onMoveSink.add(null);
}
if (options.onPositionChanged != null) {
var mapPosition = MapPosition(
center: center, bounds: bounds, zoom: zoom, hasGesture: hasGesture);
options.onPositionChanged!(mapPosition, hasGesture);
}
return true;
}