-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
53 lines (53 loc) · 1.72 KB
/
index.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
<!doctype html>
<html>
<head>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.12.2/mapbox-gl.css' rel='stylesheet' />
<style>
html, body {
height: 100%;
margin: 0;
padding: 0;
}
#map {
height: 100%;
}
#floating-panel {
position: absolute;
top: 10px;
left: 25%;
z-index: 5;
background-color: #fff;
padding: 5px;
border: 1px solid #999;
text-align: center;
font-family: 'Roboto','sans-serif';
line-height: 30px;
padding-left: 10px;
}
</style>
</head>
<body>
<div id="map"></div>
<div id="floating-panel">
<input type="button" value="Toggle visibility" onclick="overlay.toggle();"></input>
<input type="button" value="Toggle DOM" onclick="overlay.toggleDOM();"></input>
</div>
<script src="https://maps.googleapis.com/maps/api/js"></script>
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.12.2/mapbox-gl.js'></script>
<script src='mapboxgl.js'></script>
<script>
var overlay;
var map = new google.maps.Map(document.getElementById("map"), {
center: {lat: 3.13333, lng: 101.6833},
zoom: 8
});
var token = location.hash.replace('#', '');
if (!token) {
token = prompt('Mapbox Access Token');
}
overlay = new MapboxGL({token:token});
overlay.setMap(map);
</script>
</body>
</html>