-
Notifications
You must be signed in to change notification settings - Fork 151
/
Copy pathmapA.html
71 lines (55 loc) · 2.3 KB
/
mapA.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
<!DOCTYPE html><html lang="ja"><head><meta charset="utf-8"/>
<meta name="viewport" content="width=device-width"/>
<title>マップアプリA</title>
<link rel="apple-touch-icon" href="app-icon.png"/>
<meta property="og:image" content="ogp-image.jpg"/>
<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>
<!-- ルート探索用 -->
<link rel="stylesheet" href="https://unpkg.com/leaflet-routing-machine@latest/dist/leaflet-routing-machine.css" />
<script src="https://unpkg.com/leaflet-routing-machine@latest/dist/leaflet-routing-machine.js"></script>
<script>"use strict"
window.onload = function() {
var map = initMap('mapid')
map.setZoom(14)
map.panTo([ 35.943560,136.188917 ]) // 鯖江駅
map.addIcon(35.944571, 136.186228 , "Hana道場", "icon/hanadojo.png", 64)
// ルート探索
L.Routing.control({
waypoints: [
L.latLng(35.943560,136.188917), // 鯖江駅
L.latLng(35.930609, 136.185646) // サンドーム福井
]
}).addTo(map);
// ルート探索 線のスタイル変更
L.Routing.control({
waypoints: [
L.latLng(35.930609, 136.185646), // サンドーム福井
L.latLng(35.94271, 136.193065), // 秋吉鯖江店
],
lineOptions: {
styles: [
{ color: 'black', opacity: 0.15, weight: 9 * 2 },
{ color: 'green', opacity: 0.8, weight: 6 * 2 },
{ color: 'blue', opacity: 1, weight: 2 * 2 }
]
}
}).addTo(map);
// 緯度経度表示
map.on("click", (e) => alert(e.latlng))
}
</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>