File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -249,9 +249,20 @@ abstract class MapLibreMapState extends State<MapLibreMap>
249249 final firstEvent = _onScaleStartEvent;
250250 final secondToLastEvent = _secondToLastScaleUpdateDetails;
251251 final lastEvent = _lastScaleUpdateDetails;
252- if (lastEvent == null || firstEvent == null || secondToLastEvent == null ) {
252+ if (firstEvent == null ) return ;
253+
254+ // zoom out
255+ if (lastEvent == null || secondToLastEvent == null ) {
256+ animateCamera (
257+ zoom: (camera.zoom - 1 ).clamp (options.minZoom, options.maxZoom),
258+ center: camera.center.intermediatePointTo (
259+ toLngLat (firstEvent.focalPoint),
260+ fraction: 0.2 ,
261+ ),
262+ );
253263 return ;
254264 }
265+
255266 // fling animation
256267 final velocity = details.velocity.pixelsPerSecond.distance;
257268 if (velocity >= 800 ) {
You can’t perform that action at this time.
0 commit comments