endereco.php
1.93 KB
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
<?php
include_once (dirname(__FILE__)."/../../classesphp/sani_request.php");
include(dirname(__FILE__)."/../../ms_configura.php");
include(dirname(__FILE__)."/../blacklist.php");
verificaBlFerramentas(basename(dirname(__FILE__)),$i3geoBlFerramentas,false);
$_GET = array_merge($_GET,$_POST);
$x = $_GET["x"];
$y = $_GET["y"];
?>
<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<link rel="stylesheet" type="text/css" href="../../css/i3geo_ferramentas6.css">
<script type="text/javascript" src="http://maps.google.com/maps?file=api&v=2&sensor=false&key=<?php echo $googleApiKey; ?>"></script>
<script type="text/javascript">
function inicializa()
{
var p2 = <?php echo $x;?>;
var p1 = <?php echo $y;?>;
ponto = new GLatLng(p1,p2)
geocoder = new GClientGeocoder();
var pt1 = function(response)
{
if (!response || response.Status.code != 200) {
var ins = "Não foi possível encontrar o endereço. Status Code:" + response.Status.code;
} else {
place = response.Placemark[0];
var ins = '<b>orig latlng:</b>' + response.name + '<br/>'
ins += '<b>latlng:</b>' + place.Point.coordinates[0] + "," + place.Point.coordinates[1] + '<br>'
ins += '<b>Status Code:</b>' + response.Status.code + '<br>'
ins += '<b>Status Request:</b>' + response.Status.request + '<br>'
ins += '<b>Address:</b>' + place.address + '<br>'
ins += '<b>Accuracy:</b>' + place.AddressDetails.Accuracy + '<br>'
ins += '<b>Country code:</b> ' + place.AddressDetails.Country.CountryNameCode;
ins += '<br><br>O endereço obtido é aproximado. Mais detalhes em <a href="http://nicogoeminne.googlepages.com/documentation.html" >Google</a>'
}
document.getElementById("mapa").innerHTML = ins
}
geocoder.getLocations(ponto, pt1);
}
</script>
</head>
<body onload="inicializa()">
<div id="mapa"></div>
</body>
</html>