From 8150caded7b53f646f440776387cdba91a6a1ffd Mon Sep 17 00:00:00 2001 From: Erik Lindsay Date: Sat, 22 Apr 2017 13:32:35 -0400 Subject: [PATCH 1/2] style and location --- Wello/www/css/desktop.css | 4 + Wello/www/css/main.css | 10 +- Wello/www/js/main.js | 17 ++ maps.js => Wello/www/maps.js | 168 +++++++++--------- .../www/multiplemarkers.php | 0 .../www/phpsqlsearch_dbinfo.php | 0 .../www/storelocator.php | 0 7 files changed, 113 insertions(+), 86 deletions(-) rename maps.js => Wello/www/maps.js (96%) rename multiplemarkers.php => Wello/www/multiplemarkers.php (100%) rename phpsqlsearch_dbinfo.php => Wello/www/phpsqlsearch_dbinfo.php (100%) rename storelocator.php => Wello/www/storelocator.php (100%) diff --git a/Wello/www/css/desktop.css b/Wello/www/css/desktop.css index 3ac26d7..5fceb4c 100644 --- a/Wello/www/css/desktop.css +++ b/Wello/www/css/desktop.css @@ -12,6 +12,10 @@ align-items: center; } + main.list h1{ + display: block; + } + main.list a{ width: 75%; max-width: 41rem; diff --git a/Wello/www/css/main.css b/Wello/www/css/main.css index fe9e812..491e6a4 100644 --- a/Wello/www/css/main.css +++ b/Wello/www/css/main.css @@ -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; @@ -435,6 +437,10 @@ main.search{ margin-top: 4.2rem; } +main.list{ + margin-top: 66px; + margin-bottom: 66px; +} /* ========================================================================== Helper classes diff --git a/Wello/www/js/main.js b/Wello/www/js/main.js index 986d0d9..b441484 100644 --- a/Wello/www/js/main.js +++ b/Wello/www/js/main.js @@ -20,3 +20,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 + + //"
Longitude: " + position.coords.longitude; +} diff --git a/maps.js b/Wello/www/maps.js similarity index 96% rename from maps.js rename to Wello/www/maps.js index 5eb558b..1a42c4a 100644 --- a/maps.js +++ b/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 = '
' + - '
' + name + '
' + - '
' + address1 + '
' + - address2 + '
' + - postalCode + '
'; - - // 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 = '
' + + '
' + name + '
' + + '
' + address1 + '
' + + address2 + '
' + + postalCode + '
'; + + // 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); + }); +} diff --git a/multiplemarkers.php b/Wello/www/multiplemarkers.php similarity index 100% rename from multiplemarkers.php rename to Wello/www/multiplemarkers.php diff --git a/phpsqlsearch_dbinfo.php b/Wello/www/phpsqlsearch_dbinfo.php similarity index 100% rename from phpsqlsearch_dbinfo.php rename to Wello/www/phpsqlsearch_dbinfo.php diff --git a/storelocator.php b/Wello/www/storelocator.php similarity index 100% rename from storelocator.php rename to Wello/www/storelocator.php From 6118accb13ff2ec0ac4c3988979b37a9ef62b162 Mon Sep 17 00:00:00 2001 From: Juhi Nadella Date: Sat, 22 Apr 2017 13:44:31 -0400 Subject: [PATCH 2/2] there is not geolocation in geolocation.html --- multiplemarkers.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multiplemarkers.php b/multiplemarkers.php index 9f5bd30..3525396 100644 --- a/multiplemarkers.php +++ b/multiplemarkers.php @@ -40,7 +40,7 @@ function savePosition(position){ // 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 - var currentlocation = getLoaction(); + var currentlocation = getLocation();