Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usePlacesAutocompleteService requests with combination of type "establishment" with any other type from table 2 always fails #221

Open
Hugh2425 opened this issue Aug 2, 2023 · 0 comments

Comments

@Hugh2425
Copy link

Hugh2425 commented Aug 2, 2023

Hi not sure if this is an issue with your Library or the google docs, any guidance would be greatly appreciated.

On Google places autocomplete api docs it says that you can use types from 3 different tables to filter your place predictions

[Table 1] lists the types that are supported for place searches, and can be returned with Place details results, and as part of autocomplete place predictions.
[Table 2] lists additional types that can be returned with Place details results, and as part of autocomplete place predictions.
[Table 3]lists types you can use in place autocomplete requests.

it also states that
The request will be rejected if:

You specify more than five types.
You specify any unrecognized types.
You mix any types from [Table 1] or [Table 2] with any filter from [Table 3]

however the type "establishment" exists in both table 2 and 3. this causes an issue when we try to do the following

const {
    placesService,
    placePredictions,
    getPlacePredictions
  } = usePlacesAutocompleteService({
    apiKey: googleAutoCompleteApiKey,
    options: { componentRestrictions: { country: ["gb", "im"] }, types: ["premise", "establishment"] }
  });

as it thinks I'm trying to combine table 2 and table 3 filters but really I'm trying to just use the types from table 2.

docs I have used
https://developers.google.com/maps/documentation/places/web-service/supported_types
https://developers.google.com/maps/documentation/javascript/place-autocomplete

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant