I just want to make onclick event in zoom in and zoom out. How can I do it? I just confused to make it because zoom in and zoom out is something that generated by library.
Should I make new function? How I make it possible?
I just want to make onclick event in zoom in and zoom out. How can I do it? I just confused to make it because zoom in and zoom out is something that generated by library.
Should I make new function? How I make it possible?
Assuming your map variable is called map, this zooms in when you click the map:
map.on('click', function() {
map.zoomIn();
});
If you're asking to fire an event when zooming happens, then use:
map.on('zoom', function() {
alert('Zoom, zoom, zoom, zoom, I want you in my room');
});
You can also use the zoomend or zoomend events.