X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/75a776a574cd6a711c0b4bf854701646c37c391c..5e9ab5bc5edb63b7ab7719fa989a18f52e3637a2:/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 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(); }); }); -}); +}