-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmap.js
102 lines (96 loc) · 2.48 KB
/
map.js
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
function initMap(){
map = new google.maps.Map(document.getElementById('map'), {
center: {lat: 35.69637739001958, lng: 139.57080720636603},
zoom: 18,
mapId: '6ba059c9a68e052c',
mapTypeControl: false,
fullscreenControl: false,
streetViewControl: false
});
//Name
//Longitude, Latitude
//Image URL
//scaledSize width, height
const markers = [
[
"Straw Hat Cafe!",
35.69613766846274,
139.57066819977632,
"image/cafe_logo.png",
38,
31
],
[
"MAMA AIUTO!",
35.696330886054,
139.57056756847604,
"image/shop_logo.png",
48,
51
],
[
"Ooh, a hare on an errand!",
35.69647029572037,
139.57118179431615,
"image/hare-thumbnail.png",
58,
51
],
[
"Sprites playing",
35.696054244275565,
139.56952687141322,
"image/sprites.png",
58,
51
],
[
"Kiki's on her way!",
35.69670119245081,
139.57177188032318,
"image/kiki.png",
78,
81
],
[
"Hmm, what are they doing?",
35.694849902382884,
139.57192759836965,
"image/hares.png",
380,
180
],
[
"Kabu",
35.69498200674005,
139.56873533701253,
"image/kabu.png",
68,
71
],
]
for (let i = 0; i < markers.length; i++) {
const currMarker = markers[i];
const marker = new google.maps.Marker({
position: { lat: currMarker[1], lng: currMarker[2] },
map,
title: currMarker[0],
icon: {
url:currMarker[3],
scaledSize: new google.maps.Size(currMarker[4], currMarker[5] )
},
animation: google.maps.Animation.DROP,
});
const infowindow = new google.maps.InfoWindow({
content: currMarker[0],
});
marker.addListener("click", () => {
infowindow.open({
anchor: marker,
map,
shouldFocus: false,
});
});
}
}
//35.69613766846274, 139.57066819977632