GPS Visualizer

Generating a map from a GPX file, dynamically

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

Although waypoints in a GPX 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.gpx',
  synthesize_fields:{
    desc:'Elevation: {ele} meters',
    label:'{name}'
    folder:'Waypoints'
  },
  track_options:{color:'#0000E6',width:'3',opacity:'0.6'},
  autozoom:true, zoom_adjustment:0
};

To create a dynamic GPX-derived map like this, just enter the URL of your GPX 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 GPX! It will also work if the data comes from a PHP script that generates GPX-formatted output.



Contents of barrett_spur.gpx: