gpt4 book ai didi

android - Google Places API(Android)LatLongBounds 不工作

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:24:44 26 4
gpt4 key购买 nike

我正在使用 andorid google places api Autocomplete,一切正常,但是当我设置自定义 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);

最佳答案

我也遇到了同样的问题。我认为适用于 Android 的 Google Place 并不完整。 Api por web 工作正常,我发现了几个网站,他们说你可以使用这个 api wor web 为代码做几个“修复”。我认为这不是正确的方法,但如果它有效,它就有效。

Google Places API request denied for Android autocomplete, even with the right api key

关于android - Google Places API(Android)LatLongBounds 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30866088/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com