//= 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;
})
};
- map.noteLayer = noteLayer;
-
map.on("layeradd", function (e) {
if (e.layer == noteLayer) {
loadNotes();
e.target.openPopup();
});
});
-});
+}