forked from mapbox/mapbox-gl-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetstyle.html
42 lines (37 loc) · 996 Bytes
/
setstyle.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
<!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%; }
</style>
</head>
<body>
<div id='map'></div>
<script src='/dist/mapbox-gl-dev.js'></script>
<script src='/debug/access_token_generated.js'></script>
<script src='/debug/dark-v9.js'></script>
<script src='/debug/light-v9.js'></script>
<script>
// these are set in dark-v9.js and light-v9.js
var dark = window.darkv9;
var light = window.lightv9;
var style = dark;
var map = window.map = new mapboxgl.Map({
container: 'map',
zoom: 2,
center: [-77.01866, 38.888],
style: style,
hash: style
});
setInterval(function () {
style = (style === dark ? light : dark);
map.setStyle(style);
}, 2000);
</script>
</body>
</html>