Skip to content

Commit

Permalink
Working notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
drewtu2 committed Apr 23, 2017
1 parent 1d14a23 commit a23aa1d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 14 deletions.
20 changes: 17 additions & 3 deletions static/js/Heatmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
function genHeatMapData() {
listOfLat = filteredData.LAT
listOfLong = filteredData.LONG
console.log(listOfLat)
//console.log(listOfLat)
mapData = []
for(var key in listOfLat) {
if(listOfLat.hasOwnProperty(key) && listOfLong.hasOwnProperty(key)){
Expand All @@ -132,18 +132,19 @@
}

function setListMarkers(map, listOfStuff, url){
console.log(listOfStuff)
//console.log(listOfStuff)
for(index in listOfStuff){
setMarker(map, listOfStuff[index], url)
}
}

function apiDropMarker(inObj) {
moveMap(inObj.location)
return setMarker(SuperSecretMap, inObj, "../images/wine.png");
}

function setMarker(map, inObj, imageUrl) {
console.log(inObj)
//console.log(inObj)
var markerPlace = {
location: inObj.location,
query: inObj.name
Expand Down Expand Up @@ -171,3 +172,16 @@
return marker
}

function moveMap(location) {
if(location == "home"){
SuperSecretMap.setCenter(myLatLng)
} else {
SuperSecretMap.setCenter(location)
}
}

function setMapOnAll(map) {
for (var i = 0; i < recList.length; i++) {
recMarkerList[i].setMap(map);
}
}
25 changes: 14 additions & 11 deletions static/js/notificationEvents.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ var count = 0;
var recMarkerList= []

function handleNotification(message){


if (message == "displayOn") {

} else if (message == "displayOff") {

activateDog()
if (message == "center") {
moveMap("home");
} else if (message == "danger") {
// Alert to Danger!
} else if (message == "dropLocation") {
index = count
recMarkerList.push(apiDropMarker(recList[index]))
Expand All @@ -26,8 +25,12 @@ function handleNotification(message){
}
}

function setMapOnAll(map) {
for (var i = 0; i < recList.length; i++) {
recMarkerList[i].setMap(map);
}
}
function activateDog(){
document.getElementById("dog").src="../images/dogmoving.gif";
window.setTimeout(deactivateDog, 5000);
}

function deactivateDog(){
document.getElementById("dog").src="../images/dogstatic.png";
}

0 comments on commit a23aa1d

Please sign in to comment.