]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index.js
Calculate scale in export
[rails.git] / app / assets / javascripts / index.js
index ddad384ab7c9fd458de4a0c1eaa1335c8aeb1d8c..4f0dfb148349acc40081eb99668eff02a4fbf51b 100644 (file)
@@ -12,7 +12,7 @@ $(document).ready(function () {
 
   map.attributionControl.setPrefix(permalinks);
 
-  map.on("moveend layeradd layerremove", updateLocation);
+  map.on("moveend baselayerchange", updateLocation);
 
   if (!params.object_zoom) {
     if (params.bbox) {
@@ -107,14 +107,7 @@ $(document).ready(function () {
     remoteEditHandler();
   }
 
-  $(window).resize(function() {
-    var centre = map.getCenter();
-    var zoom = map.getZoom();
-
-    handleResize();
-
-    map.setCenter(centre, zoom);
-  });
+  $(window).resize(handleResize);
 
   $("#search_form").submit(function () {
     var bounds = map.getBounds();