Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. container: 'map', // container id
  2. style: 'mapbox://styles/mapbox/streets-v9',
  3. center: [-74.50, 40], // starting position
  4. zoom: 9 // starting zoom
  5. });
  6. map.addControl(new mapboxgl.NavigationControl());
  7.  
  8. var directions = new MapboxDirections({
  9. accessToken: mapboxgl.accessToken,
  10. })
  11.  
  12. map.on('load', () => {
  13. directions.setOrigin([locations[0].longitude, locations[0].latitude]);
  14. directions.setDestination(userLocation);
  15. });
  16.  
  17. map.addControl(directions, 'bottom-left');```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement