hardik parmar
hardik parmar

Reputation: 11

Google Places API does support

do Autocomplete service in the Google Places API does support the simultaneous inclusion of both countries and cities in the same Autocomplete instance.

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

please let me know is we can..?

Upvotes: 0

Views: 44

Answers (1)

geocodezip
geocodezip

Reputation: 161384

Per the documentation:

Table 3: Type collections supported in Place Autocomplete requests
Use the Place type values in Table 3, or the values in Table 1 and Table 2, as part of a Place Autocomplete request to restrict the results to a specific type.
Only a single type from Table 3 is allowed in the request. If you do specify a value from Table 3, you cannot specify a value from Table 1 or Table 2. (emphasis added)
The supported types are:

  • geocode
  • address
  • establishment
  • (regions) type collection
  • (cities) type collection

Therefore types: ['(cities)','country'] is not allowed, as only a single value from Table 3 is allowed.

Upvotes: 0

Related Questions