aboutsummaryrefslogtreecommitdiffstats
path: root/csci4131/hw3/contacts.js
diff options
context:
space:
mode:
authorRossTheRoss <mstrapp@protonmail.com>2021-02-24 21:15:47 -0600
committerRossTheRoss <mstrapp@protonmail.com>2021-02-24 21:15:47 -0600
commite794574d432041f1654cc50cad9a8d2e796a9fc4 (patch)
tree0425c352eb926a670f65cd35766e968b84374c8c /csci4131/hw3/contacts.js
parentc (diff)
downloadhomework-e794574d432041f1654cc50cad9a8d2e796a9fc4.tar
homework-e794574d432041f1654cc50cad9a8d2e796a9fc4.tar.gz
homework-e794574d432041f1654cc50cad9a8d2e796a9fc4.tar.bz2
homework-e794574d432041f1654cc50cad9a8d2e796a9fc4.tar.lz
homework-e794574d432041f1654cc50cad9a8d2e796a9fc4.tar.xz
homework-e794574d432041f1654cc50cad9a8d2e796a9fc4.tar.zst
homework-e794574d432041f1654cc50cad9a8d2e796a9fc4.zip
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Diffstat (limited to '')
-rw-r--r--csci4131/hw3/contacts.js17
1 files changed, 16 insertions, 1 deletions
diff --git a/csci4131/hw3/contacts.js b/csci4131/hw3/contacts.js
index 7a01bd3..68d5731 100644
--- a/csci4131/hw3/contacts.js
+++ b/csci4131/hw3/contacts.js
@@ -78,6 +78,7 @@ function addPointsContacts(locations) {
}
var service;
var otherRadius;
+var searchMarker = [];
function searchPlaces() {
var request;
if (document.getElementById("places").value!="Other") {
@@ -107,7 +108,9 @@ function searchPlaces() {
});
}
}
+
function addPointsSearch(locations, isOther) {
+ deleteMarkers();
for (x in locations) {
var marker;
if (isOther) {
@@ -123,7 +126,7 @@ function addPointsSearch(locations, isOther) {
});
}
} else {
- var marker = new google.maps.Marker({
+ marker = new google.maps.Marker({
map,
title: locations[x].name,
position: locations[x].geometry.location,
@@ -142,6 +145,18 @@ function addPointsSearch(locations, isOther) {
this.infoWindow.open(map, this);
}
})
+ searchMarker.push(marker);
}
+
+ }
+}
+function deleteMarkers() {
+ for (let i = 0; i < searchMarker.length; i++) {
+ searchMarker[i].setMap(null);
}
+ searchMarker = [];
+}
+
+function directions () {
+
}