Android: why does google place api in other countries, even if the borders are 500 meters?

I am trying to submit an autocomplete prediction request in google places api. Everything works, however, I am having problems with the bounds parameter. Even when the borders are at a distance of 500 meters from the user's current location (I made sure that the lat / lngs is correct on the map), the api still insists on returning results located in other countries (as well as corresponding results that are actually located within 500 meters from the user).

code:

PendingResult<AutocompletePredictionBuffer> results =
                Places.GeoDataApi
                        .getAutocompletePredictions(mGoogleApiClient, constraint.toString(),
                                mBounds, null);

What could be causing this unusual behavior? In particular, the names of cities in other countries are unnecessary results.

+4
source share
1 answer

Parameter boundson getAutocompletePredicitonsmeans offset to a specific geographic area - see documentation here . Today it is impossible to limit the result set to a specific region or geographic region.

+2
source

Source: https://habr.com/ru/post/1611261/


All Articles