Examples

Working examples for integrating the Geog API into web, framework, and mobile applications. Web and framework examples follow a three-step pattern: token exchange, vector tile rendering, and places search. Mobile examples use direct API-key auth with bundle ID restrictions instead of token exchange.

Integration Pattern

All examples follow this flow:

  1. Token exchange (web/framework examples) — your backend exchanges a long-lived API key for a short-lived access token via POST /v1/auth/token. The token is cached and refreshed at 80% of its TTL so requests never use an expired credential.
  2. Bundle ID restrictions (mobile examples) — the app sends its API key directly with an X-App-Bundle-Id header. The API rejects requests whose bundle/application ID doesn't match the token's allowed list. No token exchange required.
  3. Map rendering — configure your map library to fetch Geog vector tiles with the access token or API key
  4. Places search — query POST /v1/places/search with text and a map-center location, then display results as markers

Map Styles

All examples use the Light theme by default. Geog provides four hosted styles — swap the URL path segment to change themes:

ThemeStyle URL
Lighthttps://assets.geog.dev/styles/v0/light.json
Darkhttps://assets.geog.dev/styles/v0/dark.json
Grayhttps://assets.geog.dev/styles/v0/gray.json
Warmhttps://assets.geog.dev/styles/v0/warm.json

Each style includes 109 layers, matching sprites, and glyphs. See the Styles & Sprites guide for full details, npm packages, and custom style options.

Examples

PlatformLibraryDirectoryGuide
Web (Node.js)MapLibre GL JS`web/maplibre`Web Guide
Web (Node.js)Leaflet`web/leaflet`Web Guide
Web (Node.js)OpenLayers`web/openlayers`Web Guide
Next.js 15MapLibre + React 19`frameworks/nextjs-maplibre`Next.js Guide
Angular 19MapLibre`frameworks/angular-maplibre`Angular Guide
SvelteKit 2MapLibre + Svelte 5`frameworks/sveltekit-maplibre`SvelteKit Guide
iOSMapLibre Native (Swift)`mobile/ios-maplibre`iOS Guide
AndroidMapLibre Native (Kotlin)`mobile/android-maplibre`Android Guide

Getting the Examples

git clone https://github.com/geogdev/examples.git
cd examples

Each example directory is self-contained with its own dependencies and README.

API Endpoints Used

Examples use these endpoints:

EndpointMethodPurposeStability
/v1/auth/tokenPOSTExchange API key for short-lived access token (web/framework examples only)Stable
/v1/tiles/basemap/{z}/{x}/{y}.mvtGETFetch vector tilesStable
/v1/places/searchPOSTSearch places by text and locationPreview — will change

See Also