Skip to content

Instantly share code, notes, and snippets.

@mastersigat
Last active February 4, 2018 21:00
Show Gist options
  • Save mastersigat/3b97a088768a11552fa9c85a1806f3e5 to your computer and use it in GitHub Desktop.
Save mastersigat/3b97a088768a11552fa9c85a1806f3e5 to your computer and use it in GitHub Desktop.
#MapboxGL / Première carte
license: mit
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>Display a map</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.44.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.44.0/mapbox-gl.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
</style>
</head>
<body>
<div id='map'></div>
<script>
// AccesToken
mapboxgl.accessToken = 'pk.eyJ1IjoibmluYW5vdW4iLCJhIjoiY2pjdHBoZGlzMnV4dDJxcGc5azJkbWRiYSJ9.o4dZRrdHcgVEKCveOXG1YQ';
// Configuration de la carte
var map = new mapboxgl.Map({
container: 'map',
style: 'mapbox://styles/ninanoun/ciyo7h3mc001q2rpngdsa9zwh', // fond de carte
center: [-1.68, 48.12], // lat/long
zoom: 15, // zoom
pitch: 50, // Inclinaison
bearing: -10 // Rotation
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment