Google Instant on your Maps

geo-autocompletegeo-autocomplete is a jQuery extension I wrote to convert any input field on a web page into an autocomplete field that suggests locations in real-time as you type. It’s like Google Instant for your Maps.

The location results are supplied by the Geocoding Service built into Google Maps API v3.

A thumbnail of each suggested location is also presented, using the Google Static Maps API v2, to help you quickly choose the right location.

The feedback from sites using geo-autocomplete has been really positive. It has been used as a solution for users to check the spelling of foreign locations, and also as a solution to quickly re-locate a map, as seen on GeoMeme.

Since I wrote the first version of geo-autocomplete, about a year ago, there have been a few feature requests, and some developments in jQuery and the Google APIs that can be taken advantage of, so it’s time for an upgrade.

The new geo-autocomplete is built on the new jQuery UI framework, as a jQuery UI Widget rather than a jQuery plugin.

Adding geo-autocomplete to an input field is now as simple as adding one line of Javascript, plus there are some new customization options available for power users.

Here’s the code, and you can play with some examples below. Start by typing location names into the input fields:

1. Basic use case; check the spelling of a location


2. Fast map re-location


3. Restricted to Country Names within Africa


This entry was posted in mobile geo social and tagged , , , , , . Bookmark the permalink.