-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
event
passed from map.on('moveend' missing originalEvent
on some interactions
#6405
Comments
Any response to this please? I'm having the same issue |
A solution would be to add eventData to the fitBounds method.
Example fitBounds:
Moveend:
|
I'm using library that doesn't allow to pass extra args to fitBounds, it would be nice if originalEvent was passed by default by mapboxgl, currently there's no way to tell whether zoomend has beeen triggered by user or fitting bounds |
Hi everyone! I've created PR that adds |
@stepankuzmin what else should be covered to consider this ticket resolved? |
I think nothing more is needed. @hryanjones can you please try to reproduce your issue with the master build of |
OK, let's close for now and reopen if there are any more items left to do. |
Is there already a release including this? I stumbled upon the problem here If I understand things correctly, this missing event causes |
Context: I'm looking for a way to tell whether user interaction caused the map to move. The use case is that we use
.fitBounds
to set the initial state and when the user changes the bounding box (via scroll zoom, double click zoom, drag to pan, the navigation controls, keyboard commands, etc.) we want to persist the bounds, but we don't want to do this when it's afitBounds
.Is there a way to tell that it was user initiated? The only time I've seen where I can distinguish is when I also see an
.originalEvent
property in the event in addition to.target
which happens on some user interactions, but not on all of them.mapbox-gl-js version: (using version that was in the examples on mapboxGL website)
Steps to Trigger Behavior
.fitBounds
triggers theevent
and it doesn't have an.originalEvent
property.originalEvent
:.originalEvent
is missing if you do the following:The text was updated successfully, but these errors were encountered: