简体   繁体   English

Google Places API for Android - 没有搜索选项的PlacePikcer

[英]Google Places API for Android - PlacePikcer without search option

I am building an application, where the user has to select a Place he wants. 我正在构建一个应用程序,用户必须选择他想要的地方。

For that, I am using the PlacePicker dialog, as the Google Places API for Android is teaching in the API reference site. 为此,我正在使用PlacePicker对话框,因为Android的Google Places API正在API参考站点中进行教学。

However, when the user click the button and open the Place Picker Dialog, it does not have any button where the user can type the name of the place he wants to select. 但是,当用户单击按钮并打开“地点选择器”对话框时,它没有任何按钮,用户可以在其中键入要选择的地点的名称。 So, the user will have to select a place just dragging on the map; 因此,用户必须选择仅在地图上拖动的地方; this is horrible for the user, specially if he wants to choose a specific location far from his location or he doesn't know where is the place on the map. 这对用户来说太可怕了,特别是如果他想选择远离他所在位置的特定位置,或者他不知道地图上的位置在哪里。

So, I've tried searching on Google and foruns on the internet and I didn't find anything about how to set the dialog to appear the search button. 所以,我尝试在互联网上搜索Google和foruns,但我没有找到任何关于如何设置对话框以显示搜索按钮的内容。

Thank you! 谢谢! ;) ;)

不幸的是,Place Picker不支持您的要求。

From what I can see search is currently not supported in the PlacePicker API. 据我所知,PlacePicker API目前不支持搜索。 You can look at: PlacePicker.IntentBuilder and PlacePicker @Ferran Negre: Yes, I also saw that Hangouts (version 4.0.100406486) seems to use the PlacePicker with search. 您可以查看: PlacePicker.IntentBuilderPlacePicker @Ferran Negre:是的,我还看到环聊(版本4.0.100406486)似乎使用PlacePicker进行搜索。 I actually logged it to make sure and they do use the PlacePicker activity. 我实际上记录了它以确保它们确实使用了PlacePicker活动。 SO either they copied the PlacePicker code into Hangouts and modified it (they are Google and should have access) OR there is a hidden API for showing search that for some reason has not yet been released. 因此,他们将PlacePicker代码复制到环聊中并对其进行修改(它们是Google并且应该具有访问权限)或者有一个隐藏的API用于显示由于某种原因尚未发布的搜索。 Even if such a hidden API exists though it would be bad practice to try to use it. 即使存在这样的隐藏API,但尝试使用它也是不好的做法。

It looks like that they have listened to us and they already support this feature! 看起来他们已经听过我们,他们已经支持这个功能了!

We have also added the autocomplete functionality to the place picker—a UI widget that helps users communicate their current location, such as a place, address or location on a map. 我们还为地点选择器添加了自动填充功能 - 一个UI小部件,可帮助用户传达其当前位置,例如地图上的地点,地址或位置。

http://googlegeodevelopers.blogspot.com/2015/12/autocomplete-widget-and-updated-place.html http://googlegeodevelopers.blogspot.com/2015/12/autocomplete-widget-and-updated-place.html

Place picker currently not supporting option to search ,but you can use android-place-picker library by this lib you can achieve this functionality + you can display recent searched locations also.And hope Google will soon add this feature to Place Picker.till that time you can use this. 放置选择器当前不支持搜索选项,但你可以使用这个lib的android-place-picker库你可以实现这个功能+你也可以显示最近搜索过的位置。并希望谷歌很快将这个功能添加到Place Picker.till你可以用这个时间。 :) :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM