Leaflet Plugin: Leaflet.Elevation (height profile)
-
Hello,
i want to hack into the Trackservers Leaflet Libraries the Leaflet.Elevation Plugin:
https://github.com/MrMufflon/Leaflet.Elevation
you can see working static html test here, this is how it looks: https://dev.peterscheerer.de/playground/leaflet/02/example_gpx.htmlThe main problem i have: i don’t know how to hook in the current Track(s) from the Trackservers Database so the leaflet.elevation code can read it.
The Plugin itself is working, i loaded into trackserver.php:
wp_enqueue_script( 'leaflet-gpx', TRACKSERVER_JSLIB . 'leaflet-gpx/gpx.js', array(), false, true ); wp_enqueue_script( 'leaflet-elevation', TRACKSERVER_JSLIB . 'leaflet-elevation-0.0.4/leaflet.elevation-0.0.4.min.js', array(), false, true ); wp_enqueue_style( 'leaflet-elevation', TRACKSERVER_JSLIB . 'leaflet-elevation-0.0.4/leaflet.elevation-0.0.4.css' ); wp_enqueue_script( 'd3', TRACKSERVER_JSLIB . 'd3/d3.v3.min.js', array(), false, true );
and i put this code into trackserver.js
var el = L.control.elevation({ theme: "steelblue-theme", width: 400, collapsed: true, }); el.addTo(map); var g=new L.GPX("./test.gpx", {async: true}); g.on("addline",function(e){ el.addData(e.line); });
what i want to do is now to change the hardcoded “./test.gpx” url into the current Track from Trackserver.
Any Ideas? Thanks pete
The page I need help with: [log in to see the link]
- The topic ‘Leaflet Plugin: Leaflet.Elevation (height profile)’ is closed to new replies.