/all-roads-lead-to-x

Demo for Mapbox Navigation API

Primary LanguageJavaScript

All roads lead to X

Demo of Mapbox Navigation API inspired by Moovel Lab and James Bridle

screenshot of routes in grid to louvre screenshot of radial routes to louvre screenshot of routes to ITP

Setup

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!

Credits