Skip to main content

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

CommandPayload
selection.setBuilding{ ref, floor? }
selection.setFloor{ ref }
selection.setRoom{ ref }
selection.clearnone

Directions

CommandPayload
directions.start{ from?, to, mode?, accessible? }
directions.clearnone

mode is "preview" or "live".

Camera

CommandPayloadReturns
camera.getnoneCameraOptions | null
camera.jumpToCameraOptions
camera.flyToCameraOptions & AnimationOptions
camera.fitTo{ ref }
camera.cancelnone
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

CommandPayload
ui.setChromePartial<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

CommandPayloadReturns
map.getStatenoneWaylocateState
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.

Next

  • Events for what the map sends back.
  • Errors for failure results.