This article uses **v2** version of Google Maps API. You sould use [v3] by now
First of all you need to signup for a Google Maps API key, otherwise your script will not work. When you are done, start building a simple form with three fields: one for the location and the others for coordinates display.
Now, we need to define the
getCoordinates() function: this function must read the value of the
address field, check if it’s valid and get its coordinates. To get coordinates we’ll use the
GClientGeocoder class and its method
Sends a request to Google servers to geocode the specified address. If the address was successfully located, the user-specified callback function is invoked with a GLatLng point. Otherwise, the callback function is given a null point. In case of ambiguous addresses, only the point for the best match is passed to the callback function.