想要显示地图但没有当前位置。需要什么?

发布于 2024-09-27 18:01:36 字数 281 浏览 0 评论 0原文

在我的实际项目中,我需要绘制一个 MapView,上面有给定的跑步/步行/骑自行车路径。

我不需要当前位置,因此我仅为路径添加了覆盖层(没有 MyLocationOverlay)。路径已绘制,但我在模拟器中看不到地图 - 只有灰色瓷砖。 apiKey 在布局(MapView)中设置,INTERNET 权限在 Manifest 中设置。

所以我想知道我是否需要更多。是模拟器工作不正常(我的模拟器中有 3G 和 2 条)还是我需要其他东西?我是否需要构建额外的覆盖层或向清单添加额外的权限(xxxLOCATION)?

In my actual project I need to draw a MapView with a given running/walking/cycling path on top of it.

I don't need the current position so I added an overlay just for the path (no MyLocationOverlay). The path is painted but I don't see the Map in the emulator - only the grey tiles. The apiKey is set in the layout (MapView) and INTERNET permission is set in the Manifest.

So I'm wondering if I need more. Is it the emulator simply not working well (I do have 3G and 2 bars in the emulator) or do I need something else? Do I need to build an additional overlay or add additional permissions (xxxLOCATION) to the Manifest.

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

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

发布评论

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

评论(1

沙与沫 2024-10-04 18:01:36

你描述的是我只有在地图键错误时才看到的东西。是你自己生成的吗?如果您在模拟器中运行未签名的 .apk,则应该 按照这些步骤

You're describing what what I've only seen when I've got the map key wrong. Did you generate it yourself? If you're running the unsigned .apk in the emulator you should be following these steps.

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