diff --git a/umap/static/umap/js/modules/umap.js b/umap/static/umap/js/modules/umap.js index 664d8ea0..46d4c56f 100644 --- a/umap/static/umap/js/modules/umap.js +++ b/umap/static/umap/js/modules/umap.js @@ -570,9 +570,11 @@ export default class Umap extends ServerStored { } this.datalayersLoaded = true this.fire('datalayersloaded') + const toLoad = [] for (const datalayer of this.datalayersIndex) { - if (datalayer.showAtLoad()) await datalayer.show() + if (datalayer.showAtLoad()) toLoad.push(datalayer.show()) } + await Promise.all(toLoad) this.dataloaded = true this.fire('dataloaded') }