Skip to content
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

Add zoomstart / zoom / zoomend events #1958

Closed
uhuru-be opened this issue Jan 20, 2016 · 4 comments
Closed

Add zoomstart / zoom / zoomend events #1958

uhuru-be opened this issue Jan 20, 2016 · 4 comments
Assignees

Comments

@uhuru-be
Copy link

I want to bind a zoom handler to the navigation control, but did not find how to do this in the API or examples.

I tried the following, but this event was not called :
map.on('boxzoomend', function (e) { //do something });

PS. I have disabled zooming in or out with the mouse scroll wheel

@uhuru-be
Copy link
Author

I'm now using the "moveend" event to trigger execution of the code that I want to run after the user has zoomed in or out with the navigation control.

map.on('moveend', function (e) { // do something });

The side effect is that the code is also triggered when the user drags the map.

I think "zoomstart" and "zoomend" events (similar to "dragstart" and "dragend") would be desirable ?
When are the events "boxzoomstart", "boxzoomend" triggered ?

@bhousel
Copy link
Contributor

bhousel commented Jan 21, 2016

I think "zoomstart" and "zoomend" events (similar to "dragstart" and "dragend") would be desirable ?

Yes, I am planning to add these - I don't think it's ticketed yet, so I'll just use this issue for tracking it.

@bhousel bhousel changed the title binding zoom handlers to navigation control zoomstart / zoom / zoomend events Jan 21, 2016
@lucaswoj lucaswoj changed the title zoomstart / zoom / zoomend events Add zoomstart / zoom / zoomend events Jan 21, 2016
bhousel added a commit that referenced this issue Jan 27, 2016
bhousel added a commit that referenced this issue Jan 27, 2016
@barrylachapelle
Copy link

+1

@mollymerp
Copy link
Contributor

@barrylachapelle these have already been added https://www.mapbox.com/mapbox-gl-js/api/#map.event:zoomend

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants