google maps embedded in a website that automatically read query string and go directly?

does anyone know how to make a very simple page of google map that when the page loads, it can automatically read querystring and show the map?

full javascript will be greatly appreciated

2 Answers

Relevance
  • 1 decade ago
    Best Answer

    Here's a simple example....

    <html>

    <head>

    <script>

    function mapGoogle(addyId) {

    adVal = document.getElementById(addyId).value;

    var gUrl = 'http://maps.google.com';

    escapedAddy = escapeBlanks(adVal);

    var loc = gUrl+'?q='+escapedAddy;

    window.location = loc;

    }

    function escapeBlanks(adVal) {

    eVal = '';

    var last = adVal.length;

    for (var i=0; i<last; i++) {

    if (' ' == adVal.charAt(i)) {

    eVal +='%20';

    }

    else {

    eVal +=adVal.charAt(i);

    }

    }

    return eVal;

    }

    </script>

    </head>

    <body>

    <form>

    Enter an address:

    <input type="text" id="addy" /><br />

    <input type="button"

    value="click to map"

    onclick="mapGoogle('addy');" />

    </body>

    </html>

  • thao
    Lv 4
    3 years ago

    i could say that that's a stick that became into centred whilst the digital camera became into drawn in the direction of the sky. The illumination referred to as no remember if that's something of heavenly ask your self, yet actual the effect is concerning the region of the digital camera and the perspective with which the stick became into in accordance with that makes it look as a distinct style of phenomena. effective capture!

Still have questions? Get your answers by asking now.