Talk:Openlayers Track example

From OpenStreetMap Wiki
Jump to: navigation, search

Contents

format: OpenLayers.Format.GPX

You are aware that it's easier to just do:

var gpx = new OpenLayers.Layer.GML("GPX Track", "file.gpx", {
  format: OpenLayers.Format.GPX,
  projection: new OpenLayers.Projection("EPSG:4326"),
  style: {strokeColor: "green"}
};
map.addLayer(gpx);

Rather than writing your own GPX parser etc? --Thomas Wood 17:05, 25 November 2008 (UTC)


Thanks for the update, of course it's simpler. But this is not working for me. I don't see the track. Please post here a working example. :--Zapfen 07:45, 26 November 2008 (UTC)

Out of date?

Given the above comment (from 2008), and the fact the layer constructors are following an old format, I think this example is hopelessly out of date. Does it still work? -- Harry Wood 13:55, 9 September 2010 (BST)

strokeWidth

I got this example working by adding a "strokeWidth" to the list of style attributes (presumably defaults to zero?). I also added a strokeOpacity fraction so that one can see the underlying map ways under the track overlay (opacity seems to default to 1.0). User:Neil_Hoggarth 29th March 2009.

Example link

example link http://edgemaster.dev.openstreetmap.org/OpenLayersExamples/Track/ does not work (http-code: 404) -- jklippel 14:26, 30 May 2010 (UTC)

Personal tools
Namespaces
Variants
Actions
site
Toolbox