Java equivalent of OpenLayers

dave4351 picture dave4351 · May 22, 2009 · Viewed 12.3k times · Source

I am looking for a Java library to display map data from various sources, including shapefile, WMS, WFS, Google Maps, possibly ArcIMS, etc. It seems like OpenLayers is the closest thing to what I want, except it's a JavaScript library, and I'm writing a Swing application.

GDAL looks promising, but as far as I can tell there won't be Java bindings until "sometime" in the future.

Just to be clear, I am looking for a single Java API that I can use to display maps from a number of map servers/sources.

Does anyone know if anything like this exists, and if not, where to go from here? Should I build this API on top of GeoTools? Or...

Answer

David Winslow picture David Winslow · May 24, 2009

GeoTools is a good bet for this. The Google Maps Terms of Service prohibit accessing Google Maps tiles except through the (JavaScript) Google Maps API, so it's not likely that you'll find a freely available codebase to access them in a Java application. Similar restrictions probably apply to other commercial layers.