From 36a2d6ae1de1abf9a57cd0463e4c1e7b476d6daa Mon Sep 17 00:00:00 2001
From: Ray Liu <rayliu109@gmail.com>
Date: Mon, 2 Apr 2018 17:07:35 -0400
Subject: [PATCH] Finished info window

---
 tomcat/webapps/Trawl/infoWindow.js | 32 ++++++++++++++++++++++++++++++
 tomcat/webapps/Trawl/map.js        |  2 +-
 tomcat/webapps/Trawl/map.jsp       |  2 +-
 3 files changed, 34 insertions(+), 2 deletions(-)
 create mode 100644 tomcat/webapps/Trawl/infoWindow.js

diff --git a/tomcat/webapps/Trawl/infoWindow.js b/tomcat/webapps/Trawl/infoWindow.js
new file mode 100644
index 0000000..2cfdbf1
--- /dev/null
+++ b/tomcat/webapps/Trawl/infoWindow.js
@@ -0,0 +1,32 @@
+//*This code references the info window google maps API
+//https://developers.google.com/maps/documentation/javascript/infowindows
+
+// This example displays a marker at the center of Australia.
+// When the user clicks the marker, an info window opens.
+
+function initMap(lati, longi,info) {
+	for(int i=0; i < lati.length; i++){
+		
+	
+		  
+		  var map = new google.maps.Map(document.getElementById('map'), {
+		    zoom: 5.5,
+		    center:  {lat: 45.0349575, lng: -88.6941305};
+		  });
+		  
+		  
+		  var contentString = info[i];
+		
+		  var infowindow = new google.maps.InfoWindow({
+		    content: contentString
+		  });
+		
+		  var marker = new google.maps.Marker({
+		    position: {lat: lati[i], lng: longi[i]} ,
+		    map: map,
+		  });
+		  marker.addListener('click', function() {
+		    infowindow.open(map, marker);
+		  });
+	}
+}
\ No newline at end of file
diff --git a/tomcat/webapps/Trawl/map.js b/tomcat/webapps/Trawl/map.js
index 8c6f08b..10016f9 100644
--- a/tomcat/webapps/Trawl/map.js
+++ b/tomcat/webapps/Trawl/map.js
@@ -1,5 +1,5 @@
 //*This code references the google heat maps API
-
+//https://developers.google.com/maps/documentation/javascript/examples/layer-heatmap
 
 // This example requires the Visualization library. Include the libraries=visualization
 // parameter when you first load the API. For example:
diff --git a/tomcat/webapps/Trawl/map.jsp b/tomcat/webapps/Trawl/map.jsp
index ce24f43..80c8f0d 100644
--- a/tomcat/webapps/Trawl/map.jsp
+++ b/tomcat/webapps/Trawl/map.jsp
@@ -33,8 +33,8 @@
 			count.add(r.getCount());
 		}
 	
-		js.put("longitude", longitude);
 		js.put("latitude", latitude);
+		js.put("longitude", longitude);
 		js.put("name", name);
 		js.put("date", date);
 		js.put("individual count", count);
-- 
GitLab