-
Notifications
You must be signed in to change notification settings - Fork 0
/
displaylocation.php
60 lines (54 loc) · 1.74 KB
/
displaylocation.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>
<script>
$( document ).ready(function() {
var lat = $.getUrlVar('lat');
var lng = $.getUrlVar('lng');
//document.getElementById("lat").innerHTML = lat+""+lng;
// document.getElementById("lng").innerHTML = lng;
var coords = new google.maps.LatLng(lat,lng);
var mapOptions = { zoom:15,
center:coords,
mapTypeControl:false,
navigationControlOptions:{style:google.maps.NavigationControlStyle.SMALL},
mapTypeId:google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementById("map_canvas"),mapOptions);
var marker = new google.maps.Marker({ position:coords,
map:map,
title:"Your current location!"
}); });
$.extend({
getUrlVars: function(){
var vars = [], hash;
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for(var i = 0; i < hashes.length; i++)
{
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars;
},
getUrlVar: function(name){
return $.getUrlVars()[name];
}
});
</script>
<body>
<div id="lat" ><div>
<div id="lng" ></div>
<div id="map_canvas" style="width:600px;height:400px;"></div>
</body>
<?php
$center_lat = $_GET["lat"];
$center_lng = $_GET["lng"];
$radius = $_GET["radius"];
echo "Latitude:";
echo $center_lat+"<br/>";
echo "</br/>Longitude:";
echo $center_lng;
?>
<?PHP
include ("mysqlclass.php");
?>