mirror of
https://github.com/umap-project/umap.git
synced 2025-04-28 19:42:36 +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.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')
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue