-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
103 lines (97 loc) · 2.35 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>3D like building map</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='./mapbox/1.8.1/mapbox-gl.js'></script>
<link href='./mapbox/1.8.1/mapbox-gl.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
#map {
position: absolute;
height: 100%;
width: 100%;
}
</style>
<style>
#menu {
position: absolute;
left: 0.5em;
top: 0.5em;
padding: 0.2em 0.5em;
margin: 0 0;
background: #ffffffcc;
border: solid 1px #aaa;
border-radius: 3px;
font-family: "Open Sans", sans-serif;
height: auto;
min-width: 150px;
}
#features {
position: absolute;
left: 0.5em;
padding: 0.5em 0.5em;
top: 8em;
max-height: 200px;
width: 90%;
max-width: 350px;
overflow: auto;
background: #ddeeff;
font-family: 'Open Sans', sans-serif;
word-wrap: break-word;
}
button.c1 {
display: block;
text-align:center;
background: #ddd;
padding 0 0.5em 0 0.5em;
border: solid 1px #ccc;
border-radius: 3px;
margin: 5px 0px 5px 0px;
line-height: 1.5em;
font-size: 1em;
width: 100%;
cursor: pointer;
}
</style>
</head>
<body>
<div id='map'></div>
<div id='menu'>
<button type="button" class="c1" name="std" onclick="setstylestd()">標準地図</button>
<button type="button" class="c1" name="photo" onclick="setstylephoto()">写真+注記</button>
<button type="button" class="c1" name="photo" onclick="setstyledark()">ダークモード風</button>
</div>
<script>
var map = new mapboxgl.Map({
container: 'map',
hash: true,
style: './building3d.json',
center: [139.762529,35.680757],
zoom: 15,
minZoom: 4,
maxZoom: 17.99,
bearing: -40,
pitch: 60,
doubleClickZoom: false,
localIdeographFontFamily: false
});
//UI
map.addControl(new mapboxgl.NavigationControl(), 'bottom-right');
map.addControl(new mapboxgl.ScaleControl());
map.showTileBoundaries = false;
map.showCollisionBoxes = false;
//地図切替え
var setstylestd = function(){
map.setStyle('./building3d.json');
}
var setstylephoto = function(){
map.setStyle('./building3dphoto.json');
}
var setstyledark = function(){
map.setStyle('./building3ddark.json');
}
</script>
</body>
</html>