Closed simonmnt closed 3 years ago
This code won't work because it will call map.fitBounds()
before the GPX is loaded, at which time your maxBounds
object has not been extended yet. You should be doing this in the .on('loaded', ...)
event handler function, as documented in the README: https://github.com/mpetazzoni/leaflet-gpx#usage
Hi,
I try to center my map to show all gpx track, but is not working.
Uncaught Error: Bounds are not valid
My code:
I don't understand why it doesn't work..