summaryrefslogtreecommitdiff
path: root/chimere/static
diff options
context:
space:
mode:
Diffstat (limited to 'chimere/static')
-rw-r--r--chimere/static/base.js10
-rw-r--r--chimere/static/edit_route_map.js10
2 files changed, 19 insertions, 1 deletions
diff --git a/chimere/static/base.js b/chimere/static/base.js
index 91ec310..3f9d39d 100644
--- a/chimere/static/base.js
+++ b/chimere/static/base.js
@@ -1,5 +1,5 @@
/* base function shared by some pages */
-/* Copyright (C) 2009-2010 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet>
+/* Copyright (C) 2009-2011 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as
@@ -52,6 +52,14 @@ function showHide(id){
}
}
+/* open a popup window */
+function open_window(url){
+ var newwindow = window.open(url, '_blank',
+ 'height=170,width=400,scrollbars=yes');
+ if (window.focus) {newwindow.focus()}
+ return false;
+}
+
function saveExtent() {
/* save the current extent in a cookie */
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*/