]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/leaflet.map.js.erb
Remove object parameter from share URL
[rails.git] / app / assets / javascripts / leaflet.map.js.erb
index f65325e37b94cffbd580afa25e1f647409918975..ed89e1fa572106acbd4c414349040cbb915dbf45 100644 (file)
@@ -100,10 +100,6 @@ L.OSM.Map = L.Map.extend({
       params.mlon = latLng.lng.toFixed(precision);
     }
 
-    if (this._object) {
-      params[this._object.type] = this._object.id;
-    }
-
     var url = 'http://' + OSM.SERVER_URL + '/',
       query = querystring.stringify(params),
       hash = OSM.formatHash(this);
@@ -243,6 +239,11 @@ L.OSM.Map = L.Map.extend({
       zoom: this.getZoom(),
       layers: this.getLayersCode()
     }
+  },
+
+  setState: function(state, options) {
+    if (state.center) this.setView(state.center, state.zoom, options);
+    this.updateLayers(state.layers);
   }
 });