GPS Visualizer

Generating a map from a KML file, dynamically

The tracks and markers on this map are pulled from the KML file shown below. If the data in the KML file is edited, the map will be updated the next time it is viewed.

Although waypoints in a KML file do not contain a "label" field -- which GPS Visualizer uses to put a "permanent" label on the map next to a marker -- the map's settings include a statement that synthesizes a label field using the "name" field. We've also added a statement to include the elevation of each waypoint in its description:

gv_options['dynamic_data'] = {
  url:'barrett_spur.kml',
  synthesize_fields:{
    desc:'Elevation: {ele} meters',
    label:'{name}'
    folder:' '
  },
  track_options:{color:'#0000E6',width:'3',opacity:'0.6'},
  autozoom:true, zoom_adjustment:0
};

To create a dynamic KML-derived map like this, just enter the URL of your KML file into the box labeled "URL that will be loaded into the map dynamically" in GPS Visualizer's Google Maps form.

NOTE: With some tweaking, this same setup can be used for just about any XML file, not just KML! The only difference is that you'll need to give GPS Visualizer some hints as to which tags contain the track data.



Contents of barrett_spur.kml: