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:

  1. Token exchange — your backend (or app) exchanges a long-lived API key for a short-lived access token via POST /v1/auth/token
  2. Map rendering — configure your map library to fetch Geog vector tiles with the access token
  3. Places search — query POST /v1/places/search with 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:

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

Every example calls these endpoints:

EndpointMethodPurpose
/v1/auth/tokenPOSTExchange API key for short-lived access token
/v1/tiles/basemap/{z}/{x}/{y}.mvtGETFetch vector tiles
/v1/places/searchPOSTSearch places by text and location

See Also