Search code examples
javaswingopenstreetmap

How can I display map data (prefererably using OpenStreetMaps) in my java application?


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.


Solution

  • 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.