Add a custom halo around the globe

Use the halo option in the map constructor to create a custom halo. You can define a radial gradient with scale and stops to add a custom atmospheric glow around the globe.

This option only takes effect when used in conjunction with the projection: 'globe' parameter.

NPM module setup


npm install --save @maptiler/sdk
import { Map, MapStyle, config } from '@maptiler/sdk';
import '@maptiler/sdk/dist/maptiler-sdk.css';

config.apiKey = 'YOUR_MAPTILER_API_KEY_HERE';
const map = new Map({
  container: 'map', // container's id or the HTML element in which the SDK will render the map
  style: MapStyle.HYBRID,
  projection: "globe",
  halo: {
    scale: 1.5, // Halo size in multiples of the Earth's radius
    stops: [
      [0.0, "rgba(135,206,250,1)"],
      [0.5, "rgba(0,0,250,0.75)"],
      [0.75, "rgba(250,0,0,0.0)"],
    ],
  }
});

Learn more

For halo customization, check the RadialGradientLayerConstructorOptions.

Add an atmospheric glow (halo) around the globe

Globe with halo

Examples

Add a simulated atmospheric glow around the 3D globe.

Custom night satellite image in a goble with space background

Night globe in space

Examples

Display Earth's night satellite imagery on a 3D globe.

Add a milkyway and stars background to the globe

Globe with milkyway and stars

Examples

Add a milkyway and stars background to the globe.

Add a 3D model to globe using MapTiler 3D JS

Add a 3D model to globe using MapTiler 3D JS

Examples

Integrate 3D models into your interactive globe map surface.

Was this helpful?