How to add street names to autocomplete via Google APIs?

Viewed 17

I am trying to make an autocomplete function with Google API, but it suggests only cities, even though I think I have added a specific option to show street names as well.

I have a code:

 var options = {
  types: ['(cities)'],
  componentRestrictions: {country: "fi"}
 };


var input1 = document.getElementById("location-1");
var autocomplete1 = new google.maps.places.Autocomplete(input1, options);

So in my understanding if user fills in the street somewhere in Finland it should suggest the autofilling, but nothing happens (only cities).

How to fix this and get a street name in autofilling list?

0 Answers
Related