Commands
Every command listed here is answered with exactly one result. Payloads are
validated before they reach the map: wrong types are rejected with
INVALID_PAYLOAD, unrecognised command names with UNSUPPORTED.
For what each one does, see the control section, which covers the same surface through the SDK.
Selection
| Command | Payload |
|---|---|
selection.setBuilding | { ref, floor? } |
selection.setFloor | { ref } |
selection.setRoom | { ref } |
selection.clear | none |
Directions
| Command | Payload |
|---|---|
directions.start | { from?, to, mode?, accessible? } |
directions.clear | none |
mode is "preview" or "live".
Camera
| Command | Payload | Returns |
|---|---|---|
camera.get | none | CameraOptions | null |
camera.jumpTo | CameraOptions | |
camera.flyTo | CameraOptions & AnimationOptions | |
camera.fitTo | { ref } | |
camera.cancel | none | |
camera.setInteractions | { pan?, zoom?, rotate? } | |
camera.setBasemap | { mode: "standard" | "satellite" } | |
camera.setPath | { keyframes, smoothing? } | |
camera.setProgress | { progress } | |
camera.playPath | { keyframes, duration, loop?, essential?, smoothing? } | |
camera.orbit | { ref?, center?, zoom?, pitch?, secondsPerRevolution, direction?, loop?, essential? } | |
camera.followRoute | { mode, duration?, pitch?, zoom?, essential? } |
interface CameraOptions {
center?: { lat: number; lng: number };
zoom?: number; // 0 to 22
bearing?: number; // degrees, 0 is north; wrapped into [0, 360)
pitch?: number; // degrees from vertical, 0 to 60
}
interface AnimationOptions {
duration?: number; // milliseconds, default 700. 0 is instant.
animate?: boolean;
essential?: boolean; // animate even under reduced-motion preferences
curve?: number; // opts into a flight arc
speed?: number; // opts into a flight arc
}
Out-of-range values are rejected with INVALID_PAYLOAD rather than clamped.
Unknown fields on camera payloads are ignored.
interface CameraPathKeyframe {
at: number; // 0 to 1, ascending; first 0, last 1
camera?: CameraOptions;
ref?: string;
easing?: "linear" | "easeIn" | "easeOut" | "easeInOut";
floorId?: string; // route paths only
}
camera.followRoute takes mode: "progress" to load a path for host-driven
scrubbing, or mode: "time" to play it once.
Behaviour, including how bearing is interpolated and how reduced-motion preferences are handled, is documented in camera.
Interface
| Command | Payload |
|---|---|
ui.setChrome | Partial<ChromeFlags> |
Unknown keys are rejected with INVALID_PAYLOAD, unlike the ui= URL
parameter, which ignores them. branding: false is also rejected, because the
flag cannot take effect and reporting success would be untrue. Flags are listed
in chrome flags.
State and session
| Command | Payload | Returns |
|---|---|---|
map.getState | none | WaylocateState |
events.subscribe | { events: string[] } | |
events.unsubscribe | { events: string[] } | |
host.hello | { sdk?, protocol? } | Readiness payload |
host.hello accepts an empty payload, because it doubles as a readiness probe
and a host writing messages by hand has a legitimate reason to send it bare.
Fields are type-checked when present, and an absent sdk is recorded as
unknown rather than blank, which keeps hand-written hosts distinguishable from
SDK ones.
Only camera.changed and camera.idle require subscription. Every other event
is delivered by default. expand.requested is delivered either way, but
subscribing to it changes the map's own behaviour; see
events.