[OpenLayers-Users] need help with vectors
Adam Eskreis
aeskreis at gmail.com
Sat Dec 23 17:47:28 EST 2006
I know the vectors are still in development but if someone could help me it
would be most appreciated. I'm pretty sure my code is right, but for some
reason the program keeps messing up when i try to add the features to the
vector. here is the relevant code:
var linearRing = new OpenLayers.Geometry.LinearRing([
new OpenLayers.Geometry.Point(195090.60388669,
1037165.33840374),
new OpenLayers.Geometry.Point(195223.79377482,
1037117.84835569),
new OpenLayers.Geometry.Point(195230.71396682,
1037136.86838771),
new OpenLayers.Geometry.Point(195085.51383869,
1037188.31824376),
new OpenLayers.Geometry.Point(195090.60388669,
1037165.33840374)]);
var polygon = new OpenLayers.Geometry.Polygon([linearRing]);
var vector = new OpenLayers.Layer.Vector("Vector Layer");
var feature = new OpenLayers.Feature();
feature.setGeometry(polygon);
map.addLayer(vector);
vector.addFeatures(feature);
the error i get is :
this.root has no properties
the error occurs on Svg.js on line 165
does anyone have a clue as to why this isnt working? I know these
coordinates are correct and the extents and everything else is correct, the
only problme is this vector code.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20061223/049d0340/attachment.html
More information about the Users
mailing list