From e794574d432041f1654cc50cad9a8d2e796a9fc4 Mon Sep 17 00:00:00 2001 From: RossTheRoss Date: Wed, 24 Feb 2021 21:15:47 -0600 Subject: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa --- csci4131/hw3/contacts.js | 17 ++++++++++++++++- csci4131/hw3/myContacts.html | 13 +++++++++++-- 2 files changed, 27 insertions(+), 3 deletions(-) (limited to 'csci4131') 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 () { + } diff --git a/csci4131/hw3/myContacts.html b/csci4131/hw3/myContacts.html index 8e722e0..90f43c9 100644 --- a/csci4131/hw3/myContacts.html +++ b/csci4131/hw3/myContacts.html @@ -77,6 +77,7 @@ +
+
+ Directions to
+
+ + + + +
-
TRANSIT PLACEHOLDER
-- cgit v1.2.3