[OpenLayers-Users] Adding a vector feature from WKT

Derek Watling derek at cmainfo.co.za
Thu Jan 29 05:15:37 EST 2009


I am trying to highlight the selected property on the map by adding a Vector
Layer and then a Feature from WKT.

I have the following code:
----------------------------
highlightLayer = new OpenLayers.Layer.Vector("Highlight");
map.addLayer(highlightLayer);

SubjectProperty = new OpenLayers.Feature.Vector(new
OpenLayers.Geometry.fromWKT("POLYGON((-42590.5609 -3747526.1968, -42571.4706
-3747534.5561, -42558.4618 -3747504.8465, -42575.5821 -3747497.3472,
-42582.472 -3747500.4773, -42590.5609 -3747526.1968))");
highlightLayer.addFeatures([SubjectProperty]);
----------------------------

The Geometry.fromWKT() keeps giving me an "Object expected" error.
-- 
View this message in context: http://n2.nabble.com/Adding-a-vector-feature-from-WKT-tp2238031p2238031.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.




More information about the Users mailing list