Back to all examples
Route progress playground
Hover and click along the route line to see time and distance progress
The bubble sits on the line rather than under the pointer. Every hover snaps to the nearest route point, and a click pins that reading.
getProgressAtNearestRoutePointreturns the snapped position, the distance and the travel time from one lng/lat, with no projection maths.events.mainLinesscopes hover and click to the route line, so neither needs a layer id.events.where({ layerGroups })on the base map names land and water as the rest of the map, where the bubble is dismissed.
Related examples
Add Stops to Route (Playground)
Dynamically add and remove intermediate stops on a route by clicking the map
Playground
Routing
Utilities
User Interaction Events
Web
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
Route Avoid Options Playground
Pick a vehicle, road types to avoid and stretches to box off, and watch London to Brussels replan
Playground
Routing
User Interaction Events
Web
Route waypoints playground
Restyle a route's waypoint pins per role, number or letter its stops, and give them icons of your own.
Playground
Routing
User Interaction Events
Web