Merge remote-tracking branch 'upstream/pull/5577'
This commit is contained in:
commit
66f519d9cc
1 changed files with 5 additions and 4 deletions
|
@ -1,6 +1,7 @@
|
||||||
OSM.initializeNotesLayer = function (map) {
|
OSM.initializeNotesLayer = function (map) {
|
||||||
var noteLayer = map.noteLayer,
|
let noteLoader;
|
||||||
notes = {};
|
const noteLayer = map.noteLayer;
|
||||||
|
let notes = {};
|
||||||
|
|
||||||
var noteIcons = {
|
var noteIcons = {
|
||||||
"new": L.icon({
|
"new": L.icon({
|
||||||
|
@ -25,6 +26,8 @@ OSM.initializeNotesLayer = function (map) {
|
||||||
map.on("moveend", loadNotes);
|
map.on("moveend", loadNotes);
|
||||||
map.fire("overlayadd", { layer: noteLayer });
|
map.fire("overlayadd", { layer: noteLayer });
|
||||||
}).on("remove", () => {
|
}).on("remove", () => {
|
||||||
|
if (noteLoader) noteLoader.abort();
|
||||||
|
noteLoader = null;
|
||||||
map.off("moveend", loadNotes);
|
map.off("moveend", loadNotes);
|
||||||
noteLayer.clearLayers();
|
noteLayer.clearLayers();
|
||||||
notes = {};
|
notes = {};
|
||||||
|
@ -63,8 +66,6 @@ OSM.initializeNotesLayer = function (map) {
|
||||||
return marker.id;
|
return marker.id;
|
||||||
};
|
};
|
||||||
|
|
||||||
var noteLoader;
|
|
||||||
|
|
||||||
function loadNotes() {
|
function loadNotes() {
|
||||||
var bounds = map.getBounds();
|
var bounds = map.getBounds();
|
||||||
var size = bounds.getSize();
|
var size = bounds.getSize();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue