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

Can you please tell me whether it is possible to manage the search in certain countries? #8

Closed
webdevyriy opened this issue Nov 4, 2022 · 9 comments

Comments

@webdevyriy
Copy link

Hello, I really like your component. Can you please tell me whether it is possible to manage the search in certain countries?

request.componentRestrictions = { country: ['ua'] }
autocompleteService.current.getPlacePredictions(request, callback)
@Zenoo
Copy link
Owner

Zenoo commented Nov 4, 2022

Hi @webdevyriy, did you try using the requestOptions prop?

@webdevyriy

This comment was marked as resolved.

@webdevyriy

This comment was marked as resolved.

@webdevyriy
Copy link
Author

Hi @webdevyriy, did you try using the requestOptions prop?

Could you give an example of how they should be used?

@Zenoo

This comment was marked as resolved.

@webdevyriy

This comment was marked as resolved.

@Zenoo
Copy link
Owner

Zenoo commented Nov 4, 2022

You can use

requestOptions={{
	componentRestrictions: {
		country: ['ua'],
	}
}}

@webdevyriy
Copy link
Author

Or

requestOptions={{
	componentRestrictions: {
		country: ['ua'],
	}
}}

It works great

@Zenoo
Copy link
Owner

Zenoo commented Nov 4, 2022

Great !

For next time, you can check the official Google documentation for more options.

@Zenoo Zenoo closed this as completed Nov 4, 2022
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

2 participants