Developers / Mapsource platform

Build on one geospatial backend

Use standard REST endpoints, MapLibre-compatible tiles and styles, or MCP tools for agents. Start with a complete example, then combine search, navigation, terrain and analysis as your application needs them.

Start here

Each path reaches the same capabilities, authentication model and usage limits. Pick the interface that matches what you are building.

MapLibre integration

Connect a web map through a protected server boundary.

REST quickstart

Make a request, inspect the response and compose API services.

MCP for agents

Connect search, navigation, data, style and terrain tools.

Authenticated server request

Keep the subscription key in a server environment or secret manager. Your backend owns credentials; browsers and mobile clients receive only the data they are allowed to use.

Keep credentials on the server

This request returns current OpenStreetMap features. Convert the response to GeoJSON when the next step is an interactive map.

npm i mapsource
  1. 01Read the key from server-side configuration.
  2. 02Send it only in the Bearer header.
  3. 03Handle non-2xx responses before reading data.
const response = await fetch("https://api.mapsource.io/interpreter", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.MAPSOURCE_API_KEY,
    "Content-Type": "text/plain"
  },
  body: '[out:json][timeout:30];nwr["amenity"="cafe"](47.60,-122.34,47.62,-122.31);out geom 100;'
});

if (!response.ok) {
  throw new Error("Mapsource request failed: " + response.status);
}

const data = await response.json();

MapLibre GL JS integration

MapLibre owns the renderer and interaction model. Mapsource supplies tiles, compiled styles and the geospatial services around the map.

01Browser

MapLibre requests a style and visible resources.

02Your backend

Allow-lists Mapsource paths and attaches the service key.

03Mapsource

Returns tiles, glyphs and service responses.

map.tsMapLibre GL JS
import maplibregl from "maplibre-gl";
import "maplibre-gl/dist/maplibre-gl.css";
import { installMapsourceUI } from "https://mapsource.io/map-ui/v1/map-ui.mjs";

const mapsourceOrigin = "https://api.mapsource.io";

const map = new maplibregl.Map({
  container: "map",
  center: [-122.68, 45.52],
  zoom: 11,
  attributionControl: { compact: true },
  style: `${mapsourceOrigin}/styles/mapsource/style.json`,
  transformRequest: (url) => {
    const request = new URL(url, window.location.href);
    if (request.origin !== mapsourceOrigin) return { url };

    // Your backend validates this path and adds the service key.
    return { url: `/mapsource-proxy?path=${encodeURIComponent(
      request.pathname + request.search
    )}` };
  }
});

const disposeMapUI = installMapsourceUI(map);
// On teardown: disposeMapUI(); map.remove();

Customize the basemap

Change roads, land, water, buildings, labels, fonts and POIs without authoring raw style JSON. Compiled styles include metadata["mapsource:ui"] for the shared attribution and label helper.

API capabilities

Compose operations behind the same API key. The generated reference remains the source for request shapes, limits and errors.

OpenStreetMap / Overpass queries

Query global roads, buildings, infrastructure, amenities, boundaries and other tagged map features with Overpass QL.

Raster & vector basemaps

Add maps with ready-to-use raster tiles or styleable OpenMapTiles vector tiles, discovered through the live basemap catalog.

Custom basemaps

Control road classes, labels, land use, fonts and visual styling. Generate from intent, save profiles and reuse revisions.

Routing

Calculate routes between locations with turn-by-turn directions, travel profiles and optional elevation.

Travel-time matrices

Calculate travel times and distances across multiple origins and destinations.

Isochrones

Map the area reachable within one or more travel-time limits, such as 15 or 30 minutes.

Map matching & snapping

Fit noisy GPS traces to the road network and snap individual coordinates to nearby roads.

Route optimization

Optimize the visit order for a set of stops and return the resulting route.

Address & business search

Find addresses, businesses and brands, autocomplete places, discover regional POIs and reverse geocode coordinates.

Terrain / elevation

Sample ground elevation, render Terrarium terrain tiles in 3D and generate elevation contours.

Spatial analysis

Buffer, measure, intersect, combine and simplify geometries on the server.

Compute pipelines & result handles

Run dependent search, navigation and analysis steps together, then pass or retrieve typed results without moving intermediate payloads.

Static map rendering

Render basemaps and geospatial overlays to images for reports, previews and sharing.

Developer resources

Use generated contracts instead of maintaining a second description of the service in your application or agent.

Preparing an agent integration?