Remove calls to map.setCenter
authorJohn Firebaugh <john.firebaugh@gmail.com>
Fri, 12 Oct 2012 20:33:24 +0000 (13:33 -0700)
committerJohn Firebaugh <john.firebaugh@gmail.com>
Fri, 9 Nov 2012 20:59:27 +0000 (12:59 -0800)
app/assets/javascripts/index.js
app/assets/javascripts/index/browse.js

index 34c3d8e6e0b46ee6bcc9a00486ac271a00654c9a..4f0dfb148349acc40081eb99668eff02a4fbf51b 100644 (file)
@@ -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();
index 5bf5246d67628e670acc891bd178f82630b80ac2..6bba3edf3f59a49d7a65b90993ab5d58b7e77200 100644 (file)
@@ -212,7 +212,7 @@ $(document).ready(function () {
       onSelect(layer);
 
       if (browseMode != "auto") {
-        map.setCenter(layer.getBounds().getCenter());
+        map.panTo(layer.getBounds().getCenter());
       }
 
       return false;