Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
79 lines (72 sloc) 2.62 KB
<!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/leaflet@1.4.0/dist/leaflet.css" integrity="sha512-puBpdR0798OZvTTbP4A8Ix/l+A4dHDD0DGqYW6RQ+9jxkRFclaxxQb/SJAWZfWAkuyeQUytO7+7N4QKrDh+drA==" crossorigin=""/>
<script src="https://unpkg.com/leaflet@1.4.0/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>>a)<br>
</body>
</html>