function initializeNotes(map) {
var noteLayer = map.noteLayer,
- notes = {},
- newNote;
+ notes = {};
var noteIcons = {
"new": L.icon({
noteLayer.clearLayers();
notes = {};
}
- }).on("popupclose", function (e) {
- if (newNote && e.popup == newNote._popup) {
- $(newNote).oneTime(10, "removenote", function () {
- map.removeLayer(newNote);
- newNote = null;
- });
- }
- })
+ });
noteLayer.on('click', function(e) {
OSM.route('/browse/note/' + e.layer.id);
- })
+ });
function updateMarker(marker, feature) {
if (marker) {
notes[feature.properties.id] = updateMarker(marker, feature);
}
- for (id in oldNotes) {
+ for (var id in oldNotes) {
noteLayer.removeLayer(oldNotes[id]);
}
noteLoader = null;
}
- };
+ }
}