<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Stefan,<div><br></div><div>It's work very well :-))))))</div><div><br></div><div>I'm glad, I'm so glad.</div><div><br></div><div>Many Thanks.</div><div><br></div><div>Christian</div><div><br></div><div><br><div><div>Le 27 juin 2012 à 15:00, Stefan Simon a écrit :</div><br class="Apple-interchange-newline"><blockquote type="cite">Hello.<br><br>This is my code:<br><pre>var gpxStyles = new OpenLayers.StyleMap({
"default": new OpenLayers.Style({
pointRadius: "5", // sized according to type attribute
label: "${name}",
labelAlign: 'cb',
fontSize: 9,
fontFamily: "Arial",
fontColor: "red",
labelYOffset: 6,
fillColor: "brown",
strokeColor: "yellow",
strokeWidth: 2,
strokeOpacity: 1
}),
"select": new OpenLayers.Style({
fillColor: "#66ccff",
strokeColor: "#3399ff",
graphicZIndex: 2
})
}); <br></pre><pre>var __gpx_layer = new OpenLayers.Layer.Vector("gpx_layer", {
protocol: new OpenLayers.Protocol.HTTP({
url: "path_to_gpx/gpx_file.gpx",
format: new OpenLayers.Format.GPX({extractWaypoints: true, extractRoutes: false, extractAttributes: true})
}),
strategies: [new OpenLayers.Strategy.Fixed()],
visibility: false,
styleMap: gpxStyles,
projection: new OpenLayers.Projection("EPSG:4326")
});</pre><br><br><div class="gmail_quote">On Wed, Jun 27, 2012 at 2:12 PM, christian bleau <span dir="ltr"><<a href="mailto:christian.bleau@gmail.com" target="_blank">christian.bleau@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
Is there someone who can help me to understand how can I get the label<br>
"name" or "others" from gpx's file?<br>
<br>
I try this code without succes ;(<br>
<br>
var context = {<br>
pointLabel: function(feature) {<br>
return feature.attributes['name'] + " (" +<br>
feature.attributes['name'] + ")";<br>
}};<br>
<br>
var lgpx = new OpenLayers.Layer.GML("GPX", "http:// ****** test_gpx.gpx", {<br>
format: OpenLayers.Format.GPX,<br>
style: {<br>
strokeColor: "green",<br>
fillColor: "orange",<br>
graphicName: "triangle",<br>
label: "${name}",<br>
pointRadius: 6,<br>
strokeWidth: 2,<br>
strokeOpacity: 0.5,<br>
fillOpacity: 0.5},<br>
context: context,<br>
projection: new OpenLayers.Projection("EPSG:4326")<br>
});<br>
map.addLayer(lgpx);<br>
<br>
If you have any examples or ways.<br>
<br>
Thank a lot.<br>
<br>
Christian<br>
<br>
--<br>
View this message in context: <a href="http://osgeo-org.1560.n6.nabble.com/How-get-gpx-label-tp4984193.html" target="_blank">http://osgeo-org.1560.n6.nabble.com/How-get-gpx-label-tp4984193.html</a><br>
Sent from the OpenLayers Users mailing list archive at <a href="http://Nabble.com">Nabble.com</a>.<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>______________<br>Simon Stefan<br>
</blockquote></div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Lucida Console'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Lucida Console'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Lucida Console'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Lucida Console'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Christian</div><div><br></div><div><a href="http://www.pofableau.com/">Pof@Bleau</a></div><div><br></div><div><br></div></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"></span><br class="Apple-interchange-newline">
</div>
<br></div></body></html>