]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index.js
fix map panning to objects when url hash is not empty but has no map location, fixes...
[rails.git] / app / assets / javascripts / index.js
index c3ee1e3bc9b47729faab64ad478d6a7818cbabb4..b6ead9f2d988eea2e391cd1d9689120a90a9f14e 100644 (file)
@@ -309,8 +309,9 @@ $(document).ready(function () {
     };
 
     function addObject(type, id, center) {
+      var hashParams = OSM.parseHash(window.location.hash);
       map.addObject({ type: type, id: parseInt(id, 10) }, function (bounds) {
-        if (!window.location.hash && bounds.isValid() &&
+        if (!hashParams.center && bounds.isValid() &&
             (center || !map.getBounds().contains(bounds))) {
           OSM.router.withoutMoveListener(function () {
             map.fitBounds(bounds);