Built with blockbuilder.org
xxxxxxxxxx
<html>
<head>
<meta charset='utf-8' />
<title></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.15.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.15.0/mapbox-gl.css' rel='stylesheet' />
<link href='https://fonts.googleapis.com/css?family=Ropa+Sans' rel='stylesheet' type='text/css'>
<style>
body {
margin: 0;
padding: 0;
}
#map {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
}
</style>
</head>
<body>
<style>
#title {
position: absolute;
top: 72%;
left: 1%;
bottom: 0;
width: 450px;
height: 160px;
box-sizing: border-box;
border-color: rgba(65, 73, 80, 0.9);
border-width: medium;
border-style: solid;
padding: 8px 24px;
font-family: 'Ropa Sans', sans-serif;
font-size: 9pt;
color: rgba(229, 229, 216, 0.9);
text-align: center;
background: rgba(42, 54, 60, 0.9);
-webkit-border-radius: 4px;
border-radius: 4px;
z-index: 9999;
overflow: auto;
}
a {
color: rgba(229, 229, 216, 0.9);
}
</style>
<div id='map'></div>
<script>
mapboxgl.accessToken = 'pk.eyJ1Ijoiam9uYWhhZGtpbnMiLCJhIjoiRlVVVkx3VSJ9.9sdVEK_B_VkEXPjssU5MqA';
var map = new mapboxgl.Map({
container: 'map',
style: 'mapbox://styles/jonahadkins/cim3kbhey0091cwm21d1dvsgo',
center: [-73.990173, 40.726966],
pitch: 40.5, // pitch in degrees
bearing: -27.396674584323023, // bearing in degrees
zoom: 7, // starting zoom
minZoom: 1,
maxZoom: 17,
altitude: 1.5
});
// Add Button Control
var layerList = document.getElementById('title');
var inputs = layerList.getElementsByTagName('input');
function switchLayer(layer) {
var layerId = layer.target.id;
map.setStyle(layerId);
}
for (var i = 0; i < inputs.length; i++) {
inputs[i].onclick = switchLayer;
}
// Add zoom and rotation controls to the map.
map.addControl(new mapboxgl.Navigation());
</script>
</body>
</html>
https://api.tiles.mapbox.com/mapbox-gl-js/v0.15.0/mapbox-gl.js