mapbox-gl-directions | Directions plugin for mapbox-gl-js using Mapbox Directions | Map library
kandi X-RAY | mapbox-gl-directions Summary
kandi X-RAY | mapbox-gl-directions Summary
A full featured directions plugin for Mapbox GL JS using the Mapbox Directions API. Quickly add UI to display driving, cycling, or walking directions on the map. The Mapbox Directions API is powered by the OSRM routing engine and open data from the OpenStreetMap project. For directions functionality in native mobile and desktop applications, see Mapbox Android Services, MapboxDirections.swift, and MapboxNavigation.swift.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of mapbox-gl-directions
mapbox-gl-directions Key Features
mapbox-gl-directions Examples and Code Snippets
Community Discussions
Trending Discussions on mapbox-gl-directions
QUESTION
I'm building an App with Mapbox-gl and mapbox-gl-directions with React.js. The code is quite simple and it works perfectly. However I need to retrieve the data corresponding to the Km in order to calculate costs per km.
I see the data in the dev tools under the Network tab - Preview. So my question is, how can I retrieve that data? I cannot find any information online...
This is my code:
...ANSWER
Answered 2021-Jan-13 at 09:54I found out the solution by subscribing to the event adding:
QUESTION
I'm using Mapbox to integrate in a javascript/php project. So far so good. Works great. Looking around their api I was wondering whether it was possible to have a mix between mapbox-gl-directions and mapbox-directions api. They don't seem to be the same thing.I really like the example from mapbox-gl-directions which gives the user options to select between driving, cycling and walking. But I already have coordinates for the origin point and coordinates for the destination point. I don't necessarily need the user to input those coordinates but I would also like to leave the user the option to enter alternative coordinates if he wanted to. How can I add starting and destination points to the mapbox-gl-directions just like the mapbox-directions-api? I've looked everywhere in their docs.
...ANSWER
Answered 2020-Jan-29 at 21:48Turn
QUESTION
I'm using mapbox-gl-directions, version: 4.0.2
. I want to exclude tolls, ferries or motorways. Here is a documentation: API and it says you can pass exclude
parameter:
But while passing it like this, it doesn't work:
ANSWER
Answered 2019-Dec-16 at 21:15It looks like the mapbox-gl-directions plugin doesn't support exclude=
. You've done the right thing raising this issue.
QUESTION
I am using Mapbox gl in Ionic - v4, As showing in Mapbox docs i have added Display driving directions. With direction control it showing turn instructions and i want hide turn instruction.
...ANSWER
Answered 2019-Sep-30 at 11:51The reference says:
options.controls.instructions Boolean Hide or display the instructions control. (optional, default true)
So the code like this
QUESTION
I have:
...ANSWER
Answered 2018-Jul-26 at 05:36You need the setOrigin
and setDestination
methods from the MapboxDirections API
:
QUESTION
I could not find any answer to my issue, so I hope someone has an easy explanation ;)
I'm trying to create my own geocoding database, so that I can replace the default API of MapBox (https://api.mapbox.com/geocoding/v5/mapbox.places/). I want to plot transit data - and I have my own GTFS feeds/database for that. Currently I have a directory on my wordpress site containing numerous .json files for searching geocode information (I'm thinking in a similar style as the Mapbox api). However, the javascript is perfectly able to search through the api mapbox data, but not my directory in wordpress. Anyone knows what I need to do?
...ANSWER
Answered 2017-Nov-06 at 15:49Im getting 403 forbidden
http://travelingonrails.com/wp-content/uploads/2017/05/Stations/
You need to ensure your folder has the right access permissions.
If its doing this because it cant find a index page, then I could be wrong. In this case you need to check in your browser you are getting 200 OK status codes when you try and hit the files in your code - if it does then its a mapbox issue if not it's a problem with your server.
QUESTION
I don't have much knowledge of Javascript and I haven't been able to figure out a solution for my problem. I'm making use of the Mapbox Direction API, which currently supports traffic/driving/walking/cycling. I am however interest in an other option; transit, for which I have my own GTSF datasets up and running in a queryable database. Hence; I want to use the code of the Mapbox Direction API and couple it to my own database (in the end, some small steps first..). - Example: https://www.mapbox.com/mapbox-gl-js/example/mapbox-gl-directions/ - Code: https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-directions/v3.1.1/mapbox-gl-directions.js
Does anyone know how (easily) I can edit the Javascript in such a way that; the Start and Destination can ónly be selected based from a pre-defined list.
PS: If anyone has any other idea of creating a javascript layover with a simple list-based Point A to Point B which returns a text-based popup/layover, on mapbox... let me know.
...ANSWER
Answered 2017-Nov-05 at 21:53Answer: Disable map-based selections:
QUESTION
I am going to use my local osrm server in order to do routing in a map based on mapbox GL. In mapbox-gl-directions.js there is a server part:
...ANSWER
Answered 2017-Jul-27 at 07:24OK. There are two lines that should be modified in mapbox-gl-directions.js.
First: change
QUESTION
I have an issue with mapbox direction plugin, on a rails app. When I load the page where the map is, I have this error :
...ANSWER
Answered 2017-May-12 at 07:57The proper way to use the Mapbox GL directions is
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install mapbox-gl-directions
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page