From 8dad05759823a55734274c1ea33ee77594183b1b Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Sat, 7 Jul 2018 19:10:13 +0200 Subject: [PATCH] Fix caption panel loaded to early in some situations fix #504 --- docs/changelog.md | 3 ++- umap/static/umap/js/umap.js | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index 584eb651..77fe4c29 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -72,7 +72,8 @@ COMMIT; - allow to clone also markers - only list https ready tilerlayers when page is in https (#567) - allow to use an unicode character as Marker symbol (#527) - +- add `{rank}` as dynamic feature property (to be used in popup or icon symbol) +- add an explicit button to attach a owner to an anonyous map (#568) ## 0.8.0 diff --git a/umap/static/umap/js/umap.js b/umap/static/umap/js/umap.js index 27f3aeed..21da48d6 100644 --- a/umap/static/umap/js/umap.js +++ b/umap/static/umap/js/umap.js @@ -292,7 +292,9 @@ L.U.Map.include({ }, initDatalayers: function () { - var toload = 0, datalayer, seen = 0, self = this; + var toload = this.options.datalayers.length, + datalayer, seen = this.options.datalayers.length, + self = this; var loaded = function () { self.datalayersLoaded = true; self.fire('datalayersloaded'); @@ -302,8 +304,6 @@ L.U.Map.include({ if (toload === 0) loaded(); }; for (var j = 0; j < this.options.datalayers.length; j++) { - toload++; - seen++; datalayer = this.createDataLayer(this.options.datalayers[j]); if (datalayer.displayedOnLoad()) datalayer.onceLoaded(decrementToLoad); else decrementToLoad();