This tutorial will guide you to creating your first map powered by Mapbox GL JS using the Mapbox interactive tutorial.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>My test page</title>
</head>
<body>
<h1>test</h1>
</body>
</html>
index.html
.In the Pick platform step, select JS.
In the Pick method step, choose the Use the Mapbox CDN.
<head>
of your HTML file
similar to the code below then click Next.<script src='https://api.mapbox.com/mapbox-gl-js/v1.1.1/mapbox-gl.js'></script>
<link href='https://api.mapbox.com/mapbox-gl-js/v1.1.1/mapbox-gl.css' rel='stylesheet' />
<body>
of your HTML file similar to the code below.<div id='map' style='width: 400px; height: 300px;'></div>
<script>
mapboxgl.accessToken = <your_access_token>;
var map = new mapboxgl.Map({
container: 'map',
style: 'mapbox://styles/mapbox/streets-v11'
});
</script>
index.html
in your browser.Congratulations you have just made you first Mapbox map!