This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Loading maps offline using JMapViewer or JXMapViewer

1
1

Hi, I'm new to openstreetmap and working with maps overall. I'm a developer and I'm trying to figure out what is the best way to load map on my Java application using either JMapViewer or JXMapViewer. Someone did created some java classes to allow JMapViewer to load tiles offline and render them, but I'm not sure exactly how to get the "tiles". I'm still learning about the difference between raster and vectors. I would rather use vectors than raster, but I can't seem to be able to figure out how to load vectors files offline to JMapViewer or JXMapViewer. I thought about setting up my own tile server like tile.openstreetmap.org and only load the countries I want to use at a time. Then use JXMapViewer to connect to my tile server and get the maps I want. But I can't find any sources on how to setup a tile server. All I want to do is to be able to load a map, zoom in and out and add marker points on the map all offline. Any thoughts?

asked 18 Apr '17, 03:48

David2047's gravatar image

David2047
16112
accept rate: 0%

edited 18 Apr '17, 03:49


One Answer:

0

I'm not a programmer but a little Java app called GPS Prune that is open source does something very similar. It may help you see how they do it. https://activityworkshop.net/software/gpsprune/

answered 18 Apr '17, 06:58

andy%20mackey's gravatar image

andy mackey
13.2k87143285
accept rate: 4%

edited 18 Apr '17, 07:00

1

Hi Andy, unfortunately this is not what I'm looking for. GPS Prune is connecting to other tile server which provide the OSM tiles to render a map. What I'm looking for is to get some instructions on how to setup my own tile server that I can use with JMapViewer or JXMapViewer. Another way I'm looking for is how to load tiles from a file into JXMapViewer. But I just don't know where I can get tiles that I can use with JXMapViewer or how to setup a tile server for that matter. Thanks for the help though!

(19 Apr '17, 00:50) David2047

Source code available on GitHub .