summaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
Diffstat (limited to 'static')
-rw-r--r--static/edit_map.js4
-rw-r--r--static/edit_route_map.js3
2 files changed, 7 insertions, 0 deletions
diff --git a/static/edit_map.js b/static/edit_map.js
index fa13dbb..4799341 100644
--- a/static/edit_map.js
+++ b/static/edit_map.js
@@ -50,6 +50,10 @@ var putMarker = function (lonlat){
' ' + lonlat.lat + ')';
document.getElementById('live_latitude').value = lonlat.lon;
document.getElementById('live_longitude').value = lonlat.lat;
+ /*zoom to the point*/
+ var bounds = layerMarkers.getDataExtent();
+ if (bounds) map.zoomToExtent(bounds);
+ return;
}
/* main initialisation function */
diff --git a/static/edit_route_map.js b/static/edit_route_map.js
index f1a466f..ee3f123 100644
--- a/static/edit_route_map.js
+++ b/static/edit_route_map.js
@@ -59,6 +59,9 @@ function initFeature(json_geometry){
currentFeature.geometry = linestring;
vectors.addFeatures([currentFeature]);
currentControl = pathModify;
+ /*zoom to the route*/
+ var bounds = vectors.getDataExtent();
+ if (bounds) map.zoomToExtent(bounds);
}
function updateForm(event) {