-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMapLibre_shiga-gsi.html
73 lines (69 loc) · 1.85 KB
/
MapLibre_shiga-gsi.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
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>志賀(奥志賀・一ノ瀬・高天が原・ジャイアント)【地理院】</title>
<meta name="description" content="サンプルです">
<link href="style.css" rel="stylesheet">
<!-- MapLibre -->
<script src='https://unpkg.com/[email protected]/dist/maplibre-gl.js'></script>
<link href='https://unpkg.com/[email protected]/dist/maplibre-gl.css' rel='stylesheet' />
</head>
<style>
body {
margin: 0;
padding: 0;
}
#map {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
}
</style>
<body>
<div id="map"></div>
<script>
var map = new maplibregl.Map({
container: 'map',
style: {
version: 8,
sources: {
rtile: {
type: 'raster',
tiles: [
'https://cyberjapandata.gsi.go.jp/xyz/seamlessphoto/{z}/{x}/{y}.jpg',
],
tileSize: 256,
attribution:
'<a href="https://cyberjapandata.gsi.go.jp" target="_blank">© OpenStreetMap contributors</a>',
},
osmtile: {
type: 'raster',
tiles: [`https://tile.openstreetmap.jp/{z}/{x}/{y}.png`],
tileSize: 256,
},
},
layers: [
{
id: 'osm-tiles',
type: 'raster',
source: 'osmtile',
minzoom: 0,
maxzoom: 22,
},
{
id: 'raster-tiles',
type: 'raster',
source: 'rtile',
minzoom: 0,
maxzoom: 22,
},
],
},
center: [138.5141,36.7403], // 中心座標
zoom: 13, // ズームレベル
});
</script>
</body>
</html>