-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
52 lines (46 loc) · 2.2 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
<!DOCTYPE html>
<html>
<head>
<title>2024年能登半島地震 調査画像共有マップ</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<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="https://cdnjs.cloudflare.com/ajax/libs/PapaParse/5.3.0/papaparse.min.js"></script>
<style>
#map { height: 98vh; }
</style>
</head>
<body>
<div id="map"></div>
<script>
var map = L.map('map').setView([37.873061, 138.967925], 10); // 日本の中心地を初期表示
// 地理院地図の標準地図タイル
var gsiStd = L.tileLayer('https://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png', {
attribution: "<a href='https://maps.gsi.go.jp/development/ichiran.html' target='_blank'>国土地理院</a>"
});
// 地理院地図の治水地形分類図タイル
var gsiFlood = L.tileLayer('https://cyberjapandata.gsi.go.jp/xyz/lcmfc2/{z}/{x}/{y}.png', {
attribution: "<a href='https://maps.gsi.go.jp/development/ichiran.html' target='_blank'>国土地理院</a>"
});
// レイヤーコントロールをマップに追加
var baseMaps = {
"標準地図": gsiStd,
"治水地形分類図": gsiFlood
};
L.control.layers(baseMaps).addTo(map);
// デフォルトで標準地図を表示
gsiStd.addTo(map);
Papa.parse("photos_metadata.csv", {
download: true,
header: true,
complete: function(results) {
results.data.forEach(function(photo) {
var marker = L.marker([photo.latitude, photo.longitude]).addTo(map)
.bindPopup(`<b>${photo.comment}</b><br><img src="image/${photo.filename}" width="200"><br>緯度経度:${photo.latitude.slice(0, 9)}, ${photo.longitude.slice(0, 10)}<br><a href="https://www.google.com/maps?q=${photo.latitude},${photo.longitude}" target="_blank">Google Mapへのリンク</a>`);
});
}
});
</script>
</body>
</html>