From: Simon Legner Date: Tue, 8 Mar 2016 20:39:55 +0000 (+0100) Subject: Consistent blue marker colour for sharing location X-Git-Tag: live~4437^2 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/6c3fd1e053a60374aba3aa3822620f4ed8e5e11b Consistent blue marker colour for sharing location Before, when adding a marker, it was coloured blue. After sharing the marker, it was coloured red. --- diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index 085b615c7..fdbeaba22 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -192,10 +192,8 @@ $(document).ready(function () { map.setView([params.lat, params.lon], params.zoom); } - var marker = L.marker([0, 0], {icon: OSM.getUserIcon()}); - if (params.marker) { - marker.setLatLng([params.mlat, params.mlon]).addTo(map); + L.marker([params.mlat, params.mlon]).addTo(map); } $("#homeanchor").on("click", function(e) { @@ -205,7 +203,7 @@ $(document).ready(function () { center = L.latLng(data.lat, data.lon); map.setView(center, data.zoom); - marker.setLatLng(center).addTo(map); + L.marker(center, {icon: OSM.getUserIcon()}).addTo(map); }); function remoteEditHandler(bbox, object) {