Along route search service NodeJS
Find fast chargers within a one-minute detour of a route, from a Node.js process
Loading the sandbox…
Amsterdam and Utrecht are geocoded and routed, and the high-power charging stations within a short detour of that route print to the console, each with the time and distance its detour adds.
geocodeOnereturns oneWaypointper name, socalculateRoutetakes them directly, with no result list to pick through.discoverPlacesaccepts the route feature itself underroute, making “along this line, within this detour” a query rather than a filter over wider results.maxDetourTimeSecondsandfilters.minPowerKWnarrow the set at the service before anything is returned.- Each place’s
detourTimeInSecondsanddetourDistanceInMetersare typed properties. A negative value means the route through the charger beats the original one.
Related examples
Add Stops to Route
Find stops along a route within a one-minute detour and insert them all at optimal positions in a single call.
Getting Started
Routing
Search and Geocoding
Electric Vehicles
Utilities
Web
Along route search
Find the beaches and viewpoints within a one-minute detour of a coastal drive
Getting Started
Routing
Search and Geocoding
Web
EV chargers nearby
Fast charging stations near one location, filtered by connector and power, with each station's connectors on click
Getting Started
Electric Vehicles
Search and Geocoding
Places and POIs
Web
Batch geocoding with error handling NodeJS
Geocode several addresses in parallel from Node.js and report each failure by its SDK error code
Getting Started
Search and Geocoding
Node.js