Mapbox
Mapbox GL JS is a JavaScript library that uses WebGL to render interactive maps. Read the plugin documentation
How to use
To start using Mapbox you'll need a Mapbox accessToken
, which you can get on
access tokens page, and then please replace the original access token with yours
script(src='/js/mapbox-gl.js')
div.rounded#map(style='width: 100%; height: 380px;')
script.
mapboxgl.accessToken = '***YOUR_ACCESS_TOKEN***';
var map = new mapboxgl.Map({
container: 'map',
style: 'mapbox://styles/mapbox/streets-v11',
center: [-122.39, 37.77], // starting position [lng, lat]
zoom: 15 // starting zoom
});
<script src="/js/mapbox-gl.js"></script>
<div class="rounded" id="map" style="width: 100%; height: 380px;">
</div>
<script>
mapboxgl.accessToken = '***YOUR_ACCESS_TOKEN***';
var map = new mapboxgl.Map({
container: 'map',
style: 'mapbox://styles/mapbox/streets-v11',
center: [-122.39, 37.77], // starting position [lng, lat]
zoom: 15 // starting zoom
});
</script>
Version 2.0.0, [email protected]