https://github.com/joeyklee/all-roads-lead-to-x
Demo for Mapbox Navigation API
https://github.com/joeyklee/all-roads-lead-to-x
Last synced: 3 months ago
JSON representation
Demo for Mapbox Navigation API
- Host: GitHub
- URL: https://github.com/joeyklee/all-roads-lead-to-x
- Owner: joeyklee
- Created: 2020-04-20T16:09:43.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-04-20T18:39:07.000Z (about 5 years ago)
- Last Synced: 2025-02-08T15:22:48.675Z (4 months ago)
- Language: JavaScript
- Homepage: https://joeyklee.github.io/all-roads-lead-to-x/
- Size: 1.29 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# All roads lead to X
> Demo of Mapbox Navigation API inspired by Moovel Lab and James Bridle| | | |
| :--- | --- | --- |
| .png) | .png) | .png) |## Setup
Tweak the parameters in `main.js` to see what happens!
**Make sure to add your own mapbox API key!!!**
```js
{
mapboxAccessToken: `pk.eyJ1Ijoiam9leWtsZWUiLCJhIjoiMlRDV2lCSSJ9.ZmGAJU54Pa-z8KvwoVXVBw`,
mapboxNavigationURL: `https://api.mapbox.com/directions/v5/mapbox/walking`,
container: "app",
style: "mapbox://styles/mapbox/light-v10", // outdoors-v11, streets-v11
center: [-73.987308, 40.693378], // [2.335195541381836,48.86290791986464],
zoom: 12,
radius: 3,
units: "kilometers",
radiusResolution: 10,
cellSize: 0.5,
}
```NOTE: if you make the radius too large, you will max out the API calls. Similarly, if your cell size is too small, you'll also max out the API calls. You might think of more clever ways of handling chunking up your requests! This is just a demo!
## Credits
* Built by Joey Lee
* [Mapbox directions demo](https://docs.mapbox.com/help/demos/directions-api/index.html)