[OpenLayers-Users] Polygon from a GPX

joeysantiago federico.prato at sixeleven.it
Wed Jan 23 07:27:59 PST 2013


Hello, 

i can insert a GPX route into an openlayers map, but i can't succeed to make
it a polygon area. Here's the code i use:

var lgpxvalle = new OpenLayers.Layer.Vector('".$valle->title."', {
                          protocol: new OpenLayers.Protocol.HTTP({
                                  url: 'http://localhost/gpx/file.gpx',
                                  format: new
OpenLayers.Format.GPX({extractWaypoints: true, extractRoutes: true,
extractAttributes: true})
                          }),
                          strategies: [new OpenLayers.Strategy.Fixed()],
                          style: {fill:true, fillColor: 'red', fillOpacity:
1, strokeWidth: 1, strokeColor: 'red', strokeOpacity: 1, pointRadius: 5},
                          projection: new
OpenLayers.Projection('EPSG:4326'),
                         
linkDesc:'http://".$_SERVER['SERVER_NAME'].$base_path.drupal_get_path_alias('node/'.$valle->nid)."'
                  });

I thought the style attributes "fill", "fillColor" and "fillOpacity" would
have been enough... but no way :)

thanks for helping me out



--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Polygon-from-a-GPX-tp5029316.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list