Add an atmospheric glow (halo) around the globe
Use the halo:true option in the map constructor to enable a simple halo. This feature adds an atmospheric glow around the globe, simulating the visual effect of Earth’s atmosphere when viewed from space.
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.SATELLITE,
projection: "globe",
halo: true
});
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="robots" content="noindex">
<title>Add an atmospheric glow (halo) around the globe | NPM example</title>
<link rel="stylesheet" href="./style.css">
</head>
<body>
<div id="map"></div>
<script type="module" src="./main.js"></script>
</body>
</html>
body {
margin: 0;
padding: 0;
}
#map {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
background-color: black;
}
Learn more
For halo customization, check the RadialGradientLayerConstructorOptions.