Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge remote-tracking branch 'origin/master'
  • Loading branch information
Arif Prabawa authored and Arif Prabawa committed Apr 22, 2017
2 parents bd81f51 + ac49317 commit 6c874ea
Show file tree
Hide file tree
Showing 9 changed files with 126 additions and 109 deletions.
4 changes: 4 additions & 0 deletions Wello/www/css/desktop.css
Expand Up @@ -12,6 +12,10 @@
align-items: center;
}

main.list h1{
display: block;
}

main.list a{
width: 75%;
max-width: 41rem;
Expand Down
10 changes: 8 additions & 2 deletions Wello/www/css/main.css
Expand Up @@ -129,10 +129,12 @@ div.intro{
}
nav h1{
flex-grow: 1;
margin: 0;
margin: 0 0;
font-size: 1.5rem;
}

h1.title{
display: none;
}
nav.top-nav {
position: fixed;
top: 0;
Expand Down Expand Up @@ -435,6 +437,10 @@ main.search{
margin-top: 4.2rem;
}

main.list{
margin-top: 66px;
margin-bottom: 66px;
}

/* ==========================================================================
Helper classes
Expand Down
11 changes: 10 additions & 1 deletion Wello/www/form.php
@@ -1,5 +1,14 @@
<?php

$mysqli = new mysqli("localhost", "db10e41481317066", "jXLUjNG/cQxm4VJ1SionhDKdcT4BT1Dos7sZMddIapa/8LYDpDNz+3hwGCz8Shon", "db10e41481317066");
if ( (isset($_GET['Well_ID'])) && (is_numeric($_GET['Well_ID'])) ) {
$Well_ID = $_GET['Well_ID'];
}
else if ( (isset($_POST['Well_ID'])) && (is_numeric($_POST['Well_ID'])) ) {
$Well_ID = $_POST['Well_ID'];
}
else {
$Well_ID = "0";
}
?>
<!doctype html>
<html class="no-js" lang="">
Expand Down
30 changes: 17 additions & 13 deletions Wello/www/js/main.js
@@ -1,16 +1,3 @@
function initMap() {
var location = {lat: 41.812013, lng: -72.249019};
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 16,
center: location
});
var marker = new google.maps.Marker({
position: location,
map: map
});
}


$('select').change(function() {

if ($(this).val() == "Other"){
Expand All @@ -20,3 +7,20 @@ $('select').change(function() {
};

});

var x = document.getElementById("demo");

function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition);
} else {
x.innerHTML = "Geolocation is not supported by this browser.";
}
}

function showPosition(position) {
$("#gps-coordinates-latitude").val(position.coords.latitude);
$("#gps-coordinates-longitude").val(position.coords.longitude);
//x.innerHTML = "Latitude: " + position.coords.latitude +
//"<br>Longitude: " + position.coords.longitude;
}
10 changes: 2 additions & 8 deletions Wello/www/map.php
Expand Up @@ -35,7 +35,7 @@
<nav class="top-nav">
<div class="main-bttns">
<button onclick="document.getElementById('menu').classList.toggle('closed'); document.getElementById('close-menu').classList.toggle('closed')"><img src="img/menu.svg" alt="menu" /></button> <h1>Well Report App</h1>
<a href="search.html"><button><img src="img/search.svg" alt="menu" /></button></a>
<a href="search.php"><button><img src="img/search.svg" alt="menu" /></button></a>
</div>

<div class="close-menu closed" id="close-menu" onclick="document.getElementById('menu').classList.toggle('closed'); document.getElementById('close-menu').classList.toggle('closed')"></div>
Expand Down Expand Up @@ -65,7 +65,7 @@
<div>
<h2>Well Name</h2>
<p>short well description</p>
<a href="details.html">DETAILS</a>
<a href="details.php">DETAILS</a>
</div>
</div>

Expand All @@ -88,19 +88,13 @@
<button class="add-well"><a href="form.php"> <img src="img/add.svg" alt="add well" /></a></button>
</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() {
Expand Down
168 changes: 84 additions & 84 deletions maps.js → Wello/www/maps.js
@@ -1,84 +1,84 @@
var map;
var infoWindow;

// markersData variable stores the information necessary to each marker
// figure out a way to import mapData


function initialize() {
var mapOptions = {
center: new google.maps.LatLng(40.601203,-8.668173),
zoom: 9,
mapTypeId: 'roadmap',
};

map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);

// a new Info Window is created
infoWindow = new google.maps.InfoWindow();

// Event that closes the Info Window with a click on the map
google.maps.event.addListener(map, 'click', function() {
infoWindow.close();
});

// Finally displayMarkers() function is called to begin the markers creation
displayMarkers();
}
google.maps.event.addDomListener(window, 'load', initialize);


// This function will iterate over markersData array
// creating markers with createMarker function
function displayMarkers(){

// this variable sets the map bounds according to markers position
var bounds = new google.maps.LatLngBounds();

// for loop traverses markersData array calling createMarker function for each marker
for (var i = 0; i < markersData.length; i++){

var latlng = new google.maps.LatLng(markersData[i].lat, markersData[i].lng);
var name = markersData[i].name;
var address1 = markersData[i].address1;
var address2 = markersData[i].address2;
var postalCode = markersData[i].postalCode;

createMarker(latlng, name, address1, address2, postalCode);

// marker position is added to bounds variable
bounds.extend(latlng);
}

// Finally the bounds variable is used to set the map bounds
// with fitBounds() function
map.fitBounds(bounds);
}

// This function creates each marker and it sets their Info Window content
function createMarker(latlng, name, address1, address2, postalCode){
var marker = new google.maps.Marker({
map: map,
position: latlng,
title: name
});

// This event expects a click on a marker
// When this event is fired the Info Window content is created
// and the Info Window is opened.
google.maps.event.addListener(marker, 'click', function() {

// Creating the content to be inserted in the infowindow
var iwContent = '<div id="iw_container">' +
'<div class="iw_title">' + name + '</div>' +
'<div class="iw_content">' + address1 + '<br />' +
address2 + '<br />' +
postalCode + '</div></div>';

// including content to the Info Window.
infoWindow.setContent(iwContent);

// opening the Info Window in the current map and at the current marker location.
infoWindow.open(map, marker);
});
}
var map;
var infoWindow;

// markersData variable stores the information necessary to each marker
// figure out a way to import mapData


function initialize() {
var mapOptions = {
center: new google.maps.LatLng(40.601203,-8.668173),
zoom: 9,
mapTypeId: 'roadmap',
};

map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);

// a new Info Window is created
infoWindow = new google.maps.InfoWindow();

// Event that closes the Info Window with a click on the map
google.maps.event.addListener(map, 'click', function() {
infoWindow.close();
});

// Finally displayMarkers() function is called to begin the markers creation
displayMarkers();
}
google.maps.event.addDomListener(window, 'load', initialize);


// This function will iterate over markersData array
// creating markers with createMarker function
function displayMarkers(){

// this variable sets the map bounds according to markers position
var bounds = new google.maps.LatLngBounds();

// for loop traverses markersData array calling createMarker function for each marker
for (var i = 0; i < markersData.length; i++){

var latlng = new google.maps.LatLng(markersData[i].lat, markersData[i].lng);
var name = markersData[i].name;
var address1 = markersData[i].address1;
var address2 = markersData[i].address2;
var postalCode = markersData[i].postalCode;

createMarker(latlng, name, address1, address2, postalCode);

// marker position is added to bounds variable
bounds.extend(latlng);
}

// Finally the bounds variable is used to set the map bounds
// with fitBounds() function
map.fitBounds(bounds);
}

// This function creates each marker and it sets their Info Window content
function createMarker(latlng, name, address1, address2, postalCode){
var marker = new google.maps.Marker({
map: map,
position: latlng,
title: name
});

// This event expects a click on a marker
// When this event is fired the Info Window content is created
// and the Info Window is opened.
google.maps.event.addListener(marker, 'click', function() {

// Creating the content to be inserted in the infowindow
var iwContent = '<div id="iw_container">' +
'<div class="iw_title">' + name + '</div>' +
'<div class="iw_content">' + address1 + '<br />' +
address2 + '<br />' +
postalCode + '</div></div>';

// including content to the Info Window.
infoWindow.setContent(iwContent);

// opening the Info Window in the current map and at the current marker location.
infoWindow.open(map, marker);
});
}
2 changes: 1 addition & 1 deletion multiplemarkers.php → Wello/www/multiplemarkers.php
Expand Up @@ -40,7 +40,7 @@
// once you get the geolocation: we proceed to getting a list of elements from my mysql database which we will use to find the array of location
</script>
var currentlocation = getLoaction();
var currentlocation = getLocation();
<!-- this is where the current location will be stored-->
<script>
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 6c874ea

Please sign in to comment.