NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

I can easily display a GPX track on an openlayers map using the example code at http://wiki.openstreetmap.org/wiki/Openlayers_Track_example

or by using this alternative code I can also display waypoints (but not their names):

var myStyleMap = new OpenLayers.StyleMap({"default": new OpenLayers.Style({pointRadius: 5, fillColor: "darkred", strokeColor: "red",    strokeWidth: 3  })
            });
// add the layer with the GPX track and waypoints
var lgpx = new OpenLayers.Layer.Vector("title", {
protocol: new OpenLayers.Protocol.HTTP({ url: "my_file.gpx",
format: new OpenLayers.Format.GPX({extractWaypoints: true,  extractName: true, extractRoutes: true, extractAttributes: true})
}),
strategies: [new OpenLayers.Strategy.Fixed()],
styleMap: myStyleMap, 
projection: new OpenLayers.Projection("EPSG:4326")
});
map.addLayer(lgpx);

I would like to be able to display the names of the waypoints. The waypoints are in the GPX file in the following format:

<wpt lat="55.90119934" lon="-3.15706110">
        <ele>129.4</ele>
        <time>2010-12-22T20:43:20Z</time>
        <name>The Waverley</name>
</wpt>

I can't fathom the javascript, and there are no examples on the web. Can anyone help?

asked 14 Jan '12, 16:03

digby's gravatar image

digby
465612
accept rate: 0%

closed 14 Jan '12, 17:07

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273

The question has been closed for the following reason "Question is off-topic or not relevant" by Frederik Ramm 14 Jan '12, 17:07


See Getting Help on the OpenLayers forum for ways to find help with OpenLayers. This is the OpenStreetMap help system and your question is not related to OpenStreetMap.

permanent link

answered 14 Jan '12, 17:07

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

As far as I'm concerned openlayers is linked with openstreetmap. If you look at the quote above you'll see the link http://wiki.openstreetmap.org/wiki/Openlayers_Track_example The openlayers help is messy and confusing. The first line "How can I add a question to this FAQ?" does nothing to answer the question. Ironically.

(13 Dec '12, 15:16) digby

I'll add to that comment. There is no OpenLayers forum. OpenLayers help is terrible. It is no help at all. In fact I can't find any way of asking a question.

(14 Dec '12, 13:55) digby

Try the mailing list or Stack Exchange (GIS, Stackoverflow).

(14 Dec '12, 14:02) scai ♦

I found the answer. But I'm not telling you.

(28 Mar '13, 16:57) digby

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×255
×122
×112
×35

question asked: 14 Jan '12, 16:03

question was seen: 9,018 times

last updated: 28 Mar '13, 16:57

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum