mirror of
https://github.com/maplibre/maplibre-rs.git
synced 2025-12-08 19:05:57 +00:00
18 lines
456 B
TypeScript
18 lines
456 B
TypeScript
import init from "./dist/libs/mapr";
|
|
|
|
let initialized = false;
|
|
|
|
onmessage = async message => {
|
|
let data = message.data;
|
|
|
|
if (data.type === "init") {
|
|
if (initialized) {
|
|
return;
|
|
}
|
|
initialized = true;
|
|
const module = await init(undefined, data.memory);
|
|
let workflowPtr = data.workflowPtr;
|
|
console.log("Started WorkerLoop: " + workflowPtr)
|
|
module.run_worker_loop(workflowPtr);
|
|
}
|
|
}; |