Vanilla JavaScript — mount()
<div id="map" style="width:100%; height:600px"></div>
import { mount } from "@waylocate/embed";
const map = await mount({
container: "#map",
campus: "ucba",
building: "muntz-hall",
room: "muntz-hall/170",
});
await map.camera.flyTo({ zoom: 18, bearing: 45, duration: 800 });
map.on("selection.changed", (selection, meta) => {
if (meta.source === "user") openPanel(selection.room);
});
map.destroy();
mount() accepts an AbortSignal for cleanup in frameworks that double-invoke effects. On failure or abort, the SDK removes the surface it created.