我需要使用Android中的Google Maps开发应用程序,以便找到我当前的位置,并且需要找到最近的位置 。
(例如: 从我当前位置的附近派出所 )
它应该接受我当前的位置和输出应该显示最近的地方。
有人可以帮我一些建议,链接,教程吗?
I need to develop an application using Google Maps in Android to locate my current location and need to find nearest location.
(For example: Nearby police station from my current location.)
It should accept my current location and output should display nearest place.
Can anyone help me to give some suggestion,links,tutorial to do that?
最满意答案
首先,请阅读本教程 ,了解Android Google Maps和API 2 。
要检索设备的当前位置,请参阅此答案或另一个答案以及API 2
然后,您可以使用Google Place API获取位置附近的位置,并使用Place Api查看此博客 。
获取位置附近的地标后,请使用本博客源代码 ,在地图上显示带有API 2的气球覆盖的标记。
你也有很好的样品在地图上的两点之间绘制路线,看看这些链接Link1和Link2以及这个很好的答案 。
执行这些步骤后,您将很容易地执行应用程序。 唯一的条件是,你必须阅读并理解它,因为像魔法一样,它不会完成。
First go through this tutorial for getting familiar with Android Google Maps and this for API 2.
To retrive the current location of device see this answer or this another answer and for API 2
Then you can get places near by your location using Google Place API and for use of Place Api see this blog.
After getting Placemarks of near by location use this blog with source code to show markers on map with balloon overlay with API 2.
You also have great sample to draw route between two points on map look here in these links Link1 and Link2 and this Great Answer.
After following these steps you will be easily able to do your application. The only condition is, you will have to read it and understand it, because like magic its not going to be complete in a click.
更多推荐
发布评论