Skip to content

Commit

Permalink
take it
Browse files Browse the repository at this point in the history
  • Loading branch information
jsn13002 committed Apr 22, 2017
1 parent a6b7e4b commit d4fc124
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions multiplemarkers.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// first we will need to work on getting the current location using the google maps API

/// we can get the current location by using the functions form the geolocation.html
// we can get the current location by using the functions form the geolocation.html


// now we use the geolocation to find the list of nearby locations
Expand All @@ -16,13 +16,13 @@
<div id = "map" style = "width: 500pxl height: 400px; "> </div>
<script>
// this will allow us to get the geolocation for where the user is
// this will allow us to get the geolocation for where the user is
function getLocation(){
if (navigator.geolocation){
navigator.geolocation.getCurrentPostion(savePostion, postionError, {timeout:10000});
}
else{
//geolocation is not supported by the browser
// geolocation is not supported by the browser
}
}
Expand All @@ -37,15 +37,17 @@ function savePosition(position){
$_post("geolocation.php", {lat: postion.coords.latitude, lng: position.coords.longitude});
}
// 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
// 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(); // this is where the current location will be stored
var currentlocation = getLoaction();
<!-- this is where the current location will be stored-->
<script>
// this is where we shall put the functions that will make our array for us
// we will need to connect the database to this.. which is am not sure of how to do...
select id, (3959* acos(cos(radians(37))))* cos(radians(lat)) * cos(radians(lng) - radians(-122)) + sin(radians(37))* sin(radians(lat)))) AS distance from currentlocation HAVING distance <25 ORDER BY distance LIMIT 0, 20; // this statement gets us the closest 20 locations within the radius fo 25 miles to the coordinate
// this is where we shall put the functions that will make our array for us
// we will need to connect the database to this.. which is am not sure of how to do...
select id, (3959* acos(cos(radians(37))))* cos(radians(lat)) * cos(radians(lng) - radians(-122)) + sin(radians(37))* sin(radians(lat)))) AS distance from currentlocation HAVING distance <25 ORDER BY distance LIMIT 0, 20;
// this statement gets us the closest 20 locations within the radius fo 25 miles to the coordinate
Expand Down

0 comments on commit d4fc124

Please sign in to comment.