Question

I'm trying to get a graph of the elevation of a KML file, that KML file being the only input. Ideally the end result would be pretty much exactly like http://gmaps-samples-v3.googlecode.com/svn/trunk/elevation/elevation-profile.html, where you can move your mouse along the graph and it would travel along the KML path. This also is achievable by uploading your own file on http://www.geocontext.org/publ/2010/04/profiler/en/?import=kml however I need it on my site!

I'm just learning JS and seeing as the majority of the code is there, can anyone give me any clues on how to modify it to

1) Accept a KML file as the source data 2) remove the "driving", "walking", etc directions for only the path data

I'm going to start messing around with the code but any clues would be greatly appreciated! Thanks

Was it helpful?

Solution

My suggestion would be to use a third party KML parser like geoxml3 or geoxml-v3 to render your KML as a native Google Maps API v3 polyline, then use the elevation service on that polyline like the example in the documentation

Working example (using geoxml3)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top