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
http://jsfiddle.net/WG8YP/4/
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]);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With