aboutsummaryrefslogtreecommitdiffstats
path: root/csci4131
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--csci4131/hw3/contacts.js17
-rw-r--r--csci4131/hw3/myContacts.html13
2 files changed, 27 insertions, 3 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 () {
+
}
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 @@
<button id="spin" onclick="dizzy()" >Feeling Dizzy</button>
</div>
<span id="googlymap">
+ <div id="transitList"></div>
<div id="map"></div>
<span id="SearchPoints">
<div id="search" class="inputBox">
@@ -90,9 +91,17 @@
</select><br>
<input type="text" id="others" name="other" minlength="1"><br>
in <input type="text" id="distance" name="distance" minlength="1"> meters
- <button onclick="searchPlaces()">Submit</button>
+ <button onclick="searchPlaces()">Search</button>
+ </div>
+ <div id="transit" class="inputBox">
+ Directions to <br>
+ <input type="text" id="destination" name="destination"><br>
+ <label id="means">by </label>
+ <input type="radio" id="walk" name="means" value="WALKING"> <label for="walk">Foot</label>
+ <input type="radio" id="drive" name="means" value="DRIVING"> <label for="drive">Driving</label>
+ <input type="radio" id="transit" name="means" value="TRANSIT"> <label for="transit">Transit</label>
+ <button onclick="directions()">GO</button>
</div>
- <div id="transit" class="inputBox">TRANSIT PLACEHOLDER</div>
</span>
</span>