How to zoom an area at particular scale when user click on map area?

12 views
Skip to first unread message

Ahsan Abbas

unread,
Sep 8, 2016, 6:44:04 AM9/8/16
to Leaflet
Hello Guys,
I want to perform an action in which user click at map and it will automatically zoom to that portion at certain scale. I don't understand how to do it, can someone help me to write the code ?

Thanks

k_man_au

unread,
Sep 8, 2016, 8:01:35 PM9/8/16
to Leaflet
var myZoom = 18;

map.on('click', function(e) { map.setView(e.latlng, myZoom); });

Ahsan Abbas

unread,
Sep 9, 2016, 1:24:59 AM9/9/16
to Leaflet
Thank you k_man_au once again.
Reply all
Reply to author
Forward
0 new messages