X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/ff52509d5a75c7f218a8d6d6d82bb25897b3dae9..d0ed118ee24401a7e6117efa74522e67a9babba6:/app/assets/javascripts/index/notes.js.erb diff --git a/app/assets/javascripts/index/notes.js.erb b/app/assets/javascripts/index/notes.js.erb index ac73e1378..81d6042c7 100644 --- a/app/assets/javascripts/index/notes.js.erb +++ b/app/assets/javascripts/index/notes.js.erb @@ -3,7 +3,7 @@ $(document).ready(function () { var params = OSM.mapParams(), - noteLayer = new L.LayerGroup(), + noteLayer = new L.LayerGroup({code: 'N'}), notes = {}, newNote; @@ -25,11 +25,6 @@ $(document).ready(function () { }) }; - layers.push({ - layer: noteLayer, - layerCode: "N" - }); - map.noteLayer = noteLayer; map.on("layeradd", function (e) { @@ -57,8 +52,7 @@ $(document).ready(function () { }); if (OSM.STATUS != 'api_offline' && OSM.STATUS != 'database_offline') { - if (params.layers) setMapLayers(params.layers); - if (params.notes) map.addLayer(noteLayer); + if (params.notes || params.layers.indexOf('N') >= 0) map.addLayer(noteLayer); if (params.note) { $.ajax({ url: "/api/" + OSM.API_VERSION + "/notes/" + params.note + ".json",