Monday, 26 September 2016

javascript - Fly To Location in Leaflet


Is it possible to 'fly to location' in Leaflet in the same way as this Mapbox GL example?



Answer



map.flyTo() is available in Leaflet 1.0.


However the parameters are different from those in the example. See http://leafletjs.com/reference-1.0.0.html#map-flyto


flyTo( latlng, zoom?, options?)


Example:


flyTo([13.87992, 45.9791], 12)



No comments:

Post a Comment