1

我需要将绘制的特征保存到文件中,然后通过组合或其他方式让用户加载这些特定特征。

到目前为止,我从我的功能中获得了以下代码,例如:

    {"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/ ,但他使用了一个功能集......这可能是一种可能性。 ..

任何帮助将不胜感激!谢谢!

4

0 回答 0