Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- container: 'map', // container id
- style: 'mapbox://styles/mapbox/streets-v9',
- center: [-74.50, 40], // starting position
- zoom: 9 // starting zoom
- });
- map.addControl(new mapboxgl.NavigationControl());
- var directions = new MapboxDirections({
- accessToken: mapboxgl.accessToken,
- })
- map.on('load', () => {
- directions.setOrigin([locations[0].longitude, locations[0].latitude]);
- directions.setDestination(userLocation);
- });
- map.addControl(directions, 'bottom-left');```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement