Repository navigation
Expand file tree
/
Copy pathaddscript.js
More file actions
65 lines (50 loc) · 1.95 KB
/
Copy pathaddscript.js
File metadata and controls
65 lines (50 loc) · 1.95 KB
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
window.onload = function() {
// Recording restroom, menstrual products, or both
let addRestroom = false;
let addFHP = false;
let nodeType = Array.from(document.querySelectorAll(".node-btn"));
for (let i = 0; i < nodeType.length; i++) {
nodeType[i].addEventListener("click", function() {
nodeType[i].classList.toggle("active");
nodeType[i].classList.toggle("btn-outline-dark");
nodeType[i].classList.toggle("btn-dark");
});
}
if (nodeType[0].classList.contains("active")) {
addRestroom = true;
}
if (nodeType[1].classList.contains("active")) {
addFHP = true;
}
// Recording address input
let submitBtn = document.querySelector("#submit");
let addressField = document.querySelector("#address");
let userPosnField = document.querySelector("#user-location");
let address;
// addressField.addEventListener("click", function() {
// tempAddress = addressField.textContent;
// address = tempAddress + 0; // call api to interpret input as valid address
// });
// function getLatitude(place) {
// //insert api here for getting latitude from address
// }
// function getLongitude(place) {
// // insert api here for getting longitude from address
// }
// function Location(x) {
// this.latitude = getLatitude(x);
// this.longitude = getLongitude(x);
// }
// let locationList = [];
// // Science Teaching Complex
// locationList.push(new google.maps.LatLng(43.470536, -80.543526));
// // Earth Sciences Museum
// locationList.push(new google.maps.LatLng(43.471549, -80.541832));
// // QNC
// locationList.push(new google.maps.LatLng(43.471319, -80.543943));
submitBtn.addEventListener("click", function() {
newLocation = new Location(address);
locationList.push(newLocation);
window.location.href = "searchmap.html";
});
}