Google Places Autocomplete Adds 'Country, Region, and City' Filters

Google Places Autocomplete is a feature of the Google Places API and the places library of the Google Maps API v3. It provides your applications with the type-ahead-search behaviour of the Google Maps search field. You only have to start typing an address, and Autocomplete can fill in the rest."By default, Autocomplete will give you […]

Google Places Autocomplete is a feature of the Google Places API and the places library of the Google Maps API v3. It provides your applications with the type-ahead-search behaviour of the Google Maps search field. You only have to start typing an address, and Autocomplete can fill in the rest.

"By default, Autocomplete will give you the full address as a single line of text, but we know that there are many times where you need the address in structured format, such as an address entry form. You can also retrieve the full details for each completion, which includes the structured address, using either the Autocomplete.getPlace() method of the Maps API, or using the Places API Details service," posted Thor Mitchell, Product Manager, Google Maps API.

Google Places Autocomplete

"The simplest way to use Places Autocomplete in your web based applications is to use the places library of the Google Maps API v3. This makes it easy to attach autocomplete behaviour to an existing text field on your web site," adds Mitchell.

Autocomplete is also offered as part of the Google Places API web service.

Google says, you're free to use Autocomplete in any application, even if you are not displaying a map. However, you must display the 'powered by Google' logo under the text field when you use Autocomplete without a map, as illustrated in the address entry example above. Sample logos suitable for use on white or color backgrounds, and for a variety of devices and screens are available here.

Google recently added two new features of Autocomplete that make it even more compelling!

Google Places Autocomplete gets country, City and Region filters

Country restricts: Google launched "country filtering," which allows you to constrain the completions to a specific country. "For example if a U.S. based online retailer ships only to U.S. addresses, there is no need for Autocomplete to offer completions for addresses outside of the U.S," explains Mitchell.

Google also, introduced new City and region type filters that allow you to limit completions to only cities, or to only coarse grained features such as zipcodes, states, and countries.