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.
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 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
{ "lat1": 10, "lng1": 11, "lat2": 15, "lng2": 20, "profile": "mapbox/driving" }
The block appends the directions returned by the Mapbox Directions API into the message payload. Please refer to the Mapbox documentation for field information.
{ "lat1": 10, "lng1": 11, "lat2": 15, "lng2": 20, "profile": "mapbox/driving", "directions": <Mapbox Directions API Response> }
Need help? Contact PubNub Support.
Copyright (c) 2018 PubNub
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.