Suggestions based on unknown address in google's geocoder

Posted by richardverbruggen on Stack Overflow See other posts from Stack Overflow or by richardverbruggen
Published on 2010-04-09T12:26:57Z Indexed on 2010/04/09 13:03 UTC
Read the original article Hit count: 411

Filed under:
|
|

When using Googles geocoder service to display a city on a map; filling out a non-existing city results in an error.

Is there a way to display some suggestions based on the filled out city?

var geocoder = new GClientGeocoder();
function showAddress(address, zoom) {

          geocoder.getLatLng(
           address,
           function(point) {
            if (!point) {
                  //no point found....
              //Suggest some points :)
            } else {
                map.setCenter(point, zoom);

            }
          }
         );
        }
showAddress('Someplace, Nederland', 14);

© Stack Overflow or respective owner

Related posts about google-maps

Related posts about JavaScript