Google Places API(Android)LatLongBounds无效

Sha*_*haw 5 android google-places-api

我正在开发andorid google places api自动完成,一切正常,但是当我设置自定义LatLongBounds将搜索限制为GoogleApiClient对象的特定区域时,返回的结果不在该范围内.我不知道我做错了什么.这就是我在做的事情.

LatLngBounds bounds = new LatLngBounds(new LatLng(24.85764939832254,67.0641630948748), new LatLng(24.866642601677466,67.07407490512522));
LatLng northeast = bounds.northeast;
LatLng southwest = bounds.southwest;

android.util.Log.e("North-East", northeast.toString());
android.util.Log.e("South-West", southwest.toString());

mAdapter = new PlaceAutocompleteAdapter(getActivity(), android.R.layout.simple_list_item_1, GoogleApiClientHelper.get(getActivity()).getGoogleApiClient(), bounds, null);
mAutocompleteView.setAdapter(mAdapter);
Run Code Online (Sandbox Code Playgroud)

小智 0

我也有同样的问题。我认为 Android 版 Google Place 并不完整。Api por web 工作得很好,我发现了几个网站,他们说你可以使用这个 api wor web 对代码进行一些“修复”。我认为这不是正确的方法,但如果有效,那就有效。

即使使用正确的 api 密钥,Google Places API 请求也会被 Android 自动完成拒绝