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
| Flag | Controls | Default in embed mode |
|---|---|---|
search | Search bar | on |
events | Events button and list | on |
directions | Directions entry points | on |
panel | Detail panel, and the mobile drawer | on |
floors | Floor picker | on |
location | Current-location button | on |
compass | Compass, home, and 2D toggle | on |
share | Share button | on |
expand | Open-in-new-tab button | on |
branding | Waylocate logo and campus badge | on, 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.
| Token | Effect |
|---|---|
none | Sets every flag off |
all | Sets every flag on |
-name | Sets that flag off |
name | Sets that flag on |
| Anything else | Ignored |
?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.
| With | The visitor loses | You keep |
|---|---|---|
-directions | The directions buttons | directions.start(), and from / to in the URL |
-panel | The map's detail panel | Selection, and selection.changed events |
-search | The search bar | Every selection command |
-floors | The floor picker | selection.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
- Appearance for changing flags at runtime.
- Planned customization for what is not configurable yet.