diff --git a/flutter_map/lib/src/gestures/gestures.dart b/flutter_map/lib/src/gestures/gestures.dart index e83444308..c4873aa71 100644 --- a/flutter_map/lib/src/gestures/gestures.dart +++ b/flutter_map/lib/src/gestures/gestures.dart @@ -70,7 +70,13 @@ abstract class MapGestureMixin extends State var offsetPt = newCenter - map.project(_mapCenterStart); _animationOffset = _pointToOffset(offsetPt); + //Abide to min/max zoom var newZoom = _mapZoomStart * dScale; + if (options.maxZoom != null) + newZoom = (newZoom > options.maxZoom) ? options.maxZoom : newZoom; + if (options.minZoom != null) + newZoom = (newZoom < options.minZoom) ? options.minZoom : newZoom; + map.move(map.unproject(newCenter), newZoom); }); }