I don't want have different countries search suggestions in my app(Image)显示在谷歌地图搜索附近的地方安卓
I want to have correct or nearest suggestions in google map app(Image)
我有这个代码
autocompleteFragment = (PlaceAutocompleteFragment)
getFragmentManager().findFragmentById(R.id.place_autocomplete_fragment);
AutocompleteFilter typeFilter = new AutocompleteFilter.Builder()
.setTypeFilter(AutocompleteFilter.TYPE_FILTER_REGIONS)
.build();
autocompleteFragment.setFilter(typeFilter);
我想告诉附近的地方,当我在搜索栏我打字测试。我的问题是,当一个字符在搜索栏中输入时,该字符与其他国家/地区相关的建议,我希望它是最接近的一个。换句话说,搜索是非常类似像Android谷歌地图应用程序。
只有到附近的地方才需要网络服务API。这个API提供了最近的地方。它不是免费的,但是开发者可以使用这个API达到一些限制。 ** API是:** https://maps.googleapis.com/maps/api/place/nearbysearch/ ** Documentaion:** https://developers.google.com/places/web-服务/搜索 – Lokesh