X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/322e7142ba702f55659b6a95faf8ffa389d054ab..579e323d0994c5111ef46aa8343b5cdcbc2db4fa:/app/assets/javascripts/leaflet.map.js diff --git a/app/assets/javascripts/leaflet.map.js b/app/assets/javascripts/leaflet.map.js index 3af81f766..4b50cc78c 100644 --- a/app/assets/javascripts/leaflet.map.js +++ b/app/assets/javascripts/leaflet.map.js @@ -55,6 +55,12 @@ L.OSM.Map = L.Map.extend({ this.dataLayer = new L.OSM.DataLayer(null); this.dataLayer.options.code = 'D'; + + this.gpsLayer = new L.OSM.GPS({ + pane: "overlayPane", + code: "G", + name: I18n.t("javascripts.map.base.gps") + }); }, updateLayers: function(layerParam) { @@ -205,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, @@ -277,7 +282,7 @@ L.OSM.Map = L.Map.extend({ } }); -L.Icon.Default.imagePath = "/images"; +L.Icon.Default.imagePath = "/images/"; L.Icon.Default.imageUrls = { "/images/marker-icon.png": OSM.MARKER_ICON,