Skip to content
EN

Change the basemap

Last updated

By the end of this guide, you will be able to change the basemap—the base imagery shown on the globe—from your Plugin. This guide assumes you are familiar with the basic Plugin structure of reearth.yml and an extension file.

You change the basemap by calling reearth.viewer.overrideProperty with a tiles array. Each entry describes one tile source. Re:Earth Visualizer includes several built-in basemaps you can select by name, and you can also point to a custom tile server by URL.

This example switches the basemap to the Japan GSI standard map.

reearth.yml

id: basemap-plugin
name: Basemap Plugin
version: 1.0.0
extensions:
- id: basemap-demo
type: widget
name: Basemap Demo

basemap-demo.js

reearth.viewer.overrideProperty({
tiles: [
{
id: "gsi",
type: "japan_gsi_standard",
},
],
});

When the widget loads, the globe’s base imagery is replaced with the Japan GSI standard map.

The Japan GSI standard basemap shown in Re Visualizer

reearth.viewer.overrideProperty sets viewer properties at runtime. To change the basemap, you pass a tiles array—the imagery you provide replaces the current basemap. Each tile entry needs an id (a unique identifier you choose) plus either a built-in type or a custom url.

To use one of Re:Earth Visualizer’s built-in basemaps, set type to the basemap name. No URL is needed—each built-in already knows where to load its tiles from.

TypeBasemapRequires Cesium Ion token
open_street_mapOpenStreetMapNo
japan_gsi_standardJapan GSI standard mapNo
carto_lightCARTO lightNo
defaultCesium Ion default imageryYes
default_roadCesium Ion road mapYes
default_labelCesium Ion labelled imageryYes
black_marbleEarth at nightYes

Basemaps marked “Yes” load imagery from Cesium Ion and only work if a Cesium Ion access token is configured in your scene.

To use a tile server not listed above, provide a url using the standard {z}/{x}/{y} template format:

reearth.viewer.overrideProperty({
tiles: [
{
id: "custom",
url: "https://example.com/tiles/{z}/{x}/{y}.png",
},
],
});