JMapViewer

From OpenStreetMap Wiki
Jump to navigation Jump to search

JMapViewer is a Java component which allows to easily integrate an OSM map view into your Java application. It is maintained as an independent project by the JOSM team.

Features

  • Provides integrated zoom controls (slider and buttons) in the left upper corner (can be hidden)
  • Switch between different tile sources: Mapnik, Tiles@Home, Cyclemap, ... (other tiled maps can be used, too)
  • Configurable in-memory and file-based caching of loaded map tiles
  • A list of map markers (the yellow circles in the screenshot) can be added. Map markers of different shape can be easily added by implementing the MapMarker interface.
  • Configurable/Extentable/Replaceable controller (code part that manages mouse interaction and how the map reacts to it)
  • Requirement: Java 8 (same as JOSM)
  • License: GPL

Releases

Releases containing source code and binary jar files are available in the JOSM Nexus (`maven` compatible): jmapviewer

They are also available in the releases directory in the SVN: https://josm.openstreetmap.de/osmsvn/applications/viewer/jmapviewer/releases

The latest release can be found programmatically as follows:

svn propget ReleaseVersion https://josm.openstreetmap.de/osmsvn/applications/viewer/jmapviewer

or

curl https://josm.openstreetmap.de/nexus/service/local/repositories/releases/content/org/openstreetmap/jmapviewer/jmapviewer/maven-metadata.xml | xpath -q -e 'metadata/versioning/release/text()'

Demo

The release contains a small demo application which demonstrates some of the features of JMapViewer.

JMapViewer demo app screenshot

Development

Javadoc for that component can be found on JOSM-Documentation: Javadoc

Bugs can be reported in JOSM-Wiki: JMapViewer-BugReport

Origin

JMapViewer bases on code written originally for the JOSM plugin slippy map chooser

See also

  • JXMapViewer - similar name but more complex. Embeddable swingx component for java gui developers.
  • JXMapViewer2 - Based on JXMapViewer but more up-to-date and independent of SwingX.