Google Maps Api

Discussion in 'Javascript' started by H.Schmidt, Aug 5, 2008.

  1. H.Schmidt

    H.Schmidt Guest


    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
    H.Schmidt, Aug 5, 2008
    1. Advertisements

  2. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    <title>Search Country, City, State, Address with GPoint</title>
    <script type="text/javascript"
    <script type="text/javascript"
    <script type="text/javascript"
    <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);
    <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"


    (apparently there is no property for the ZIP-code)

    Replace [XX] by your Maps API Key

    Hope this helps,
    Bart Van der Donck, Aug 5, 2008
    1. Advertisements

  3. H.Schmidt

    H.Schmidt Guest

    Many Thanks!
    H.Schmidt, Aug 6, 2008
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.