Fix caption panel loaded to early in some situations

fix #504
This commit is contained in:
Yohan Boniface 2018-07-07 19:10:13 +02:00
parent 1ec47894f3
commit 8dad057598
2 changed files with 5 additions and 4 deletions

View file

@ -72,7 +72,8 @@ COMMIT;
- allow to clone also markers - allow to clone also markers
- only list https ready tilerlayers when page is in https (#567) - only list https ready tilerlayers when page is in https (#567)
- allow to use an unicode character as Marker symbol (#527) - 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 ## 0.8.0

View file

@ -292,7 +292,9 @@ L.U.Map.include({
}, },
initDatalayers: function () { 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 () { var loaded = function () {
self.datalayersLoaded = true; self.datalayersLoaded = true;
self.fire('datalayersloaded'); self.fire('datalayersloaded');
@ -302,8 +304,6 @@ L.U.Map.include({
if (toload === 0) loaded(); if (toload === 0) loaded();
}; };
for (var j = 0; j < this.options.datalayers.length; j++) { for (var j = 0; j < this.options.datalayers.length; j++) {
toload++;
seen++;
datalayer = this.createDataLayer(this.options.datalayers[j]); datalayer = this.createDataLayer(this.options.datalayers[j]);
if (datalayer.displayedOnLoad()) datalayer.onceLoaded(decrementToLoad); if (datalayer.displayedOnLoad()) datalayer.onceLoaded(decrementToLoad);
else decrementToLoad(); else decrementToLoad();