Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elevation script returning TypeError: undefined "_container" #13

Open
simplicitywebdesign opened this issue Mar 8, 2024 · 3 comments
Open

Comments

@simplicitywebdesign
Copy link

The map itself shows up fine, but the track does not. My console is showing the following issue:

Uncaught TypeError: Cannot read properties of undefined (reading '_container')
    at i._addToChartDiv (leaflet.elevation.js:628:38)
    at i.addTo (leaflet.elevation.js:182:18)
    at drawTrack (leaflet.hugo.js:62:56)

I have tried for a few weeks now to nail it down but I just don't have the JS abilities to debug it. I'm almost certain I'm doing something stupid here but cannot figure it out.

Anybody else come across this?

@charlesepaillard
Copy link

Hi @simplicitywebdesign I have the same problem on my side - showing maps and adding markers is all good. However I have the very same issue and error showing gpx.

@charlesepaillard
Copy link

using debugger: L.control.elevation(opts.elevationControl.options).addTo(leafletMapsObj[trackOpts.mapId]) returns an error
because leafletMapsObj[trackOpts.mapId] is "undefined"
main reason is that leafletMapsObj is an empty dictionary
Capture

@charlesepaillard
Copy link

ok, I understand the problem: drawTrack has to be called AFTER createMap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants