我可以在 Android Map 中始终保留一些静态标记吗?

发布于 2024-12-06 22:39:54 字数 319 浏览 6 评论 0原文

我是 Android 编程的新手...这是我正在尝试为一个小型学术项目做的事情:

  • 屏幕上显示谷歌地图:完成
  • 获取用户的当前位置并显示在地图上: 完成
  • 我们有一个来自网络服务的纬度和经度列表,它形成了预定义的路径。我需要根据给定的经纬度列表在地图上显示一条始终显示的路径,并带有静态标记。 怎么做?

我尝试了各种方法,搜索了各种地方,但找不到令人满意的代码或教程来实现相同的目的。有人可以向我指出可以用来获取上述内容的适当资源吗?

I'm a newbie into Android programming... Here's what I'm trying to do for a small academic project:

  • A google map displayed on screen: Done
  • Get user's current location and show on the map: Done
  • We've a list of Latitudes and Longitudes coming from a webservice, which forms a pre-defined path. I need to display an always-shown path on the map with static markers as per the list of Lat-Longs given. How?

I tried various ways, and searched various places, but couldn't find a satisfactory code or tutorial that has achieved the same. Can someone please point me to an appropriate resource that I can use to get the above?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

一身骄傲 2024-12-13 22:39:54

您需要实施 Overlay 并在 draw() 方法中绘制路径。
使用这个SO帖子 了解如何去做。

You need to implement Overlay and draw the path in the draw() method.
Use this SO post to get an idea of how to do it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文