summaryrefslogtreecommitdiff
path: root/chimere/static/edit_route_map.js
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@peacefrogs.net>2011-09-09 01:26:34 +0200
committerÉtienne Loks <etienne.loks@peacefrogs.net>2011-09-09 01:26:34 +0200
commit0ccc30e337bb046000fb76d2337c2fb9792bc71f (patch)
treebbf2307438389f91fdae1e618d0816238b0a015a /chimere/static/edit_route_map.js
parent5833aa61d039bf3d1f4372e0390ffc53b7d63eb9 (diff)
downloadChimère-0ccc30e337bb046000fb76d2337c2fb9792bc71f.tar.bz2
Chimère-0ccc30e337bb046000fb76d2337c2fb9792bc71f.zip
Association of a GPX (or KML) file to a route (refs #302)
- new table in the model - new form in route edition - uploaded gpx file simplification - automatic route creation from the GPX file
Diffstat (limited to 'chimere/static/edit_route_map.js')
-rw-r--r--chimere/static/edit_route_map.js10
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*/