Demo of Mapbox Navigation API inspired by Moovel Lab and James Bridle
Tweak the parameters in main.js
to see what happens!
Make sure to add your own mapbox API key!!!
{
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!
- Built by Joey Lee
- Mapbox directions demo