forked from gsi-cyberjapan/vector-tile-experiment
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
201 lines (155 loc) · 7.61 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>地理院ベクトルタイル提供実験</title>
<link rel="stylesheet" href="https://unpkg.com/leaflet@0.7.3/dist/leaflet.css"/>
<script src="https://unpkg.com/leaflet@0.7.3/dist/leaflet.js"></script>
<script src="./TileLayer.GeoJSON.js"></script>
<script src="./leaflet-hash.js"></script>
<style>
body {padding: 0; margin: 0;}
html, body, #mapdiv {height: 100%; width: 100%;}
.leaflet-container {background: #fff;}
.gsi-div-icon {
background: none;
white-space: nowrap;
border:none;
}
</style>
</head>
<body>
<div id="mapdiv">
<script>
//鉄道中心線
var xhr = new XMLHttpRequest();
xhr.open('GET', 'https://cyberjapandata.gsi.go.jp/xyz/experimental_railcl/style.js', false);
xhr.send(null);
var stylejs = eval( "(" + xhr.responseText + ")" );
var raillayer = new L.TileLayer.GeoJSON(
'https://cyberjapandata.gsi.go.jp/xyz/experimental_railcl/{z}/{x}/{y}.geojson',
stylejs.options,stylejs.geojsonOptions);
//道路中心線
var xhr = new XMLHttpRequest();
xhr.open('GET', 'https://cyberjapandata.gsi.go.jp/xyz/experimental_rdcl/style.js', false);
xhr.send(null);
var stylejs = eval( "(" + xhr.responseText + ")" );
var rdcllayer = new L.TileLayer.GeoJSON(
'https://cyberjapandata.gsi.go.jp/xyz/experimental_rdcl/{z}/{x}/{y}.geojson',
stylejs.options,stylejs.geojsonOptions);
//河川中心線
var xhr = new XMLHttpRequest();
xhr.open('GET', 'https://cyberjapandata.gsi.go.jp/xyz/experimental_rvrcl/style.js', false);
xhr.send(null);
var stylejs = eval( "(" + xhr.responseText + ")" );
var rvrcllayer = new L.TileLayer.GeoJSON(
'https://cyberjapandata.gsi.go.jp/xyz/experimental_rvrcl/{z}/{x}/{y}.geojson',
stylejs.options,stylejs.geojsonOptions);
//注記
var xhr = new XMLHttpRequest();
xhr.open('GET', 'https://cyberjapandata.gsi.go.jp/xyz/experimental_anno/style.js', false);
xhr.send(null);
var stylejs = eval( "(" + xhr.responseText + ")" );
var annolayer = new L.TileLayer.GeoJSON(
'https://cyberjapandata.gsi.go.jp/xyz/experimental_anno/{z}/{x}/{y}.geojson',
stylejs.options,stylejs.geojsonOptions);
//基盤地図情報_基本項目
var xhr = new XMLHttpRequest();
xhr.open('GET', 'https://cyberjapandata.gsi.go.jp/xyz/experimental_fgd/style.js', false);
xhr.send(null);
var stylejs = eval( "(" + xhr.responseText + ")" );
var fgdlayer = new L.TileLayer.GeoJSON(
'https://cyberjapandata.gsi.go.jp/xyz/experimental_fgd/{z}/{x}/{y}.geojson',
stylejs.options,stylejs.geojsonOptions);
//基盤地図情報_数値標高モデル(10m)
var xhr = new XMLHttpRequest();
xhr.open('GET', 'https://cyberjapandata.gsi.go.jp/xyz/experimental_dem10b/style.js', false);
xhr.send(null);
var stylejs = eval( "(" + xhr.responseText + ")" );
var dem10blayer = new L.TileLayer.GeoJSON(
'https://cyberjapandata.gsi.go.jp/xyz/experimental_dem10b/{z}/{x}/{y}.geojson',
stylejs.options,stylejs.geojsonOptions);
//基盤地図情報_数値標高モデル(5m)
var xhr = new XMLHttpRequest();
xhr.open('GET', 'https://cyberjapandata.gsi.go.jp/xyz/experimental_dem5a/style.js', false);
xhr.send(null);
var stylejs = eval( "(" + xhr.responseText + ")" );
var dem5alayer = new L.TileLayer.GeoJSON(
'https://cyberjapandata.gsi.go.jp/xyz/experimental_dem5a/{z}/{x}/{y}.geojson',
stylejs.options,stylejs.geojsonOptions);
//地形分類(自然地形)
var xhr = new XMLHttpRequest();
xhr.open('GET', 'https://cyberjapandata.gsi.go.jp/xyz/experimental_landformclassification1/style.js', false);
xhr.send(null);
var stylejs = eval( "(" + xhr.responseText + ")" );
var landformclassification1layer = new L.TileLayer.GeoJSON(
'https://cyberjapandata.gsi.go.jp/xyz/experimental_landformclassification1/{z}/{x}/{y}.geojson',
stylejs.options,stylejs.geojsonOptions);
//地形分類(人工地形)
var xhr = new XMLHttpRequest();
xhr.open('GET', 'https://cyberjapandata.gsi.go.jp/xyz/experimental_landformclassification2/style.js', false);
xhr.send(null);
var stylejs = eval( "(" + xhr.responseText + ")" );
var landformclassification2layer = new L.TileLayer.GeoJSON(
'https://cyberjapandata.gsi.go.jp/xyz/experimental_landformclassification2/{z}/{x}/{y}.geojson',
stylejs.options,stylejs.geojsonOptions);
//地名情報(居住地名)
var xhr = new XMLHttpRequest();
xhr.open('GET', 'https://cyberjapandata.gsi.go.jp/xyz/experimental_nrpt/style.js', false);
xhr.send(null);
var stylejs = eval( "(" + xhr.responseText + ")" );
var nrptlayer = new L.TileLayer.GeoJSON(
'https://cyberjapandata.gsi.go.jp/xyz/experimental_nrpt/{z}/{x}/{y}.geojson',
stylejs.options,stylejs.geojsonOptions);
//地名情報(自然地名)
var xhr = new XMLHttpRequest();
xhr.open('GET', 'https://cyberjapandata.gsi.go.jp/xyz/experimental_nnfpt/style.js', false);
xhr.send(null);
var stylejs = eval( "(" + xhr.responseText + ")" );
var nnfptlayer = new L.TileLayer.GeoJSON(
'https://cyberjapandata.gsi.go.jp/xyz/experimental_nnfpt/{z}/{x}/{y}.geojson',
stylejs.options,stylejs.geojsonOptions);
//地名情報(公共施設)
var xhr = new XMLHttpRequest();
xhr.open('GET', 'https://cyberjapandata.gsi.go.jp/xyz/experimental_pfpt/style.js', false);
xhr.send(null);
var stylejs = eval( "(" + xhr.responseText + ")" );
var pfptlayer = new L.TileLayer.GeoJSON(
'https://cyberjapandata.gsi.go.jp/xyz/experimental_pfpt/{z}/{x}/{y}.geojson',
stylejs.options,stylejs.geojsonOptions);
//地名情報(住居表示住所)
var xhr = new XMLHttpRequest();
xhr.open('GET', 'https://cyberjapandata.gsi.go.jp/xyz/experimental_jhj/style.js', false);
xhr.send(null);
var stylejs = eval( "(" + xhr.responseText + ")" );
var jhjlayer = new L.TileLayer.GeoJSON(
'https://cyberjapandata.gsi.go.jp/xyz/experimental_jhj/{z}/{x}/{y}.geojson',
stylejs.options,stylejs.geojsonOptions);
var std = L.tileLayer(
'https://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png',
{attribution: "地理院タイル(標準地図)",
maxNativeZoom: 18, maxZoom: 18, opacity:1});
var ort = L.tileLayer(
'https://cyberjapandata.gsi.go.jp/xyz/ort/{z}/{x}/{y}.jpg',
{attribution: "地理院タイル(オルソ)",
maxNativeZoom: 17, maxZoom: 18, opacity:0.7});
var blank = L.tileLayer(
'https://cyberjapandata.gsi.go.jp/xyz/blank/{z}/{x}/{y}.png',
{attribution: "地理院タイル(白地図)",
maxNativeZoom: 14, maxZoom: 18, opacity:1});
var GSI = {
GLOBALS : {}
};
GSI.GLOBALS.map = L.map('mapdiv', {
center: [35.705698,139.957527], zoom: 16,minZoom: 2, maxZoom: 18,
layers: [annolayer,rdcllayer,raillayer,rvrcllayer]});
L.control.scale({imperial: false}).addTo(GSI.GLOBALS.map);
//var baseLayers = {"地理院タイル(標準地図)": std,"地理院タイル(オルソ)": ort,"地理院タイル(白地図)": blank};
var baseLayers ={};
var overlays = {'地図情報(注記)': annolayer,'地図情報(道路中心線)': rdcllayer,'地図情報(鉄道中心線)': raillayer,'地図情報(河川中心線)': rvrcllayer,'基盤地図情報_基本項目': fgdlayer,'基盤地図情報_数値標高モデル(10m)': dem10blayer,'基盤地図情報_数値標高モデル(5m)': dem5alayer,'地形分類(自然地形)': landformclassification1layer,'地形分類(人工地形)': landformclassification2layer,'地名情報(居住地名)': nrptlayer,'地名情報(自然地名)': nnfptlayer,'地名情報(公共施設)': pfptlayer,'地名情報(住居表示住所)': jhjlayer,"地理院タイル(標準地図)": std,"地理院タイル(オルソ)": ort,"地理院タイル(白地図)": blank};
L.control.layers(baseLayers, overlays,{position:'topright',collapsed:false}).addTo(GSI.GLOBALS.map);
var hash = L.hash(GSI.GLOBALS.map);
</script>
</body>
</html>