-
Notifications
You must be signed in to change notification settings - Fork 7
/
index.html
70 lines (58 loc) · 2.16 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
<!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>地理院ベクトルタイル提供実験(fgd)</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>
//fgd
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);
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: 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: 17, opacity:1});
var GSI = {
GLOBALS : {}
};
GSI.GLOBALS.map = L.map('mapdiv', {
center: [35.705698,139.957527], zoom: 18,minZoom: 2, maxZoom: 18,
layers: [fgdlayer,blank]});
L.control.scale({imperial: false}).addTo(GSI.GLOBALS.map);
var baseLayers ={};
var overlays = {"地理院タイル(標準地図)": std,"地理院タイル(オルソ)": ort,"地理院タイル(白地図)": blank,'fgd': fgdlayer};
L.control.layers(baseLayers, overlays,{position:'topright',collapsed:false}).addTo(GSI.GLOBALS.map);
var hash = L.hash(GSI.GLOBALS.map);
</script>
</body>
</html>