I am developing a Leaflet map that includes a MapZen address search. I cant find any information on how to zoom in on the search pin after an address is selected and the map pans to the pin. Does anyone know how to do this?
Thank you,
Nick
Have you taken a look at mapzen.js? It's a Leaflet extension that provides a search box that autozooms to the selected result.
Mapzen Leaflet Geocoder (which is part of mapzen.js) doesn't offer zoom level change by default when the result's geometry type is point. However, you can listen to the events that Geocoder element fires, execute
setZoom
. You can check all the events that Mapzen Leaflet Geocoder fires here: https://github.com/mapzen/leaflet-geocoder#eventsThis is the example snippet listening to
select
event, change the zoom level of the map.