Thibaut
Thibaut

Reputation: 23

Custom ZoomIn / ZoomOut with Mapbox / Leaflet JS

I am trying to zoom out 2 zoom levels when clicking on the "-" button of the zoom control. I believe that I should use ZoomOut(2), but I am not sure how to assign this method to the - button. https://www.mapbox.com/mapbox.js/api/v1.6.2/l-map-class/

Thank you very much for your help

Upvotes: 2

Views: 1110

Answers (1)

tmcw
tmcw

Reputation: 11882

You shouldn't: instead of changing the behavior of the zoom control, you can copy it, rename it, and change the behavior of your new control, like L.control.doubleZoom

Upvotes: 1

Related Questions