0

Possible Duplicate:
Autocomplete Google Map V3 Places impossible to customize?

Iam having a hard time to retrieve only Norwegian places with Autocomplete Locations on Google (http://code.google.com/intl/no-NO/apis/maps/documentation/javascript/examples/places-autocomplete.html) Iam using this exact same code.

I've tried to change the bindTo, but that doesn't seem to get me anywhere. Is it not possible to LIMIT this to only show Norwegian locations? Preferably only within Rogaland in Norway. I could do this with a normal search, with simply adding Rogaland, Norway to the end of the search term, but processing XML to filter as you type would take ages..

Community
  • 1
  • 1

1 Answers1

1

Normally, you must change the following line :

autocomplete = new google.maps.places.Autocomplete(input);

into :

var defaultBounds = new google.maps.LatLngBounds(
  new google.maps.LatLng(V, W),
  new google.maps.LatLng(X, Y));

var options = {
  bounds: defaultBounds,
  types: ['establishment']
};

autocomplete = new google.maps.places.Autocomplete(input, options);

Where V,W,X and Y are the latitude and longitude Norway values.

Zakaria
  • 14,892
  • 22
  • 84
  • 125
  • Thanks a lot! I've tried and it works sort of (shows some other values than only the Norwegian). But how do I generate the Latitude and Longtitude "area". I only have 59.148954 6.014343 which refeers to Rogaland (Norway) as a point, but how do I get the area on a map? – Steffen Martinsen Feb 02 '12 at 20:45