Basemap Switcher control
The Basemap Switcher (labelled Basemaps in the config panel) is a custom control that lets viewers swap the WebMap's basemap between its default and up to four configured alternatives.
What it does
Shows a compact switcher with one entry per option. Selecting an option swaps the view's basemap to that gallery basemap; selecting the default entry restores the WebMap's authored basemap. Unlike the Esri basemap gallery, the choices are curated by the config—viewers only see the basemaps you allow.
Configuration
| Field | Type | Default | Purpose |
|---|---|---|---|
basemapSwitcher.placement | ControlPlacement | null | null | Corner placement, or null to hide. |
basemapSwitcher.defaultLabel | string | "Default" | Label for the WebMap's own basemap. |
basemapSwitcher.options | BasemapOption[] (max 4) | [] | Alternate basemaps the viewer can pick. |
Each BasemapOption is { itemId, label }, where itemId is the portal item
id of a Basemap item from the portal's basemap gallery and label is the
text shown for it.
In the config panel
- Open Appearance → UI controls and drag the Basemaps chip onto a corner (or into a corner's expand).
- Once placed, an options editor appears: set the Default basemap label and add up to four basemap options, picking each from the portal's basemap gallery and giving it a label.
Behavior
- Limited to four alternate options plus the default.
- Options are Basemap portal items, so they respect the active portal / connection.
- Removing the control from the map hides the switcher but keeps its configured options for when it is placed again.