X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/c57d2b29fc1f4647b460b6b74d072c409932e3f2..8376a430b6e8fb3de96b66a05c36cb8ac67e9c59:/app/assets/javascripts/leaflet.map.js?ds=inline diff --git a/app/assets/javascripts/leaflet.map.js b/app/assets/javascripts/leaflet.map.js index 380955c36..4b50cc78c 100644 --- a/app/assets/javascripts/leaflet.map.js +++ b/app/assets/javascripts/leaflet.map.js @@ -211,16 +211,15 @@ L.OSM.Map = L.Map.extend({ clickable: false }; - this._object = object; - - if (this._objectLoader) this._objectLoader.abort(); - if (this._objectLayer) this.removeLayer(this._objectLayer); + this.removeObject(); var map = this; this._objectLoader = $.ajax({ url: OSM.apiUrl(object), dataType: "xml", success: function (xml) { + map._object = object; + map._objectLayer = new L.OSM.DataLayer(null, { styles: { node: objectStyle,