Skip to content

Instantly share code, notes, and snippets.

@syousif94
Created May 11, 2017 12:01
Show Gist options
  • Save syousif94/8753c6f4525674d1548a14c048ebe149 to your computer and use it in GitHub Desktop.
Save syousif94/8753c6f4525674d1548a14c048ebe149 to your computer and use it in GitHub Desktop.
map box gl performance
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<script src="https://api.tiles.mapbox.com/mapbox-gl-js/v0.37.0/mapbox-gl.js"></script>
<link href="https://api.tiles.mapbox.com/mapbox-gl-js/v0.37.0/mapbox-gl.css" rel="stylesheet" />
<style>
body { margin:0; padding:0; display: flex; justify-content: center; align-items: center; }
#map { height: 768px; width: 1024px; }
</style>
</head>
<body>
<div id="map"></div>
<script>
mapboxgl.accessToken = 'pk.eyJ1IjoiaGFtZWVkbyIsImEiOiJHMnhTMDFvIn0.tFZs7sYMghY-xovxRPNNnw';
if (!mapboxgl.supported()) {
alert('Your browser does not support Mapbox GL');
} else {
var map = new mapboxgl.Map({
container: 'map',
style: 'mapbox://styles/mapbox/streets-v9',
center: [-74.50, 40],
zoom: 9
});
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment