如何在我的 java 应用程序中显示地图数据(最好使用 OpenStreetMaps)?
我目前有一个 Android 应用程序,可以从tile.openstreetmap.org 下载地图数据。然后我希望它能够与服务器通信并让它们共享相同的地图标记。我用于 Android 的解决方案并没有真正移植到标准 Java,我想知道:
是否有一种相对简单的方法可以使用 java 在桌面上显示相同的地图数据?
目前地图位于.mgm 文件使用每个文件 1 个图块的格式。如果我可以回答任何问题以便更轻松地回答我的问题,请告诉我。提前致谢。
编辑:
我的错...我忘记提及我需要能够以某种方式下载地图数据,因为我无法保证与我的桌面的一致的互联网连接(是的,我意识到这听起来有多奇怪),但是,我需要保证可以提供地图数据。
编辑 2:
我认为更新的 API 和新的 API 已经解决了很多问题。
I currently have an Android app that downloads map data from tile.openstreetmap.org. I then want it to be able to communicate with a server and have them share the same map markers. The solution I am using for Android does not really port over to standard Java and I was wondering:
Is there a relatively easy way to display the same map data on my desktop using java?
Currently the maps are in .mgm files using a 1-tile-per-file format. If there are any questions I can answer to make answering my question easier, please let me know. Thanks ahead of time.
EDIT:
My fault... I forgot to mention that I need to be able to have the map data downloaded in some way because I cannot guarantee a consistent internet connection to my desktop (yes, I realize how strange that sounds), however, I need to guarantee that map data can be provided.
Edit 2:
I think a lot of this is taken care of by updated and new APIs.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您是否尝试过 JXMapViewer?它应该适用于 OpenStreetMap 数据。
Have you tried with JXMapViewer? It should work with OpenStreetMap data.
JMapViewer
最近更新并且运行良好。JMapViewer
was recently updated and works nicely.现在 Stack Overflow 上的其他地方已经回答了这个问题:
OpenStreetMap - 用于处理离线的 java 库 基本前提
是使用预渲染的 OSM 图块设置本地图块服务器。
This has now been answered other places on Stack Overflow:
OpenStreetMap - java library to handle offline map
The basic premise is to setup a local tileserver with pre-rendered OSM tiles.