Back to all 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.
Two waypoints go in, a route comes back, and the chargers beside it join it as extra stops, in along-route order, on a single recalculation.
discoverPlacestakes the route itself as an input, so “along this route, within this detour” is a query rather than a post-filter.withInsertedWaypointsprojects old and new stops onto the route and orders them, so the insert positions are not yours to work out.RoutingModule.showRoutesandshowWaypointsredraw the updated journey straight from the service response, with no layer bookkeeping.
Related examples
React Route Planner
Search, add and drag stops, set how long you stay at each, follow the trip on a timeline of its road sections, then fly over it.
Playground
Routing
Search and Geocoding
Electric Vehicles
User Interaction Events
Utilities
Plugins
Web
React
Along route search
Find the beaches and viewpoints within a one-minute detour of a coastal drive
Getting Started
Routing
Search and Geocoding
Web
Display units
Switch a route's labels and your own text between metric, imperial UK and imperial US units.
Getting Started
Utilities
Routing
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