X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/44810b2b3993ddc579bfd255bdd92df2b1e33b71..1e332721531b9b3baa1a8795a718cdeffdb2bd40:/app/assets/javascripts/leaflet.map.js diff --git a/app/assets/javascripts/leaflet.map.js b/app/assets/javascripts/leaflet.map.js index 83cb73ec5..44aa530d9 100644 --- a/app/assets/javascripts/leaflet.map.js +++ b/app/assets/javascripts/leaflet.map.js @@ -255,14 +255,20 @@ L.OSM.Map = L.Map.extend({ this._objectLoader = { abort: function () {} }; + this._object = object; this._objectLayer = L.featureGroup().addTo(this); + L.circleMarker(object.latLng, haloStyle).addTo(this._objectLayer); - L.marker(object.latLng, { - icon: object.icon, - opacity: 1, - interactive: true - }).addTo(this._objectLayer); + + if (object.icon) { + L.marker(object.latLng, { + icon: object.icon, + opacity: 1, + interactive: true + }).addTo(this._objectLayer); + } + if (callback) callback(this._objectLayer.getBounds()); } else { // element or changeset handled by L.OSM.DataLayer var map = this;