0

I'm developing a map application in Android. I'm using Google maps API to show results in Autocomplete textview dropdown .The results this API is returning is of the places of the entire world . I want to show results o provide solutions to places only of a particular country eg .UK How should I do it . Is there any specific flag to be set for it .

My URL : private static String SUGGETION_URL = "https://maps.googleapis.com/maps/api/place/autocomplete/json?input=%s&types=geocode&sensor=true&key=xxxxx.xxx-xxxxx";

Please suggest ways by which this url will return results to places only in UK ?

Rohan K
  • 1,608
  • 4
  • 21
  • 32
  • Found an incorrect way to do it by using Location biasing : http://code.google.com/apis/maps/documentation/places/autocomplete.html#location_biasing .... but it still show area outside UK. – Rohan K Jan 15 '12 at 09:07

1 Answers1

0

There's no way to force the API to restrict it's results to a region like you can in some of the other Google Maps Web Service APIs. If you really need that functionality then maybe you should be using the Geocoding API or the Places Autocomplete API as included in the Google Maps JS V3 API.

If you can't use either of those two suggestions your options are limited to:

  1. You can use the location / radius parameters like you found, but there are treated as more like "suggestions" than absolutes.

  2. I'd try setting the language parameter to en-GB which might favor UK-based results slightly over others.

bamnet
  • 2,525
  • 17
  • 21