Built with blockbuilder.org
Created
February 8, 2018 13:59
-
-
Save NieneB/7d821466a124542796d3e23b08b7645d to your computer and use it in GitHub Desktop.
fresh block
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: mit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>A basic map with MapboxGL.js</title> | |
<!--add MapboxGLjs CSS--> | |
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.44.0/mapbox-gl.css' rel='stylesheet' /> | |
<!--our own style rules--> | |
<style type="text/css"> | |
body, html { | |
height: 90%; | |
} | |
#map-container { | |
height: 100%; | |
} | |
</style> | |
</head> | |
<body> | |
<!--The div in which the map will be created--> | |
<div id="map-container"></div> | |
<!--load mapboxgl.js--> | |
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.44.0/mapbox-gl.js'></script> | |
<!--our own code to create the map--> | |
<script> | |
mapboxgl.accessToken = 'pk.eyJ1IjoibmllbmViIiwiYSI6IlR6NWEzdmMifQ.dRVGdAluvTb9EIXVBREbzw'; | |
var map = new mapboxgl.Map({ | |
container: 'map-container', | |
style: 'mapbox://styles/mapbox/streets-v9', | |
hash: true, | |
zoom: 11, | |
pitch: 60, | |
bearing: 62.4, | |
center: [ 4.8, 52.4] | |
}); | |
// Add zoom and rotation controls to the map. | |
map.addControl(new mapboxgl.NavigationControl(), "top-left"); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment