What the routing SDK adds

The routing services, the map modules and the core types work as one. Every response is GeoJSON that the next call and the map take unchanged.

What you get

  • Fields the API doesn’t return, computed from the ones it does.
  • Section types drawn and styled by config, not by layer specs.
  • Every output is the next call’s input, with no adapters and one API key.
  • The MapLibre escape hatch stays open. Use map.mapLibreMap, or a full layer spec per section whenever you want one.

Fields the API does not return

FieldHow the SDK derives it
LegSummary.stopTimeInSecondsThe API has no wait-time field. Time at a stop is the gap between one leg’s arrival and the next leg’s departure.
Route versus leg travelTimeInSecondsThe route total includes time at stops, while per-leg values are driving only. The difference is the time standing still.
Instruction.pathPointIndexEach maneuver point matched to its index in the route geometry.
distinct sectionsThe API doesn’t compare the routes it returns. When there are two or more, the SDK finds the stretches each one drives alone and measures them.
countryCodeISO3 on country and vignette sections, countryCode on instructionsConverted from the API’s ISO 2 codes.
categories on traffic sectionsRead from the incident’s TPEG2-TEC cause codes, or from its icon category when it has none.

Sections, drawn and styled

A route carries sections, the stretches with a property worth showing, such as traffic delays, tunnels, ferries, toll roads, low-emission zones, unpaved surfaces and speed limits. The route object lists every type.

  • Without sectionTypes, the SDK asks for all 18 requestable types. If you pass a list, it drops any type you left out, even where the API returns it anyway.
  • RoutingModule draws 15 of them. To restyle one, change its config, not a layer spec:
const routing = await RoutingModule.create(map, {
sections: {
urban: { visible: true },
lowEmissionZone: { color: '#1B7A43', opacity: 0.8 },
},
});
  • The stretches worth seeing at a glance, such as tunnels, ferries, toll roads and traffic, draw by default. urban is opt-in because it spans most of a route. Route sections covers which draw by default and every knob.
  • The module also handles what breaks in a hand-rolled version. That covers the z-order between the selected route and its alternatives, surviving a setStyle, keeping two route modules on one map from colliding, and hit-testing.

Every output is the next call’s input

Each step takes the previous step’s response unchanged:

const waypoints = await Promise.all(['Munich, DE', 'Innsbruck, AT', 'Verona, IT'].map(geocodeOne));
const routes = await calculateRoute({ locations: waypoints });
// The route feature goes straight into the search
const alongRoute = await discoverPlaces({
filters: { poiCategories: ['CHARGING_LOCATION'] },
route: routes.features[0],
maxDetourTimeSeconds: 300,
});
// The destination waypoint goes straight into the range
const ranges = await calculateReachableRanges([
{ origin: waypoints.at(-1), budget: { type: 'timeMinutes', value: 20 } },
]);
  • All four calls share one key and one configuration, and their results go to the map modules unchanged.
  • The demo above shows this chain on a map.

Where a reachable range goes

A reachable range is a polygon, not a route, so RoutingModule doesn’t draw it. The reachable ranges module does. It titles each band from its budget and nests each origin’s bands.