[OpenLayers-Users] How get gpx label?

christian bleau christian.bleau at gmail.com
Wed Jun 27 04:12:03 PDT 2012


Hi,

Is there someone who  can help me to understand how can I get the label
"name" or "others" from gpx's file?

I try this code without succes ;(

var context =   {
		pointLabel: function(feature) {
	       return feature.attributes['name'] + " (" +
feature.attributes['name'] + ")";
		}};
		
var lgpx = new OpenLayers.Layer.GML("GPX", "http:// ****** test_gpx.gpx", {
		format: OpenLayers.Format.GPX,
		style: {
		strokeColor: "green",
		fillColor: "orange",
		graphicName: "triangle",
		label: "${name}",
            	 pointRadius: 6,	
            	 strokeWidth: 2, 
            	 strokeOpacity: 0.5,
            	 fillOpacity: 0.5},
            	 context: context,
		 projection: new OpenLayers.Projection("EPSG:4326")
			});
		map.addLayer(lgpx);	

If you have any examples or ways.

Thank a lot.

Christian	

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/How-get-gpx-label-tp4984193.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list