Directions
Computes routes on the map, Google-style: a start (A) and a destination (B), optional intermediate waypoints, each entered as an address or picked directly on the map with a crosshair. Reverse the order in one click, or turn the trip into a loop back to the start. The computed route draws on the map with its distance and duration.
A route worth keeping can be saved as a “Route” layer — it then behaves like any layer (legend, styling, publishing) — or downloaded as GeoJSON.
Parameters
Section titled “Parameters”| Parameter | What it does |
|---|---|
| Provider | The routing service: the public OSRM demo server (no key, driving only, rate-limited) or Mapbox Directions using your account’s public token — the key never enters the map document. |
| Transport modes | Which of the provider’s modes (driving, walking, cycling) end-users can pick. |
| Open by default | The route panel is open when end-users load the map. |
| Address autocomplete | Suggests up to 3 matches in a dropdown while end-users type an address. |
| Route colors | The colors of the start (A), the destination (B), the intermediate waypoints and the route line. |
| Zoom to computed route | Fits the map view on each route once it is computed (on by default). |
| End-users can export GeoJSON | Shows a download button once a route is computed. |
| Position | The map corner the widget lives in. |
What end-users see
Section titled “What end-users see”A route button in the corner you picked opens the panel. They fill A and B by typing addresses (with suggestions as they type, if you enabled autocomplete) or picking points on the map, add waypoints, reverse or loop the trip, and switch among the transport modes you offered. Routes they compute stay local to their session; the view zooms to each computed route (if you kept that on), “Save as layer” adds the route to the map’s layer list, and the GeoJSON download appears if you allowed it. A short notice states which service receives the waypoints.