By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,481 Members | 1,713 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,481 IT Pros & Developers. It's quick & easy.

Google Maps Api

P: n/a
Hi!

im would like to get address informations like city, state or zip for a
given GPoint. Is it possible (i found nothing in Google maps Api)?

Thanks in advance
Aug 5 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
H.Schmidt wrote:
im would like to get address informations like city, state or zip for a
given GPoint. Is it possible (i found nothing in Google maps Api)?
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<title>Search Country, City, State, Address with GPoint</title>
<script type="text/javascript"
src="http://maps.google.com/maps?file=api&amp;v=2.x&amp;key=[XX]">
</script>
<script type="text/javascript"
src="http://google.com/uds/api?file=uds.js&amp;v=1.0">
</script>
<script type="text/javascript"
src="http://google.com/uds/solutions/localsearch/gmlocalsearch.js">
</script>
<script type="text/javascript">
function findInfo(x,y) {
if (GBrowserIsCompatible()) {
var s = new GlocalSearch();
var c = {
callback:function() {
if(s.results.length == 0) {
alert('No result');
}
else {
alert('Country: ' + s.results[0].country);
alert('City: ' + s.results[0].city);
alert('State: ' + s.results[0].region);
alert('Address: ' + s.results[0].streetAddress);
}
}
};
s.setCenterPoint(new GLatLng(x,y), 1);
s.setSearchCompleteCallback(c, c.callback);
s.execute(new GLatLng(0,0), 1);
}
}
</script>
</head>
<body onunload="GUnload()">
<b>GPoint coordinates</b><br>
X: <input type="text" value="40.014" id="X" name="X"><br>
Y: <input type="text" value="0.846" id="Y" name="Y"><br>
<input type="button" value="Go"
onClick="findInfo(document.getElementById('X').val ue,
document.getElementById('Y').value);">
</body>
</html>

-------------------------------------------------------------------

Info:
http://code.google.com/apis/maps/doc...reference.html
http://code.google.com/apis/ajaxsear...s_GlocalResult
(apparently there is no property for the ZIP-code)

Replace [XX] by your Maps API Key

Hope this helps,

--
Bart
Aug 5 '08 #2

P: n/a
Many Thanks!

Aug 5 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.