Examples
Working examples for integrating the Geog API into web, framework, and mobile applications. Every example implements the same three-step pattern: token exchange, vector tile rendering, and places search.
Integration Pattern
All examples follow this flow:
- Token exchange — your backend (or app) exchanges a long-lived API key for a short-lived access token via
POST /v1/auth/token - Map rendering — configure your map library to fetch Geog vector tiles with the access token
- Places search — query
POST /v1/places/searchwith text and a map-center location, then display results as markers
The token is cached and refreshed at 80% of its TTL so requests never use an expired credential.
Map Styles
All examples use the Light theme by default. Geog provides four hosted styles — swap the URL path segment to change themes:
| Theme | Style URL |
|---|---|
| Light | https://assets.geog.dev/styles/v0/light.json |
| Dark | https://assets.geog.dev/styles/v0/dark.json |
| Gray | https://assets.geog.dev/styles/v0/gray.json |
| Warm | https://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
| Platform | Library | Directory | Guide |
|---|---|---|---|
| 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 15 | MapLibre + React 19 | `frameworks/nextjs-maplibre` | Next.js Guide |
| Angular 19 | MapLibre | `frameworks/angular-maplibre` | Angular Guide |
| SvelteKit 2 | MapLibre + Svelte 5 | `frameworks/sveltekit-maplibre` | SvelteKit Guide |
| iOS | MapLibre Native (Swift) | `mobile/ios-maplibre` | iOS Guide |
| Android | MapLibre 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
Every example calls these endpoints:
| Endpoint | Method | Purpose |
|---|---|---|
/v1/auth/token | POST | Exchange API key for short-lived access token |
/v1/tiles/basemap/{z}/{x}/{y}.mvt | GET | Fetch vector tiles |
/v1/places/search | POST | Search places by text and location |
See Also
- Token Exchange API — Endpoint specification for short-lived tokens
- Authentication — How API authentication works
- Errors — Error codes and handling patterns