Maximum allowed detour time in seconds.
Only POIs reachable within this additional travel time from the route will be returned. Controls the width of the search corridor.
Route geometry to search along.
Accepts any of three forms:
Route feature as returned by calculateRoute (most common)LineString GeoJSON geometry objectPosition[] — a plain array of [longitude, latitude] coordinate pairsCoordinates must always be in [longitude, latitude] order.
OptionalsortBy?: AlongRouteSortBySort order for the results.
Key Features:
Use Cases:
// Find coffee shops within a 5-minute detour from a route
const results = await search({
route: routeResult.features[0],
maxDetourTimeSeconds: 300,
query: 'coffee',
});
// Find EV charging stations using a plain coordinate array
const chargers = await search({
route: [[4.9, 52.37], [4.95, 52.28], [5.1, 52.09]],
maxDetourTimeSeconds: 600,
poiCategories: ['ELECTRIC_VEHICLE_STATION'],
sortBy: 'detourOffset',
});
Parameters for searching places along a route.
Along-route search finds POIs near a provided route geometry and ranks them by the detour cost (time or distance offset) required to visit them.