[OpenLayers-Users] automatically add km markers in a gpx track

kps72 katja.petrini at gmail.com
Wed Oct 5 10:53:39 EDT 2011


Hello, could anyone help me with the following question (I am new to
Openlayers and I don't have much experience with Javascript)?

I build a map to embed in a webpage using the examples in the OSM pages 
then I found examples on how to show a track with the following code

    var lgpx = new OpenLayers.Layer.GML("GPS route", gpxfile, {
        format: OpenLayers.Format.GPX,
        style: {strokeColor: "red", strokeWidth: 5, strokeOpacity: 0.5},
        projection: new OpenLayers.Projection("EPSG:4326")
    });
    map.addLayer(lgpx);

Up to here everything worked well but nOw I would like to complement the map
with markers that I calculated based on the tracks in the file: i.e. I want
a marker every km (I have many tracks for which I wish to do this). How can
I get the points in the gpx file in an array so that I can calculate
distances between them and then interpolate to find the coordinates where to
put the markers?

I appreciate any help

thanks
kps


--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/automatically-add-km-markers-in-a-gpx-track-tp6862452p6862452.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list