Create a map using the globe projection.
See the example: https://docs.mapbox.com//mapbox-gl-js/example/globe/
A Pen by Matt Daniel Brown on CodePen.
Create a map using the globe projection.
See the example: https://docs.mapbox.com//mapbox-gl-js/example/globe/
A Pen by Matt Daniel Brown on CodePen.
| <div id="map"></div> | |
| mapboxgl.accessToken = 'pk.eyJ1IjoibWF0dGRhbmllbGJyb3duIiwiYSI6ImNqZHEyeDB1ZzF0d2gzM280bWx5bXdieHAifQ.Mv8GUhLb-OgANr1CRfBcVQ'; | |
| const map = new mapboxgl.Map({ | |
| container: 'map', | |
| style: 'mapbox://styles/mapbox/satellite-streets-v11', | |
| zoom: 1.5, | |
| center: [30, 50], | |
| projection: 'globe' | |
| }); | |
| map.on('load', () => { | |
| // Set the default atmosphere style | |
| map.setFog({}); | |
| }); |
| <script src="https://api.mapbox.com/mapbox-gl-js/v2.9.2/mapbox-gl.js"></script> |
| body { margin: 0; padding: 0; } | |
| #map { position: absolute; top: 0; bottom: 0; width: 100%; } |
| <link href="https://api.mapbox.com/mapbox-gl-js/v2.9.2/mapbox-gl.css" rel="stylesheet" /> |