我使用带有setBoundsBias的PlaceAutocomplete来更精确地限制城市地址,但是当我输入Autocomplete时,不能使用我设置的边界。
请帮助我,谢谢!
LatLngBounds latLngBounds = new LatLngBounds(new LatLng(15.924677, 108.335373), new LatLng(16.218292, 107.821762));
AutocompleteFilter filter = new AutocompleteFilter.Builder()
.setCountry("VN")
.setTypeFilter(AutocompleteFilter.TYPE_FILTER_ADDRESS)
.build();
try {
Intent intent = new PlaceAutocomplete.IntentBuilder(PlaceAutocomplete.MODE_OVERLAY)
.setBoundsBias(latLngBounds)
.setFilter(filter)
.build(this);
startActivityForResult(intent, REQUEST_CODE_AUTOCOMPLETE);
} catch () {
}