mirror of
https://github.com/umap-project/umap.git
synced 2025-04-29 03:42:37 +02:00
feat: load all datalayers in parallel (#2370)
This commit is contained in:
commit
b92490eacc
1 changed files with 3 additions and 1 deletions
|
@ -570,9 +570,11 @@ export default class Umap extends ServerStored {
|
||||||
}
|
}
|
||||||
this.datalayersLoaded = true
|
this.datalayersLoaded = true
|
||||||
this.fire('datalayersloaded')
|
this.fire('datalayersloaded')
|
||||||
|
const toLoad = []
|
||||||
for (const datalayer of this.datalayersIndex) {
|
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.dataloaded = true
|
||||||
this.fire('dataloaded')
|
this.fire('dataloaded')
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue