I cant find out how to use the WKT
format in OpenLayers.
I have tried finding the solution in the documentation, witch bascily brought me to this: http://jsfiddle.net/Christer/WG8YP/2/
But that gives me the error of :
Uncaught SyntaxError: Unexpected number
I have no clue about what the hazzle is about, as the numbers and everything are copied straight out of openlayers own bounds/points/geo.
Try this
addFeatures
takes an array of features.
var polygonFeature = wkt.read("POLYGON((-15.8203125 2.4609375, -15.8203125 -10.546875, 6.85546875 -11.25, 8.26171875 -3.33984375, -15.8203125 2.4609375))");
polygonFeature.geometry.transform(map.displayProjection, map.getProjectionObject());
vectors.addFeatures([polygonFeature]);