Setup
Login or Register to Admin Portal
Select Functions
Select your desired App and Keyset
Select "Explore Templates" and proceed with selected integration.
Walkthrough
The block requires five inputs: two pairs of latitude, longitude and the type of desired transportation method. Once the response comes from Mapbox, the block appends the directions into the message payload.
Input
Input Channel: mapbox-directions-channel (configurable)lat1, lng1 is the origin coordinateslat2, lng2 is the destination coordinatesprofile represents the type of transporation: mapbox/driving, mapbox/cycling or mapbox/walking
Output
The block appends the directions returned by the Mapbox Directions API into the message payload. Please refer to the Mapbox documentation for field information.
Mapbox's Directions provides a variety of traffic-aware navigation features, including walking, driving, and cycling directions, ETAs, alternative routes, and turn-by-turn instructions, all laid upon Mapbox's beautiful selection of vector maps.
The Mapbox Directions block, you can build traffic-aware directions and navigation into your real-time applications. For example, if you're building a taxi or ridesharing application, the block lets you stream geolocation coordinates data between users (like a driver and passenger), then provide navigation to connect them. Or for a delivery app, you can send drop off locations to a fleet of trucks based on their current coordinates.