Display a globe with a vector map
Replicates the MapLibre example Display a globe with a vector map.
The complete document
Section titled “The complete document”# yaml-language-server: $schema=https://docs.maplibre-yaml.org/schema/latest/map.schema.json# Gallery twin of https://maplibre.org/maplibre-gl-js/docs/examples/display-a-globe-with-a-vector-map/# Upstream calls setProjection in a style.load handler; here it is one key.type: mapid: display-a-globe-with-a-vector-mapconfig: center: [0, 0] zoom: 2 mapStyle: "https://demotiles.maplibre.org/style.json"projection: type: globeWhat to notice
Section titled “What to notice”- Upstream calls
map.setProjectionin astyle.loadhandler; hereprojection: { type: globe }is a document-root key in the style spec’s own shape, and it exports to the style.json rootprojection. - Globe needs maplibre-gl 5.0.0 or later. On 4.x the document warns once and renders in mercator, so it never fails silently.