我不知道如何在OpenLayers中使用WKT格式。
我试着找到solution in the documentation,巫师把我带到了这个地方:http://jsfiddle.net/Christer/WG8YP/2/
但这给了我一个错误:
Uncaught SyntaxError: Unexpected number我不知道这是怎么回事,因为数字和所有东西都是直接从openlayer自己的边界/点/地理复制出来的。
发布于 2012-08-14 22:56:13
尝尝这个
http://jsfiddle.net/WG8YP/4/
addFeatures使用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]);https://stackoverflow.com/questions/11954401
复制相似问题