forked from homata/brownbag
-
Notifications
You must be signed in to change notification settings - Fork 1
/
map.html
34 lines (29 loc) · 1.07 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
<ons-page id="map-page">
<div id="map">
</div>
<script>
var map = L.map('map').setView([35.856306, 139.902861], 13);
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
var items = getShopItems();
for (var ii=0; ii<items.length; ii++) {
var lon = items[ii]["fX"];
var lat = items[ii]["fY"];
var name = items[ii]["Name"];
var addr = items[ii]["Address1"];
var tel = items[ii]["Phone"];
var category = items[ii]["category"];
L.marker([lat, lon]).addTo(map)
.bindPopup('名称:' + name + "<br>" + 'カテゴリ:' + category + "<br>" + '電話:' + tel + "<br>" + '住所:' + addr);
}
</script>
<style>
#map {
z-index: 0;
/*width: 100%;*/
height: 100%;
text-align: left;
}
</style>
</ons-page>