【问题标题】:Google Places API (Android) LatLongBounds Not WorkingGoogle Places API(Android)LatLongBounds 不工作
【发布时间】:2015-09-01 04:24:17
【问题描述】:

我正在研究 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-places-api


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 2015-06-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-11-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多