diff options
Diffstat (limited to 'chimere/static/edit_route_map.js')
-rw-r--r-- | chimere/static/edit_route_map.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/chimere/static/edit_route_map.js b/chimere/static/edit_route_map.js index 02d3bd9..cb6f148 100644 --- a/chimere/static/edit_route_map.js +++ b/chimere/static/edit_route_map.js @@ -55,9 +55,19 @@ function initFeature(json_geometry){ point_array.push(point); } var linestring = new OpenLayers.Geometry.LineString(point_array); + initFeatureFromGeometry(linestring); +} + +function initFeatureFromWkt(wkt_geometry){ + var linestring = OpenLayers.Geometry.fromWKT(wkt_geometry); + initFeatureFromGeometry(linestring); +} + +function initFeatureFromGeometry(linestring){ linestring.transform(epsg_display_projection, map.getProjectionObject()); currentFeature = new OpenLayers.Feature.Vector(); currentFeature.geometry = linestring; + vectors.removeFeatures(); vectors.addFeatures([currentFeature]); currentControl = pathModify; /*zoom to the route*/ |