Android - ImageView 作为离线地图
我正在尝试将离线地图内容实现到我的 Android 应用程序中。我不需要仅仅针对特定区域的详细地图并在其上标记一些位置。可缩放和可滚动的图像对我来说似乎就足够了。
第一个问题是; 1-) Android 中离线地图的最佳选择是什么?我的限制是我的应用程序无法使用任何互联网连接。我是否必须使用图像视图(通过在其上添加按钮标记)或者我可以使用 Mapview 的任何离线数据吗?
我已经搜索了很多关于使用 imageview 作为地图的信息,但没有得到这么多结果。
我对 imageview 的基本问题是; 2-) 如何在图像视图的特定位置添加标记(按钮)?
我找到了一些用于滚动和缩放的示例代码并实现了它们(Scrollview 默认没有对角滚动),但我找不到将标记添加到可滚动、可缩放图像视图的方法。
请不要考虑示例代码,只需假设 imageview 位于滚动视图中,并且我尝试在其上添加标记(按钮)。
提前致谢
I am trying to implement an offline map content into my android app. I need not so much detailed map just for a specific area and mark some places over it. a zoomable and scrollable image seems to be enough for me.
First question is;
1-) what is the best option for offline map in android? My constraint is that my app couldn't use any internet connection. Do I have to use an imageview (by adding button markers on it) or can I use any offline data for Mapview?
I have searched a lot for using imageview as map but couldn't get so much result.
my basic question for imageview is;
2-) How can I add a marker(a button) on a specific position of imageview?
I have found some sample code for scrolling and zoom and implemented them (Scrollview has no diagonal scroll as default) but I couldn't find a way to add marker to an scrollable, zoomable imageview.
Please don't think on sample code, just assume that imageview is in an scrollview and I try to add a marker(button) on it.
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
还有其他选项,例如 OSMDroid:但如果可以并且不需要放大和缩小并且不存在性能问题,则该库的个人经验建议使用图像视图。
您可以有一个滚动视图,其中包含一个水平滚动视图,然后它可以包含一个相对布局,其中图像视图占用空间。然后将标记添加到相应的相对布局和位置。
There are other options such as OSMDroid: But personal experience of this library would recommend using an imageview if you can and don't require zooming in and out and having performance issue.
You can have a scrollview, containing a horizontal scrollview, which can then contain a relative layout with an imageview taking up the space. Then add the markers to the relative layout and position accordingly.