在Android中使用Google Maps API显示两个地方之间的当前位置和相邻地点和路线(Show Current Location and Nearby Places and Route be

编程入门 行业动态 更新时间:2024-10-23 10:24:48
在Android中使用Google Maps API显示两个地方之间的当前位置和相邻地点和路线(Show Current Location and Nearby Places and Route between two places using Google Maps API in Android)

我需要使用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的气球覆盖的标记。

你也有很好的样品在地图上的两点之间绘制路线,看看这些链接Link1Link2以及这个很好的答案

执行这些步骤后,您将很容易地执行应用程序。 唯一的条件是,你必须阅读并理解它,因为像魔法一样,它不会完成。

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.

更多推荐

本文发布于:2023-08-05 09:32:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1431208.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:当前位置   路线   地点   两个   地方

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!