Skip to main content

Chrome flags

Chrome flags decide which of the map's own interface elements are visible. The same set of flags is available in the embed URL and through map.ui.setChrome().

The flags

FlagControlsDefault in embed mode
searchSearch baron
eventsEvents button and liston
directionsDirections entry pointson
panelDetail panel, and the mobile draweron
floorsFloor pickeron
locationCurrent-location buttonon
compassCompass, home, and 2D toggleon
shareShare buttonon
expandOpen-in-new-tab buttonon
brandingWaylocate logo and campus badgeon, cannot be disabled

expand is the only flag whose default differs between embed mode and the standalone map, where it is off. Everything else keeps the same default in both.

In a URL

The ui parameter takes comma-separated tokens, processed left to right.

TokenEffect
noneSets every flag off
allSets every flag on
-nameSets that flag off
nameSets that flag on
Anything elseIgnored
?embed=1&ui=-search,-events hide two, leave the rest alone
?embed=1&ui=none,floors hide everything, then restore the floor picker

Because tokens apply in order, none followed by the flags you want is the way to express an allow-list, and a leading - on each is the way to express a deny-list.

Unrecognised tokens are ignored rather than rejected. A URL is often written by hand, and failing the whole parameter over one typo would be worse than skipping it. ui is ignored entirely unless embed=1 is also present.

In a command

await map.ui.setChrome({ search: false, events: false });

Omitted flags are left as they are. Unknown keys are rejected with INVALID_PAYLOAD, unlike in a URL, because a command is generated by a program and silently dropping part of it would leave your code believing something is hidden when it is not.

branding: false is rejected for the same reason: the flag cannot take effect, so accepting it would report a success that did not happen.

Hiding an element does not remove the feature

Flags control entry points. The underlying capability stays available to your page and to the URL.

WithThe visitor losesYou keep
-directionsThe directions buttonsdirections.start(), and from / to in the URL
-panelThe map's detail panelSelection, and selection.changed events
-searchThe search barEvery selection command
-floorsThe floor pickerselection.setFloor()

This is what makes it possible to replace one part of the map's interface with your own without giving up the rest of it. See appearance.

Common configurations

// Ambient background map: no interface, no gestures
await mount({
container: "#hero",
campus: "ucba",
ui: "none",
});
map.camera.setInteractions({ pan: false, zoom: false, rotate: false });

// Your own detail interface, the map's own selection behaviour
await mount({ container: "#map", campus: "ucba", ui: "-panel,-search" });

// Wayfinding only
await mount({ container: "#map", campus: "ucba", ui: "none,floors,location" });

Next