-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
106 lines (99 loc) · 2.05 KB
/
script.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
103
104
105
106
function initMap() {
const map = new google.maps.Map(document.getElementById("map"), {
mapId: "23c669a9513b7889",
center: { lat: 34.66817361825899, lng:135.4303239623796 },
zoom: 17.5,
mapTypeControl: false,
fullScreenControl: false,
streetViewControl: false
});
const markers = [
[
"Yoshi\'s House",
34.668179123702295,
135.4303226060295,
"imgs/fort.svg",
38,
31
],
[
"Ghost House",
34.66799268510261, 135.43200027718754,
"imgs/ghosthouse.svg",
48,
41
],
[
"Hill with eyes",
34.66894754697516, 135.42880758385084,
"imgs/hillwitheyes.svg",
45,
41
],
[
"Hill with eyes",
34.66886669195229, 135.42871395674152,
"imgs/hillwitheyes.svg",
45,
41
],
[
"Hill with eyes",
34.668843591380615, 135.42887780529222,
"imgs/hillwitheyes.svg",
45,
41
],
[
"Warp Pipe",
34.66911695360956, 135.43129184087886,
"imgs/pip.svg",
45,
38
],
[
"Castle",
34.66772187727941, 135.42836442206814,
"imgs/castle.svg",
48,
41
],
[
"You are Here!",
34.668586443589014, 135.4275772397497,
"imgs/pointer.svg",
48,
45
],
[
"Star World",
34.66719020660207, 135.43096152780785,
"imgs/star.svg",
38,
38
]
]
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: 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,
});
});
}
}
window.initMap = initMap;