Reachable Ranges
calculateReachableRanges computes the geographic area reachable from a given origin within a specified budget — such as travel time, distance, or EV charge — and returns GeoJSON polygon features representing the reachable area for each budget value. Multiple budgets in a single call produce concentric rings.
Budget types
Each call requires a budget that defines what constrains the reachable area:
timeMinutes– Area reachable within a given travel time (minutes)distanceKM– Area reachable within a given distance (kilometres)remainingChargeCPT– Area reachable with at least X% charge remainingspentChargePCT– Area reachable spending at most X% of chargespentFuelLiters– Area reachable spending at most X litres of fuel
EV budget types (remainingChargeCPT, spentChargePCT) require a full electric vehicle configuration. See Vehicle Configuration .
Example
import { GeometriesModule, TomTomMap, reachableRangeGeometryConfig } from '@tomtom-org/maps-sdk/map';import { calculateReachableRanges } from '@tomtom-org/maps-sdk/services';
const origin: [number, number] = [4.9, 52.37];
// Calculate three concentric time-budget ringsconst result = await calculateReachableRanges([ { origin, budget: { type: 'timeMinutes', value: 10 } }, { origin, budget: { type: 'timeMinutes', value: 20 } }, { origin, budget: { type: 'timeMinutes', value: 30 } },]);
// result.features — one PolygonFeature per budget, ordered largest first// result.bbox — bounding box covering all features
// Display on map — labels ('30 min', '20 min', '10 min') applied automaticallyconst map = new TomTomMap({ mapLibre: { container: 'map', center: origin, zoom: 9 } });const rangesModule = await GeometriesModule.get(map, reachableRangeGeometryConfig());rangesModule.show(result);reachableRangeGeometryConfig derives labels from each feature’s budget property automatically and applies themed styling. Pass a palette and theme to customise:
reachableRangeGeometryConfig('teal', 'outline')Available themes: 'filled' (default), 'outline', 'inverted'. See Geometry Module for more on display configuration.
Manual control
For full control, bypass reachableRangeGeometryConfig and set properties directly on each feature:
import { GeometriesModule } from '@tomtom-org/maps-sdk/map';
const features = result.features.map((f, i) => ({ ...f, properties: { ...f.properties, title: `Zone ${i + 1}`, // custom label theme: 'inverted', // 'filled' | 'outline' | 'inverted' },}));
const module = await GeometriesModule.get(map, { colorConfig: { fillColor: 'blues' } });module.show({ type: 'FeatureCollection', features });Unsupported options
All budgets in a single calculateReachableRanges call must share the same origin and budget type.
API Reference
- calculateReachableRanges – Service function
- ReachableRangeParams – Request parameters
- reachableRangeGeometryConfig – Map display config factory
- Calculate Reachable Range API – API documentation
Related Guides and Examples
Related Guides
- Vehicle Configuration – EV parameters for charge-based budgets
- Long Distance EV Routing – Route calculation with charging stops
- Geometry Module – Displaying polygon geometries on the map