-
Notifications
You must be signed in to change notification settings - Fork 150
/
map6.html
49 lines (38 loc) · 1.74 KB
/
map6.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
<!DOCTYPE html><html lang="ja"><head><meta charset="utf-8"/>
<meta name="viewport" content="width=device-width"/>
<title>マップアプリ6</title>
<link rel="apple-touch-icon" href="app-icon.png"/>
<meta property="og:image" content="ogp-image.jpg"/>
<meta name="viewport" content="width=device-width"/>
<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://code4fukui.github.io/egmapjs/egmap.js"></script>
<link rel="stylesheet" href="https://code4fukui.github.io/egmapjs/egmap.css"/>
<script src="https://fukuno.jig.jp/fukuno.js"></script>
<script src="https://code4fukui.github.io/egmapjs/sparql.js"></script>
<script>"use strict"
window.onload = function() {
var map = initMap('mapid')
map.setZoom(16)
map.panTo([ 35.943560,136.188917 ]) // 鯖江駅
map.addIcon(35.944571, 136.186228 , "Hana道場", "icon/hanadojo.png", 64)
var current = map.addIcon(0, 0, "現在地", "icon/walking.png", 64, 64)
navigator.geolocation.watchPosition(function(gpos) {
const pos = [ gpos.coords.latitude, gpos.coords.longitude ]
current.setLatLng(pos)
map.panTo(pos)
}, function() {
alert("現在位置に取得に失敗!")
})
}
</script>
<style>
body { margin: 0; font-family: sans-serif; text-align: center; }
h1 { font-size: 5vw; margin: 0; }
#mapid { height: 60vh; }
</style></head><body>
<h1>いまここマップ - egmapjs</h1>
<div id="mapid"></div>
<img id=qrcode><script>addEventListener("load", () => qrcode.src = "https://chart.apis.google.com/chart?chs=140x140&cht=qr&chl=" + encodeURIComponent(document.location))</script><br>
<a href=https://fukuno.jig.jp/2393>簡単地図アプリ egmapjs チュートリアル</a>
</body></html>