Adjust typescript files

This commit is contained in:
Maximilian Ammann 2022-11-02 20:47:46 +01:00
parent 0e15635f2c
commit 40f4200f4a

View File

@ -31,17 +31,16 @@ export const startMapLibre = async (wasmPath: string | undefined, workerPath: st
const memory = new WebAssembly.Memory({initial: 1024, maximum: MEMORY / PAGES, shared: true})
await maplibre.default(wasmPath, memory)
let init_result = await maplibre.init_maplibre(() => {
await maplibre.run_maplibre(() => {
return workerPath ? new Worker(workerPath, {
type: 'module'
}) : MultithreadedPoolWorker();
});
maplibre.run(init_result)
} else {
const memory = new WebAssembly.Memory({initial: 1024, shared: false})
await maplibre.default(wasmPath, memory);
let init_result = await maplibre.init_maplibre((ptr) => {
await maplibre.run_maplibre((ptr) => {
let worker: Worker = workerPath ? new Worker(workerPath, {
type: 'module'
}) : PoolWorker();
@ -55,8 +54,6 @@ export const startMapLibre = async (wasmPath: string | undefined, workerPath: st
}
return worker;
})
maplibre.run(init_result)
});
}
}