Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Merge remote-tracking branch 'origin/master'
- Loading branch information
Showing
4 changed files
with
253 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,178 @@ | ||
<!DOCTYPE html> | ||
<html class="no-js" lang=""> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="x-ua-compatible" content="ie=edge"> | ||
<title>WRA | Map</title> | ||
<meta name="description" content=""> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<link rel="apple-touch-icon" href="apple-touch-icon.png"> | ||
<!-- Place favicon.ico in the root directory --> | ||
<link rel="stylesheet" href="css/normalize.css"> | ||
<link rel="stylesheet" href="css/main.css"> | ||
<link rel="stylesheet" href="css/well-card.css"> | ||
<link rel="stylesheet" href="css/map-desktop.css"> | ||
<script src="js/vendor/modernizr-2.8.3.min.js"></script> | ||
</head> | ||
|
||
|
||
|
||
|
||
|
||
|
||
<body> | ||
<!--[if lt IE 8]> | ||
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p> | ||
<![endif]--> | ||
<!-- Add your site or application content here --> | ||
|
||
|
||
|
||
|
||
|
||
|
||
<nav class="top-nav"> | ||
<div class="main-bttns"> | ||
|
||
<h1>Well Report App</h1> | ||
<a href="search.php"><img src="img/search.svg" alt="menu" /></a> | ||
</div> | ||
|
||
</nav> | ||
|
||
<main class="map"> | ||
|
||
<div id="map" class="google-maps"> | ||
</div> | ||
|
||
|
||
|
||
</main> | ||
|
||
<nav class="bottom-nav"> | ||
<a href="map.php"><img src="img/map.svg" alt="menu" /></a> | ||
<a href="wells-list.php"><img src="img/well.png" alt="menu" /></a> | ||
</nav> | ||
|
||
<nav class="fabs"> | ||
<button class="gps" onclick ="getLocation()"><img src="img/gps.svg" alt="get location" /></button> | ||
<script> | ||
|
||
|
||
function getLocation() { | ||
if (navigator.geolocation) { | ||
navigator.geolocation.getCurrentPosition(function (position) { | ||
initialLocation = new google.maps.LatLng(position.coords.latitude, position.coords.longitude); | ||
map.setCenter(initialLocation); | ||
}); | ||
} | ||
} | ||
</script> | ||
<a class="add-well" href="form.php"> <img src="img/add.svg" alt="add well" /></a> | ||
</nav> | ||
|
||
|
||
|
||
|
||
<script src="https://code.jquery.com/jquery-1.12.0.min.js"></script> | ||
<script> | ||
window.jQuery || document.write('<script src="js/vendor/jquery-1.12.0.min.js"><\/script>') | ||
</script> | ||
<script src="js/plugins.js"></script> | ||
<script src="js/main.js"></script> | ||
|
||
<script> | ||
|
||
function initMap() { | ||
var map = new google.maps.Map(document.getElementById('map'), { | ||
center: new google.maps.LatLng(41.31412, -72.23311), | ||
mapTypeControlOptions: { | ||
style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR, | ||
position: google.maps.ControlPosition.RIGHT_CENTER | ||
}, | ||
zoom: 16 | ||
}); | ||
if (navigator.geolocation) { | ||
navigator.geolocation.getCurrentPosition(function (position) { | ||
initialLocation = new google.maps.LatLng(position.coords.latitude, position.coords.longitude); | ||
map.setCenter(initialLocation); | ||
}); | ||
} | ||
var infoWindow = new google.maps.InfoWindow; | ||
|
||
|
||
// Change this depending on the name of your PHP or XML file | ||
downloadUrl('http://wellreportapp.uconn.edu/xmlGenerate.php', function(data) { | ||
var xml = data.responseXML; | ||
var markers = xml.documentElement.getElementsByTagName('marker'); | ||
Array.prototype.forEach.call(markers, function(markerElem) { | ||
var id = markerElem.getAttribute('id'); | ||
var name = markerElem.getAttribute('id'); | ||
var address = markerElem.getAttribute('address'); | ||
var point = new google.maps.LatLng( | ||
parseFloat(markerElem.getAttribute('lat')), | ||
parseFloat(markerElem.getAttribute('lng'))); | ||
|
||
var infowincontent = document.createElement('div'); | ||
var strong = document.createElement('strong'); | ||
strong.textContent = address | ||
infowincontent.appendChild(strong); | ||
infowincontent.appendChild(document.createElement('br')); | ||
|
||
|
||
var text = document.createElement('text'); | ||
text.textContent = name | ||
infowincontent.appendChild(text); | ||
infowincontent.appendChild(document.createElement('br')); | ||
|
||
var clicker = document.createElement('a'); | ||
var clickerText = document.createTextNode("go to details..."); | ||
clicker.setAttribute('href',"http://wellreportapp.uconn.edu/details.php?Well_ID="+id); | ||
clicker.appendChild(clickerText); | ||
infowincontent.appendChild(clicker); | ||
var marker = new google.maps.Marker({ | ||
map: map, | ||
position: point | ||
}); | ||
marker.addListener('click', function() { | ||
|
||
infoWindow.setContent(infowincontent); | ||
infoWindow.open(map, marker); | ||
}); | ||
}); | ||
}); | ||
} | ||
|
||
|
||
function downloadUrl(url, callback) { | ||
var request = window.ActiveXObject ? | ||
new ActiveXObject('Microsoft.XMLHTTP') : | ||
new XMLHttpRequest; | ||
|
||
request.onreadystatechange = function() { | ||
if (request.readyState == 4) { | ||
request.onreadystatechange = doNothing; | ||
callback(request, request.status); | ||
} | ||
}; | ||
|
||
request.open('GET', url, true); | ||
request.send(null); | ||
} | ||
|
||
function doNothing() {} | ||
</script> | ||
<script async defer | ||
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCNSoPsxLd0LbvQaH9R6npO7jj-jKAXyQ4&callback=initMap"> | ||
</script> | ||
</body> | ||
|
||
|
||
</html> | ||
<!-- | ||
notes : | ||
we will need a file where we import the well name, address, longiture and latitude within the range we chose | ||
we need a food loop for it | ||
--> |