3

I am looking for a possibility to get suggestions without country name.

I have the following js code:

... var autocomplete_pickup = new google.maps.places.Autocomplete(pickup_field, {
       types: ["address"], componentRestrictions: {country: "de"}
}); ...

The result is e.g.

Bahnhofstrasse 4, Hamburg, Deutschland

Now I want to have for that example only

Bahnhofstrasse 4, Hamburg

I have limited the countries only to Germany and therefore is not necessary to show the country name.

Do you have an idea? Thanks. Heinz-Peter

Buxte
  • 31
  • 3

1 Answers1

3

For resolve it, just add this query param &region=de into your script path

It seems like this:

<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=[API-KEY]&libraries=places&region=de"></script>

It helped me.

Alex McDee
  • 31
  • 3