Add a milkyway and stars background to the globe

Use the space preset option in the map constructor to provide a more realistic space background for your maps.

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

In this example, we’ll use a Milky Way background, but you can choose: star backgrounds, space backgrounds, and more. See all the predefined presets backgrounds.

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.SATELLITE,
  projection: "globe",
  zoom: 1,
  center: [75.9, 26.9],
  space: {
    preset: "milkyway-bright"
  }
});

Learn more

For space customization and options, check the CubemapLayerConstructorOptions.

Add a custom halo around the globe

Globe with custom halo

Examples

Add a custom atmospheric glow effect around your globe.

Add a start space background to the globe

Globe with initial space background

Examples

Add a deep space background environment to the globe.

Add a custom milkyway, stars and halo background to the globe

Globe with milkyway and halo

Examples

Add a red Milky Way and halo 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?