Skip to content

Basemap

Switches the active basemap. Lists every entry from settings.basemaps with a thumbnail and name; picking one swaps the map style. Your layers and visibility/opacity edits survive the switch.

  • id: basemap
  • Surfaces: top-bar, left-panel

Place it

leftPanelWidgets: [{ widgetName: 'basemap' }],
// or
topBarWidgets: [{ widgetName: 'basemap' }],

Configuration

The basemap list comes from the top-level basemaps array:

basemaps: [
  { id: 'positron', name: 'Positron', style: 'https://tiles.openfreemap.org/styles/positron' },
  { id: 'liberty',  name: 'Liberty',  style: 'https://tiles.openfreemap.org/styles/liberty' },
],
Field Type Description
id string Unique id
name string Display name (also used to resolve the thumbnail)
style string \| StyleSpecification Style URL or inline style object
thumbnail string Optional explicit thumbnail image

Thumbnails

If you don't set thumbnail, the widget looks for an image at ./basemap-images/<name>.jpg (lowercased) inside the widget folder. The demo ships thumbnails for each default basemap. Images are center-cropped into a uniform square, so near-square screenshots all line up. A missing image falls back to a neutral placeholder.