Skip to main content

Advanced — you own the iframe

For server-rendered markup, CMS templates, or legacy pages where the <iframe> already exists:

import { buildEmbedUrl, connect } from "@waylocate/embed";

const iframe = document.getElementById("map");
iframe.src = buildEmbedUrl({
campus: "ucba",
building: "muntz-hall",
hostOrigin: window.location.origin,
});

const map = await connect({ iframe });
// same handle from here — map.selection, map.camera, map.on(), etc.

hostOrigin names the one origin allowed to control the frame. If it is wrong, the map renders but ignores commands.

See URL parameters for the full query-string reference.