Mapbox
How to connect with Mapbox
Create an account: Mapbox | Maps, Navigation, Search, and Data
To create an API Key follow the link and steps:
Ā
To create an API Access Token, visit: https://account.mapbox.com/access-tokens/. Once you have created your account, you will receive a Default access token, indicating that your account is registered without any restrictions.
Integration Setup
Access the Mapbox integration in the integration section. Insert your API key and verify the status to ensure it's verified.
Ā
You can access Mapbox API inside Flow Builder -> Create Action Node -> Integrations -> Mapbox API
Ā
Actions:
There are three Actions, 1. Get Geocodes by Address, 2. Get Address by Geocodes, 3. Get Directions.
Ā
Get the Geocode by AddressĀ
You can obtain Geocodes by entering the address and country code.
Ā
Payload:Ā
In the Received payload you will get the Geocodes path coordinates -> longitude and latitude.Ā
Ā
{ |
Get the Address by Geocode
You can obtain an address by entering the latitude and longitude coordinates.
Ā
Payload:
In the Payload, you will get the full_address, and context there you will get the address, street, postcode, place, district, region, and country.Ā
{ |
Ā
Get DirectionsĀ
You have to enter the Latitude and Longitude of both Origin and Destination. The Distance is in meters and the duration is in seconds.
Ā
Distance: 36682.594ā1000 = 36.682594Ā Approx= 36KM
Duration: 1611.287ā60 = 26.8547 Approx= 27 min
Ā
Payload:Ā
You will get the duration in seconds, and the distance in meters.
Legs ->Waypoints which are directions from origin to direction.
{ |
Video Tutorial