[OpenLayers-Users] Line

Arnd Wippermann arnd.wippermann at web.de
Fri Sep 5 13:16:51 EDT 2008


try to add the layer to the map and then add the features.
 
                 map.addLayer(vectorLayer);
                  vectorLayer.addFeatures([lineFeature]);
 
Arnd Wippermann

  _____  

Von: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] Im
Auftrag von Kenny France
Gesendet: Freitag, 5. September 2008 18:34
An: Users at openlayers.org
Betreff: [OpenLayers-Users] Line


could somebody Pleaase have a look at the following and tell me why its not
drawing a line?
 
 
  var style_green = {
                strokeColor: "#00FF00",
                strokeOpacity: 1,
                strokeWidth: 3,
                pointRadius: 6,
                pointerEvents: "visiblePainted"
            };
            
            var vectorLayer = new OpenLayers.Layer.Vector("Line");
           
            // create a line feature from a list of points
            var pointList = [];
            var newPoint;
              newPoint = new
OpenLayers.Geometry.Point(-26.123456,26.123456);
                 pointList.push(newPoint);
              newPoint = new
OpenLayers.Geometry.Point(-27.123456,26.123456);
                 pointList.push(newPoint);
 

                var lineFeature = new OpenLayers.Feature.Vector(
                new
OpenLayers.Geometry.LineString(pointList),null,style_green);
            
                  vectorLayer.addFeatures([lineFeature]);
 
                 map.addLayer(vectorLayer);
 
Thanks
 
K-
 
 

  _____  

I am using the free version of SPAMfighter for home users.
SPAMfighter has removed 39356 spam emails to date.
Paying users do not have this message in their emails.
Try SPAMfighter <http://www.spamfighter.com/len>  for free now!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20080905/b08f6583/attachment.html


More information about the Users mailing list