forked from mapbox/mapbox-gl-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
satellite.html
54 lines (49 loc) · 1.33 KB
/
satellite.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<!DOCTYPE html>
<html>
<head>
<title>Mapbox GL JS debug page</title>
<meta charset='utf-8'>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<link rel='stylesheet' href='../dist/mapbox-gl.css' />
<style>
body { margin: 0; padding: 0; }
html, body, #map { height: 100%; }
#checkbox {
position: absolute;
top: 0;
left: 0;
padding: 10px;
background: #fff;
}
</style>
</head>
<body>
<div id='map'></div>
<div id='checkbox'>
<label><input id='terrain' type='checkbox' checked> terrain</label>
</div>
<script src='../dist/mapbox-gl-dev.js'></script>
<script src='../debug/access_token_generated.js'></script>
<script>
var map = window.map = new mapboxgl.Map({
container: 'map',
zoom: 12.5,
center: [-77.01866, 38.888],
style: 'mapbox://styles/mapbox/satellite-v9',
hash: true
});
map.on('load', function () {
map.addSource('mapbox-dem', {
"type": "raster-dem",
"url": "mapbox://mapbox.terrain-rgb",
"tileSize": 512,
"maxzoom": 14
});
document.getElementById('terrain').onclick();
});
document.getElementById('terrain').onclick = function() {
map.setTerrain(this.checked ? {"source": "mapbox-dem"} : undefined);
};
</script>
</body>
</html>