-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
82 lines (66 loc) · 2.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
<!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/[email protected]/dist/leaflet.css"/>
<script src="https://unpkg.com/[email protected]/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 xhr1 = new XMLHttpRequest();
xhr1.open("GET", "https://cyberjapandata.gsi.go.jp/xyz/experimental_landformclassification1/style.js", false);
xhr1.send(null);
var stylejs1 = eval( "(" + xhr1.responseText + ")" );
var chikeilayer1 = new L.TileLayer.GeoJSON(
"https://cyberjapandata.gsi.go.jp/xyz/experimental_landformclassification1/{z}/{x}/{y}.geojson",
stylejs1.options, stylejs1.geojsonOptions
);
// 地形分類(人工地形)
var xhr2 = new XMLHttpRequest();
xhr2.open("GET", "https://cyberjapandata.gsi.go.jp/xyz/experimental_landformclassification2/style.js", false);
xhr2.send(null);
var stylejs2 = eval( "(" + xhr2.responseText + ")" );
var chikeilayer2 = new L.TileLayer.GeoJSON(
"https://cyberjapandata.gsi.go.jp/xyz/experimental_landformclassification2/{z}/{x}/{y}.geojson",
stylejs2.options, stylejs2.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/seamlessphoto/{z}/{x}/{y}.jpg",
{attribution: "地理院タイル(写真)", maxNativeZoom: 18, maxZoom: 18, opacity:0.9}
);
var GSI = {
GLOBALS : {}
};
GSI.GLOBALS.map = L.map("mapdiv", {
center: [38.304419,141.059046], zoom: 14, minZoom: 2, maxZoom: 18,
layers: [chikeilayer1, chikeilayer2, std]
});
var baseLayers ={"地理院タイル(標準地図)": std,"地理院タイル(写真)": ort};
var overlays = {"地形分類(自然地形)": chikeilayer1, "地形分類(人工地形)": chikeilayer2};
L.control.layers(baseLayers, overlays,{position:"topright",collapsed:false}).addTo(GSI.GLOBALS.map);
L.control.scale({imperial: false}).addTo(GSI.GLOBALS.map);
var hash = L.hash(GSI.GLOBALS.map);
</script>
</body>
</html>