我需要保存绘制到文件中的功能,然后通过组合或其他东西,让用户加载这些特定功能。
到目前为止,我从我的功能中获得了以下代码,例如:
{"type":"Feature","id":"OpenLayers.Feature.Vector_250","properties":{},"geometry":
{"type":"Polygon","coordinates":[[[99200,105250],[99800,99750],[103050,102600],[99200,105250]]]},"crs":
{"type":"EPSG","properties":{"code":221951}}}
{"type":"Feature","id":"OpenLayers.Feature.Vector_256","properties":{},"geometry":
{"type":"Point","coordinates":[97500,102100]},"crs":{"type":"EPSG","properties":{"code":221951}}}
{"type":"Feature","id":"OpenLayers.Feature.Vector_278","properties":{},"geometry":
{"type":"LineString","coordinates":[[97900,104350],[98450,100550]]},"crs":{"type":"EPSG","properties":
{"code":221951}}}
这些是多边形,点和线。现在,我希望从该数据中随时重新绘制它们。 文件管理不是问题,我只需要知道如何将这些人重新放在地图上。
我看到这个家伙做了类似的事情http://thinkwhere.wordpress.com/2011/06/26/geocommons-geojson-in-openlayers/,但是他使用了一个特征集......这可能是一种可能......
任何帮助将不胜感激! 谢谢!