X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/44629832dd0207d7b0f50b93f1d00b4373dd4d49..21407ede7e6d82d0ff63e254807397f431dd211a:/app/assets/javascripts/leaflet.map.js.erb diff --git a/app/assets/javascripts/leaflet.map.js.erb b/app/assets/javascripts/leaflet.map.js.erb index bfb3685a1..ed89e1fa5 100644 --- a/app/assets/javascripts/leaflet.map.js.erb +++ b/app/assets/javascripts/leaflet.map.js.erb @@ -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); @@ -222,8 +218,8 @@ L.OSM.Map = L.Map.extend({ if (!window.location.hash) { var bounds = map._objectLayer.getBounds(); if (bounds.isValid()) { - OSM.route.moveListenerOff(); - map.once('moveend', OSM.route.moveListenerOn); + OSM.router.moveListenerOff(); + map.once('moveend', OSM.router.moveListenerOn); map.fitBounds(bounds); } } @@ -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); } });