fix: flyTo breaks following mode with untilPanOrZoom#396
Merged
KristjanESPERANTO merged 1 commit intodomoritz:gh-pagesfrom Feb 9, 2026
Merged
fix: flyTo breaks following mode with untilPanOrZoom#396KristjanESPERANTO merged 1 commit intodomoritz:gh-pagesfrom
KristjanESPERANTO merged 1 commit intodomoritz:gh-pagesfrom
Conversation
When using flyTo: true with initialZoomLevel or keepCurrentZoomLevel, the flyTo call triggered zoomstart events which set _userZoomed = true, immediately breaking following mode even though the zoom was triggered by the control itself, not by the user. Root cause: Only the fitBounds path in setView() was setting _ignoreEvent to prevent zoom/pan events from being interpreted as user actions. Fixes domoritz#314
331fc59 to
dd065f8
Compare
domoritz
approved these changes
Feb 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #314 -
flyTobreaking following mode withuntilPanOrZoom.Control-initiated
flyTocalls triggeredzoomstartevents which were interpreted as user actions, causing_userZoomed = trueand immediately breaking following mode.Root Cause
Only the
fitBoundspath insetView()was setting_ignoreEventbefore map operations. TheinitialZoomLevelandkeepCurrentZoomLevelpaths were unprotected, so theirflyTo/setView/panTocalls triggered_onZoom().Solution
Set
_ignoreEvent = truefor all three code paths insetView()before calling map methods. Extract common pattern into_setViewIgnoringEvents(method, args)helper to eliminate duplication.Changes
setView()paths with_ignoreEventflag_setViewIgnoringEvents()helper methodsetView(): destructuring, string method names, clearer variablesNotes
Implements option 2 from the original issue analysis: "_onZoom should ignore the event while the zoom happens due to flyTo"