-
Notifications
You must be signed in to change notification settings - Fork 150
/
Copy pathhanadojo.html
78 lines (72 loc) · 2.62 KB
/
hanadojo.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
<!DOCTYPE html><html lang="ja">
<head>
<meta charset='utf-8'/>
<meta property="og:image" content="">
<link rel="apple-touch-icon" href="icon-hanadojo.png"/>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
<title>Hana道場はどこ? egmap.js - Leaflet x 地理院地図</title>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" integrity="sha512-puBpdR0798OZvTTbP4A8Ix/l+A4dHDD0DGqYW6RQ+9jxkRFclaxxQb/SJAWZfWAkuyeQUytO7+7N4QKrDh+drA==" crossorigin=""/>
<script src="https://unpkg.com/[email protected]/dist/leaflet.js" integrity="sha512-QVftwZFqvtRNi0ZyCtsznlKSWOStnDORoefr1enyq5mVL4tmKB3S/EnC3rRJcxCPavG10IcrVGSmPh6Qw5lwrg==" crossorigin=""></script>
<script src="https://code4fukui.github.io/egmapjs/egmap.js"></script>
<script>"use strict"
window.onload = function() {
var map = initMap('mapid')
map.setZoom(4)
// map.panTo([ 35.943560,136.188917 ]) // 鯖江駅
map.panTo([ 35.944571, 136.186228 ]) // Hana道場
// map.addIcon(35.943560, 136.188917, "鯖江駅")
// map.addIcon(35.944571, 136.186228 , "<a href=http://hanadojo.com/ target=_blank>Hana道場</a>", "icon-hanadojo.png", 64)
map.addIcon(35.944571, 136.186228 , function() { window.open("http://hanadojo.com/", "_blank") }, "icon-hanadojo.png", 64)
// オートズーム
var zoom = 4
var f = function() {
var ll = map.getCenter()
if (Math.abs((ll.lat - 35.944571) + (ll.lng - 136.186228)) > 0.00001) { // 動かしたら止める
clearInterval(t)
return
}
var z = map.getZoom()
if (z != zoom) { // ズームを変えていたら止める
clearInterval(t)
return
}
zoom++
if (zoom == 19)
zoom = 4
map.setZoom(zoom)
}
var t = setInterval(f, 1000)
}
</script>
<style>
body {
margin: 0;
font-family: sans-serif;
text-align: center;
}
h1 {
font-size: 10vw;
margin: 0;
}
#sub {
font-size: 4vw;
}
#mapid {
height: 60vh;
}
.leaflet-tile-container { /* 地図の色味変更 CSS3 filter */
x-filter: sepia(100%) brightness(95%); /* セピア */
x-filter: grayscale(100%) brightness(110%); /* 明るめグレースケール */
filter: hue-rotate(-10deg) saturate(70%) brightness(104%); /* いい感じの色? */
}
</style>
</Head>
<body>
<h1>Hana道場はどこ?</h1>
<div id=sub>egmap.js - Leaflet x 地理院地図</div>
<div id="mapid"></div>
App: <a href=http://fukuno.jig.jp/2363>Hana道場はどこ?</a> CC BY fukuno.jig.jp<br>
Lib: <a href=http://fukuno.jig.jp/2363>egmapjs</a> CC BY fukuno.jig.jp (<a href=https://github.com/code4fukui/egmapjs>src on GitHub</a>)<br>
</body>
</html>