Skip to content
Snippets Groups Projects
Commit 8b77db69 authored by Christopher Schankula's avatar Christopher Schankula :earth_africa:
Browse files

Merge branch 'web' of git@gitlab.cas.mcmaster.ca:schankuc/2XB3.git into

web

Conflicts:
	tomcat/webapps/Trawl/index.jsp
parents f6724c01 34467f1f
No related branches found
No related tags found
No related merge requests found
<%@ page import="java.util.*" %>
<!--
Double Handle Slider Modified from: http://jqueryui.com/slider/#range
-->
<!DOCTYPE html>
<html lang="en">
<head>
......
......@@ -3,56 +3,49 @@
// Displays markers on a map centred at the Laurentian Great Lakes
// When the user clicks the marker, an info window opens
var openWindow;
<<<<<<< HEAD
function initInfo(lati, longi,info) {
for(var i=0; i < lati.length; i++){
// Generate map centred at Great Lakes
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 5.5,
center: {lat: 45.0349575, lng: -88.6941305};
});
function initInfo(lati, longi,name, date, individualCount) {
=======
function initInfo(lati, longi,name, date, count ) {
console.log("Trying to gen. info map");
>>>>>>> origin/web
// Generate map centred at Great Lakes
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 5.5,
center: {lat: 45.0349575, lng: -88.6941305}
center: {lat: 45.0349575, lng: -88.6941305}
});
console.log("Gened info map");
setMarkers(map, lati, longi,name, date, individualCount);
}
>>>>>>> d1f7464b4ffda020ccd6a1dc06a4f3b8386384ee
// Set info window contents to input string
function setMarkers(map, lati, longi,name, date, individualCount) {
for (var i = 0; i < lati.length; i++)
{
var marker = new google.maps.Marker({position: new google.maps.LatLng(lati[i], longi[i]), map: map});
// var content = "point numero" + i;
var content = '<div>' +
'Name:' + name[i] +
'<br>Date:' + findMonth(date[i].month) + ' ' + date[i].day + ', ' + date[i].year +
'<br>Count:' + individualCount[i] + '</div></div>';
var infowindow = new google.maps.InfoWindow();
google.maps.event.addListener(marker,'click', (function(marker,content,infowindow){
return function() {
console.log("Clicked!!!!");
if (openWindow)
openWindow.close();
infowindow.setContent(content);
openWindow = infowindow;
infowindow.open(map,marker);
};
})(marker,content,infowindow));
console.log(i);
}
}
var infowindow = new google.maps.InfoWindow();
var marker, i;
for (i = 0; i < lati.length; i++) {
marker = new google.maps.Marker({
position: new google.maps.LatLng(lati[i], longi[i]),
map: map
});
google.maps.event.addListener(marker, 'click', (function (marker, i) {
return function () {
infowindow.setContent('<div id=“content”>' +
'<div id=“siteNotice”>' +
'</div>' +
'<h1 id=“firstHeading” class=“firstHeading”>' + name[i] + '</h1>' +
'<div id=“bodyContent”>' +
'<p><b>Name: </b>' + name[i] + '</p>' +
'<p><b>Date: </b>' + findMonth(date[i].month) + ' ' + date[i].day + ', ' + date[i].year + '</p>' +
'<p><b>Count: </b>' + count[i] + '</p>' +
'</div>' +
'</div>');
infowindow.open(map, marker);
}
})(marker, i));
console.log("Plotted" + i + " markers");
}
}
\ No newline at end of file
<<<<<<< HEAD
// Initialization
function init() {
callUpdateSci({id:"pickAnimalia", value:2}); // Propagate Dropdowns on Startup
......@@ -479,7 +479,7 @@ function reqMap(params){
if (xhr.readyState == XMLHttpRequest.DONE && xhr.status == 200) {
var nodeList = JSON.parse(this.responseText);
console.log(nodeList);
initInfo(nodeList["latitude"], nodeList["longitude"], nodeList["name"], nodeList["date"], nodeList["individual count"]);
initInfo(nodeList["latitude"], nodeList["longitude"], nodeList["name"], nodeList["date"], nodeList["individualCount"]);
}
else {
console.log("Server Response: Error"); //RME
......@@ -564,5 +564,3 @@ $( function() {
$( "#fromtoYear" ).html($( "#slider-range" ).slider( "values", 0 ) + " - " + $( "#slider-range" ).slider( "values", 1 ))
} );
>>>>>>> d1f7464b4ffda020ccd6a1dc06a4f3b8386384ee
window.onload=init;
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment