Skip to content

50,000 free calls a month, card-free. Get an API key →

Documentation menu
docs / examples / globe-projection
Example

Globe projection

The map on a sphere rather than a plane, for the zoomed-out view. Globe is a MapLibre projection, so it is set on the underlying map; the navigation chase camera is mercator only and says so.

ts
import { createMap, NavigationCamera } from "@mapmap/maps";

const map = createMap({
  container: "map",
  apiKey: "snk_...",
  attributionPosition: "bottom-left",
  center: [0, 25],
  zoom: 2,
});

await map.whenReady();

// map.map is the underlying MapLibre map; globe is a MapLibre v5 projection.
map.map.setProjection({ type: "globe" });

// Check before arming a chase camera: its low-anchor offset maths and
// top-down overview framing are mercator only.
NavigationCamera.isSupported(map); // false under globe