-
Notifications
You must be signed in to change notification settings - Fork 0
/
map_new.html
215 lines (187 loc) · 8.5 KB
/
map_new.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
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link
href="https://fonts.googleapis.com/css2?family=Comfortaa:wght@300;400;500;600;700&family=Gloock&family=Paytone+One&family=Roboto:wght@100;300;400;500;700&family=Unna:ital,wght@0,400;0,700;1,400&family=Young+Serif&display=swap"
rel="stylesheet">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="indexstyle.css">
<script src="https://kit.fontawesome.com/b284ece004.js" crossorigin="anonymous"></script>
<title>Mushroom Map</title>
<style>
#map {
height: 700px;
width: 100%;
}
body {
background-color: #F8EFE9;
color: #512D7A;
/* Font color */
margin: 0;
padding: 0;
}
h2,
h2 {
text-align: center;
}
</style>
</head>
<body>
<!--SIDE BAR starts-->
<div id="sidebar">
<form action="purchase.html">
<input type="submit" value="Go to Purchase" />
</form>
<form action="search.html">
<input type="submit" value="Find Mushrooms" />
</form>
<form action="Gallery.html">
<input type="submit" value="Picture gallery" />
</form>
<form action="map_new.html">
<input type="submit" value="Mushroom Maps" />
</form>
</div>
<!--SIDE BAR ends-->
<!-- Header starts -->
<header>
<div class="logorow column" style="flex-grow: 1;"><a class="logorow column" style="flex-grow: 1;"
href="index.html"><img src="images/mushroom-logo.png">
<h2 style="clear: both;">MushROOM</h2>
</a><br>
</div>
<div style="flex-grow: 4;"><span>Search mushrooms and recipes</span>
<div class="input-icons searchrow" style="gap: 8px; width: 50%;"><input type="text" id="Search"
class="input-field searchbar">
<button id="searchButton" class="btn"><i class="fa fa-search"></i> Search</button>
<button class="secondarybtn"><i class="fa fa-filter"></i> Filters</button>
</div>
</header>
<div id="profile-box">
<form action="signin.html" method="get">
<input type="submit" value="LOGIN" />
</form>
<form action="sign-up.html" method="get">
<input type="submit" value="SIGNUP" />
</form>
</div>
<!-- //Header ends -->
<h2>Mushroom Map</h2>
<h2>Check Out Safe Mushrooms Grow in Your Area</h2>
<div style="text-align:center; margin-bottom: 10px;">
<select id="mushroomFilter">
<option value="all">All Mushrooms</option>
<option value="Wood Hedgehog">Wood Hedgehog</option>
<option value="Common Ink Cap">Common Ink Cap</option>
<option value="Indigo Milk Cap">Indigo Milk Cap</option>
<option value="Lobster Mushroom">Lobster Mushroom</option>
</select>
</div>
<div id="map"></div>
<!--FOOTER -->
<footer>
<br>
All rights reserved by MushROOM Media. 2023
</footer>
<!--FOOTER ends -->
<script>
function initMap() {
var options = {
zoom: 12,
center: { lat: 43.651070, lng: -79.347015 }
}
var map = new google.maps.Map(document.getElementById('map'), options);
var markers = [
{
coords: { lat: 43.645679, lng: -79.496593 },
content: '<div><h2>Wood Hedgehog</h2><p>Can be found at: <br>Can be found at:<br>Kings Mill Park<br>105 Riverwood Pkwy<br>Etobicoke, ON</p><img src="https://inaturalist-open-data.s3.amazonaws.com/photos/1871609/medium.jpg" alt="Wood Hedgehog" style="width:100px;"><a href="https://www.inaturalist.org/guide_taxa/635705">More Info</a></div>'
},
{
coords: { lat: 43.698405, lng: -79.381650 },
content: '<div><h2>Wood Hedgehog</h2><p>Can be found at:<br>Crothers Woods<br>Crothers Woods Trail<br>East York, ON</p><img src="https://inaturalist-open-data.s3.amazonaws.com/photos/1871609/medium.jpg" alt="Wood Hedgehog" style="width:100px;"><a href="https://www.inaturalist.org/guide_taxa/635705">More Info</a></div>'
},
{
coords: { lat: 43.662053, lng: -79.390920 },
content: '<div><h2>Common Ink Cap</h2><p>Can be found at:<br>Queens Park<br>110 Wellesley St W<br>Toronto, ON</p><img src="https://inaturalist-open-data.s3.amazonaws.com/photos/2893589/large.jpeg" alt="Common Ink Cap" style="width:100px;"><a href="https://www.inaturalist.org/guide_taxa/635707"> More Info</a></div>'
},
{
coords: { lat: 43.688292, lng: -79.357822 },
content: '<div><h2>Common Ink Cap</h2><p>Can be found at:<br>Evergreen Brick Works<br>550 Bayview Ave<br>Toronto, ON</p><img src="https://inaturalist-open-data.s3.amazonaws.com/photos/2893589/large.jpeg" alt="Common Ink Cap" style="width:100px;"><a href="https://www.inaturalist.org/guide_taxa/635707"> More Info</a></div>'
},
{
coords: { lat: 43.702075, lng: -79.318015 },
content: '<div><h2>Indigo Milk Cap</h2><p>Can be found at:<br>Stan Wadlow Park<br>373 Cedarvale Ave<br>Toronto, ON</p><img src="https://inaturalist-open-data.s3.amazonaws.com/photos/66266/medium.jpg" alt="Indigo Milk Cap" style="width:100px;"><a href="https://www.inaturalist.org/guide_taxa/635696"> More Info</a></div>'
},
{
coords: { lat: 43.673821, lng: -79.506663 },
content: '<div><h2>Indigo Milk Cap</h2><p>Can be found at:<br>James Gardens<br>99 Edenbridge Dr<br>Etobicoke, ON</p><img src="https://inaturalist-open-data.s3.amazonaws.com/photos/66266/medium.jpg" alt="Indigo Milk Cap" style="width:100px;"><a href="https://www.inaturalist.org/guide_taxa/635696"> More Info</a></div>'
},
{
coords: { lat: 43.651070, lng: -79.547515 },
content: '<div><h2>Lobster Mushroom</h2><p>Can be found at:<br>Echo Valley Park<br>1124 Kipling Ave<br>Etobicoke, ON</p><img src="https://inaturalist-open-data.s3.amazonaws.com/photos/7069967/medium.jpeg" alt="Lobster Mushroom" style="width:100px;"><a href="https://www.inaturalist.org/guide_taxa/635698"> More Info</a></div>'
},
{
coords: { lat: 43.683115, lng: -79.364868 },
content: '<div><h2>Lobster Mushroom</h2><p>Can be found at:<br>Evergreen Brick Works<br>550 Bayview Ave<br>Toronto, ON</p><img src="https://inaturalist-open-data.s3.amazonaws.com/photos/7069967/medium.jpeg" alt="Lobster Mushroom" style="width:100px;"><a href="https://www.inaturalist.org/guide_taxa/635698"> More Info</a></div>'
}
];
markers.forEach(function (marker) {
marker.type = marker.content.match(/<h2>(.*?)<\/h2>/)[1];
addMarker(marker);
});
function addMarker(props) {
var defaultIcon = 'http://maps.google.com/mapfiles/marker.png'
var hoverIcon = {
url: 'https://cdn-icons-png.flaticon.com/512/2069/2069395.png',
scaledSize: new google.maps.Size(36, 39),
};
var marker = new google.maps.Marker({
position: props.coords,
map: map,
icon: defaultIcon
});
props.marker = marker;
if (props.content) {
var infoWindow = new google.maps.InfoWindow({
content: props.content
});
marker.addListener('click', function () {
infoWindow.open(map, marker);
});
}
marker.addListener('mouseover', function () {
marker.setIcon(hoverIcon);
});
marker.addListener('mouseout', function () {
marker.setIcon(defaultIcon);
});
}
function filterMarkers(type) {
markers.forEach(function (markerData) {
if (type === 'all' || markerData.type === type) {
markerData.marker.setVisible(true);
} else {
markerData.marker.setVisible(false);
}
});
}
document.getElementById('mushroomFilter').addEventListener('change', function () {
filterMarkers(this.value);
});
}
</script>
<script async defer
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCez87Yrs7WOgwiMQBLnNSt4TBY8h-GGKg&callback=initMap">
</script>
</body>
</html>