forked from howml/kirokio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmap.html
85 lines (83 loc) · 3.62 KB
/
map.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
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8" />
<meta http-equiv="content-language" content="ja">
<title>キロク乃キオク-マップ</title>
<meta name="viewport" content="width=device-width">
<link href='http://fonts.googleapis.com/css?family=Francois+One' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/map.css">
<link rel="stylesheet" href="js/leaflet.label.css" />
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
<script src="js/leaflet.label.js"></script>
<script src="http://code.jquery.com/jquery.js"></script>
</head>
<body>
<div class="menu navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">メニュー</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="index.html" class="navbar-brand">KIROKIO</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="index.html">ホーム</a></li>
<li><a href="about.html">キロキオとは</a></li>
<li><a href="pics.html">写真提供</a></li>
<li><a href="project.html">キロキオ制作委員会</a></li>
<li><a href="https://www.facebook.com/howml/">お問い合わせ</a></li>
</ul>
</div>
</div><!-- container -->
</div>
<div id="map"></div>
<script>
// マップの中心地を設定
var map = L.map('map').setView([42.1054 , 140.5769], 15);
var tileLayer = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',{
attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
'<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>',
maxZoom: 19
});
tileLayer.addTo(map);
$.getJSON("data/kirokio.geojson", function(data) {
var geojson = L.geoJson(data, {
onEachFeature: function (feature, layer) {
// コンテンツの表示
contents = '<h3>' +feature.properties['名称']+ '</h3>';
contents += '<table>';
contents += '<tr>';
contents += '<th>写真</th>';
contents += '<td>';
contents += '<a href="' +feature.properties.URL+ '" target="_blank">';
contents += '<img src="' +feature.properties.thumbnail+ '" width="180px" />';
contents += '</td>';
contents += '</tr>';
if(feature.properties['参照'] != null) {
contents += '<tr>';
contents += '<th>リンク</th>';
contents += '<td> <a href="' +feature.properties['参照']+ '" target="_blank">関連リンク</a></td>';
contents += '<tr>';
}
contents += '<tr>';
contents += '<th>操作</th>';
contents += '<td>写真クリックで別ウィンドウ拡大。<br>ピンチズームできます。</td>';
contents += ' </tr>';
contents += '</table>';
layer.bindPopup(contents);
layer.bindLabel(feature.properties['名称']);
}
});
geojson.addTo(map);
});
</script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>