Raruto / leaflet-elevation

Leaflet plugin that allows to add elevation profiles using d3js
GNU General Public License v3.0
255 stars 85 forks source link

Undefined "map" variable in leaflet-gpxgroup.js #99

Closed hupe13 closed 3 years ago

hupe13 commented 3 years ago

There is an error in leaflet-gpxgroup.js, on line 336:

 map.flyToBounds(e.layer.getBounds());

must be:

 this._map.flyToBounds(e.layer.getBounds());

I have several gpx files with different structures. They all work with leaflet-elevation.min.js. With leaflet-gpxgroup.js not all of them work, the elevation chart is missing. I have used https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation.html and https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_hoverable-tracks.html as examples. I'm using Wordpress with the Plugin Leaflet Map.

Raruto commented 3 years ago

Hi hupe,

I updated that line as you say, is it ok? (I didn't quite understand if you are also reporting another error...)

Have a nice day, Raruto

hupe13 commented 3 years ago

I wrote about two problems, First you have fixed. Thank you very much for the update. The second problem: I mean, leaflet-gpxgroup.js does not show the elevation profile for every gpx file. But leaflet-elevation.js does the job right with all gpx files. Should I prepare an example?

Raruto commented 3 years ago

Ok, also create a separate issue so we avoid messing with those who will read us later.