Java API for Google Maps (or similar)
I was wondering if there is a Java library that acts as a wrapper for the Google Maps API. What I am interested in is displaying a satellite map of a specific region (lon, lat) on my desktop application. It doesn't have to be Google Maps specifically, any map service would do the trick.
If you are just looking to display a satellite map image for a specific latitude longitude (without the google maps panning/zooming etc), then you should check out Google Static Maps.
You just need to build a URL string, then make an HTTP request (from your java implementation) for the image (in whatever format you like). You can specify a whole bunch of parameters in the URL to get the satellite image you are after:
From the URL:
EDIT: Ok, I actually deleted this answer because I discovered section 10.8 in the TOS explicitly forbids accessing static maps from outside a browser. But then I discovered this FAQ update which seems to allow it. I might ask a Google person and get the final word.
Google maps does not allow for using it's images in desktop applications. Microsoft has a collaboration with USGS at http://terraserver-usa.com/. There is a freely available web service with a WSDL. You can use common Java WSDL binding libraries like Axis or CXF to create java object to access the service.
Also, NASA has the World Wind project which has a Java API. The images are not the Google images but much of the Google images are based off of these images.
Recently Google launched the Maps Services for Java library, which brings support for the geocoding, directions, distance matrix, elevation and timezone APIs to Java.
Everything else will break eventually, since at least Google and Microsoft tend to change the link format for their aerial images regularly to make it harder to scrape them and store them offline (because they do not have bought licenses from the content providers for offline storage of these images).
Other services (like Googles geolocation service) can easily used from Java, and "normal maps" work well as well, but aerials are tricky (at least they were when I tried it the last time), but of course doable if you are able to ship an update when the format changes...
edit: It might be different with the Google Maps for Enterprises service, but expect to pay a five-digit dollar amount for it...
To see the literal map in your desktop app's window, you can embed a browser control that is Java-based and is compatible with the Google Maps application.
See this question to find out how to embed a browser in your Java app:
Have a look at http://www.javaworld.com/javaworld/jw-01-2006/jw-0116-google.html. They describe how to work with Google Maps from Java and they have a war file (untested).
You might want to take a look at the official Google Maps Data API, which I believe has a Java client. However I think this is just for retrieving/updating the "data" portion of Maps, so it would not give you access (which you probably aren't licensed to) for the actual photos.
Check out http://javamaps.blogspot.com .