如何实现谷歌地图API第2版Android的搜索功能?如何实现、搜索功能、地图、API

2023-09-13 01:37:21 作者:鹤归

我需要实现一个搜索功能为我的Andr​​oid谷歌地图API第2项目,找不到任何工作示例。我只需要输入城市名称,preSS搜索按钮,然后在地图应该搬到城里,并显示在其上的标记。就像谷歌地图应用程序的功能。自动完成应该是不错的,虽然。我actully去查看地图,显示一些标记,等等,我只是不能进行搜索,并查看结果。请帮帮忙!

在此先感谢

解决方案   

我只需要输入城市名称,preSS搜索按钮,然后   地图上应该转移到城市,并显示一个标记就可以了。就像   谷歌地图应用程序一样。

在这样的情况,你必须使你所要做的点击搜索功能如下:

在用户输入城市名称将被发送到的谷歌API - 它 会回来的经纬度长给你。 您将使用LAT-长加标记,以及, 您将使用LAT-长时间动画GMaps实现卡马拉。就是这样。 在这种方式,您能fullfill您的上述要求。

I need to implement a search functionality for my Android Google Map Api V2 project and can't find any working example. I just need to enter a city name, press a "Search" button and then the map should move to the city and show a marker on it. Just like the Google Maps application does. Autocompletion should be nice though. I actully get to show the map, show some markers, etc, I just can't get to perform the search and see the results. Please help!

Thanks in advance

解决方案 Android位置服务和Google地图API初解

I just need to enter a city name, press a "Search" button and then the map should move to the city and show a marker on it. Just like the Google Maps application does.

So for that you have to make the functionality on Click of search in which you have to do as follows:

The city name entered by the user Will be sent to the google api - It will get back the lat-long to you. You will use that lat-long to add marker as well as, You will use that lat-long to animate the Gmaps Camara. That's it. In this way you are able to fullfill your above requirement.