X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/75a776a574cd6a711c0b4bf854701646c37c391c..f1a4669c957d29c012466768581c4a801e5029be:/app/assets/javascripts/index/notes.js.erb?ds=sidebyside diff --git a/app/assets/javascripts/index/notes.js.erb b/app/assets/javascripts/index/notes.js.erb index 81d6042c7..3a2a15393 100644 --- a/app/assets/javascripts/index/notes.js.erb +++ b/app/assets/javascripts/index/notes.js.erb @@ -1,9 +1,9 @@ //= require templates/notes/show //= require templates/notes/new -$(document).ready(function () { +function initializeNotes(map) { var params = OSM.mapParams(), - noteLayer = new L.LayerGroup({code: 'N'}), + noteLayer = map.noteLayer, notes = {}, newNote; @@ -25,8 +25,6 @@ $(document).ready(function () { }) }; - map.noteLayer = noteLayer; - map.on("layeradd", function (e) { if (e.layer == noteLayer) { loadNotes(); @@ -268,4 +266,4 @@ $(document).ready(function () { e.target.openPopup(); }); }); -}); +}