mpetazzoni / leaflet-gpx

A GPX track plugin for Leaflet.js
http://mpetazzoni.github.io/leaflet-gpx
BSD 2-Clause "Simplified" License
529 stars 114 forks source link

gpx layer crams the map when using flyTo() #119

Open ztzthu opened 3 years ago

ztzthu commented 3 years ago

Hi, I tried to add a gpx layer then flyTo a place near the gpx layer, using the flyTo function defined by leaflet.

Then I observed that the gpx layer fills up all the map window when the map is zoomed in.

A example code is as follows: https://jsfiddle.net/73945Lcn/2/

Is there a way to avoid this happening? Seems that the gpx layer is also zoomed in or out during the flyto process (which is different from the behaviour of a marker).

Thank you.