Skip to content

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

Documentation menu
docs / examples / reachable-area
Example

Reachable area (isochrones)

How far a vehicle gets from a point inside a time budget, as GeoJSON you can drop straight onto a map. Pass a truck profile and the contour respects the dimensions the vehicle actually has.

ts
import { IsochroneLayer } from "@mapmap/maps";

const rings = new IsochroneLayer(map); // baseUrl and apiKey come from the map

const geojson = await rings.showReachability({
  origin: { lat: 51.5074, lon: -0.1278 },
  mode: "walk",          // "walk" | "cycle" | "drive" | "truck" | raw costing
  minutes: [5, 10, 15],
  color: "#3a86ff",
});

// Graduated fills, contour outlines and "N min" labels, and it survives a
// theme swap. The resolved value is the raw FeatureCollection.
rings.clear();