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