AdevintaSpain / Leku

:earth_africa: Map location picker component for Android. Based on Google Maps. An alternative to Google Place Picker.
https://adevintaspain.github.io/Leku/
Apache License 2.0
764 stars 170 forks source link

How can i filter results by country? #334

Closed nmssalman closed 1 year ago

nmssalman commented 2 years ago

Im currently in canada and when i search things, its suggesting items from US and other countries too. how can i limit result to a specific country?

LocationPickerActivity.Builder()
                .withLocation(location)
                .withGooglePlacesApiKey(context.getString(R.string.google_map_api))
                .withDefaultLocaleSearchZone()
                .shouldReturnOkOnBackPressed()
                .withGoogleTimeZoneEnabled()
                .withVoiceSearchHidden()
                .build(context)
ferranpons commented 1 year ago

You can use .withSearchZone(SearchZoneRect(LatLng(26.525467, -18.910366), LatLng(43.906271, 5.394197))) method to filter by country by providing the Country Rectangle locations