<HTML>
<HEAD>
<TITLE>display waypoints from a gpx file</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>I can display a gpx trace on a map eg:<BR>
<BR>
<a href="http://www.carnethy.com/maps/wed_training/iframecontent/121212nightrun.htm">http://www.carnethy.com/maps/wed_training/iframecontent/121212nightrun.htm</a> (attached)<BR>
<BR>
But I can't work out how to display waypoints with their names. Can anyone help?<BR>
<BR>
Nothing happens if I change this: <BR>
var lgpx = new OpenLayers.Layer.Vector("wed training", {<BR>
strategies: [new OpenLayers.Strategy.Fixed()],<BR>
protocol: new OpenLayers.Protocol.HTTP({<BR>
url: "../../gpx/wed-training/12-Dec-12.gpx",<BR>
format: new OpenLayers.Format.GPX()<BR>
}),<BR>
style: {strokeColor: "red", strokeWidth: 3, strokeOpacity: 0.8},<BR>
projection: new OpenLayers.Projection("EPSG:4326") <BR>
});<BR>
<BR>
to this:<BR>
<BR>
var lgpx = new OpenLayers.Layer.Vector("wed training", { <BR>
strategies: [new OpenLayers.Strategy.Fixed()], <BR>
protocol: new OpenLayers.Protocol.HTTP({ <BR>
url: "../../gpx/wed-training/12-Dec-12.gpx", <BR>
format: new OpenLayers.Format.GPX({extractWaypoints: true, extractRoutes: true,
extractAttributes: true})
}), <BR>
style: {strokeColor: "red", strokeWidth: 3, strokeOpacity: 0.8}, <BR>
styleMap: gpxStyles, <BR>
projection: new OpenLayers.Projection("EPSG:4326")
});<BR>
<BR>
and define gpxStyles thus:<BR>
<BR>
var gpxStyles = new OpenLayers.StyleMap({"default": new OpenLayers.Style({
pointRadius: "5", // sized according to type attribute
label: "${wpt}",<BR>
labelAlign: 'cb', <BR>
fontSize: 9, <BR>
fontFamily: "Arial", <BR>
fontColor: "red", <BR>
labelYOffset: 6, <BR>
fillColor: "brown", <BR>
strokeColor: "yellow", <BR>
strokeWidth: 2, <BR>
strokeOpacity: 1 <BR>
}), <BR>
"select": new OpenLayers.Style({fillColor: "#66ccff",
strokeColor: "#3399ff",graphicZIndex: 2<BR>
}) <BR>
}); <BR>
<BR>
Thanks<BR>
Digby</SPAN></FONT>
</BODY>
</HTML>