I want to autocomplete some places using google places api. I only want to include certain places from a specific area. The Googles APIs describe this function using the setBoundsBias function, but I cannot get it to work properly, as it still returns results outside the specified scope.
try { Intent intent = new PlaceAutocomplete.IntentBuilder(PlaceAutocomplete.MODE_OVERLAY) .setBoundsBias(new LatLngBounds( new LatLng(16.371163, 21.051073), new LatLng(16.725743, 21.424006))) .build(getActivity()); startActivityForResult(intent, requestCode); } catch (GooglePlayServicesRepairableException | GooglePlayServicesNotAvailableException e) { e.printStackTrace(); }
android google-play-services google-places-api
qwertz
source share