mirror of
https://github.com/maplibre/maplibre-rs.git
synced 2025-12-08 19:05:57 +00:00
20 lines
520 B
JavaScript
20 lines
520 B
JavaScript
import init from "mapr";
|
|
|
|
const start = async () => {
|
|
const memory = new WebAssembly.Memory({initial: 1024, maximum: 10 * 1024, shared: true});
|
|
const init_output = await init(undefined, memory);
|
|
|
|
const fetch_worker = new Worker(new URL('./fetch-worker.js', import.meta.url), {
|
|
type: "module",
|
|
});
|
|
|
|
fetch_worker.postMessage({type: "init", memory, address: init_output.test_alloc()});
|
|
|
|
fetch_worker.onmessage = (e) => {
|
|
console.log(e)
|
|
}
|
|
|
|
await init_output.run();
|
|
}
|
|
|
|
start(); |