-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
User-initiated zoom events? #2934
Comments
While creating a custom layer I found myself having to hack the lib to have access to zoom events. Can be related to #3269 |
I have the same situation, when I need to prevent from invoking |
Additional information, but related to the google maps: http://stackoverflow.com/questions/10097647/how-to-listen-for-user-generated-zoom-in-google-maps |
Just for anyone, who stuck with the same issue, here are the approach I've used in the project: onDragEnd() {
this.onUserChange();
},
onZoomEnd() {
if (this.isUser) {
this.onUserChange();
}
},
onMoveEnd() {
this.isUser = true;
}, bindings: this.map.on('dragend', this.onDragEnd);
this.map.on('zoomend', this.onZoomEnd);
this.map.on('moveend', this.onMoveEnd); Would be nice to replace |
Any update on when this might be added? |
The fastest way of getting this into core is a pull request ;) |
Yes @yohanboniface, doing stuff is always the fastest way to get stuff done :) |
It would be awesome if I could pass arbitrary data on the zoom function in the options, and get access to those options in the zoomstart and zoomend events. This way I you could detect it yourself because you've passed something ;-) And also it would open a lot more possibilities. @dmitry Did you find a better way in the mean time? |
Any updates on this issue? I still can't find a direct way to resolve this. |
There's a proposed approach at #5247. However I'm not fully convinced by it :-/ |
How can we make it better then? |
Hello,
It seems that leaflet has no specific event, which is triggered when the user zooms the map, but not when the zoom level was changed programmatically.
Maybe dragstart should be triggered when pinch-zooming because this usually changes the map position too.
I use the leaflet-locatecontrol and I need to stop tracking the user movements when he drags or pinch-zooms the map.
The text was updated successfully, but these errors were encountered: