Android:为什么即使边界是 500 米,google 也会在其他国家/地区放置 api return 个位置?

Android: why does google places api return locations in other countries even when bounds is 500 meters?

我正在尝试将自动完成预测请求传递到 google 个位置 api。一切正常,但我在使用 bounds 参数时遇到问题。即使边界是用户当前位置周围 500 米(我在地图上验证 lat/lngs 是正确的),api 仍然坚持返回位于其他国家/地区的结果(以及相关结果实际上位于距用户 500 米以内)。

代码:

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

造成这种异常行为的原因可能是什么?具体来说,不必要的结果是 cities/towns 在其他国家/地区的名称。

getAutocompletePredicitons 上的 bounds 参数表示 偏向 特定地理区域 - 请参阅文档 here。今天不可能将结果集硬性限制到特定国家或地理区域。