views:

4656

answers:

7

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

What i need though is a library to work with a desktop client, no javascript , GWT e.t.c.

Any ideas?

A: 

You'll likely need to go with Microsoft Map Point Web Services. I don't know if Google offers something comparable w/out Javascript.

Nate Bross
+1  A: 

embed a web browser control into your client, displaying a HTML page that uses the javascript API.

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

mihi
+5  A: 

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.

Clint
A: 

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

Thorbjørn Ravn Andersen
A: 

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.

matt b
Yep, this is just for retrieving the map data (markers, lines and shapes with geo information).
Cannonade
+1  A: 

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:

http://stackoverflow.com/questions/294813/embedding-web-browser-window-in-java

richardtallent
+4  A: 

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:

http://maps.google.com/staticmap?center=40,26&zoom=1&size=150x112&maptype=satellite&key=ABQIAAAAgb5KEVTm54vkPcAkU9xOvBR30EG5jFWfUzfYJTWEkWk2p04CHxTGDNV791-cU95kOnweeZ0SsURYSA&format=jpg

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.

EDIT: Thanks Paracycle, not sure if that is a new addition to the FAQ, but in any case it is pretty explicit, you are not allowed to do this.

Cannonade
Actually, in another section in same FAQ (http://code.google.com/apis/maps/faq.html#mapsformobile), they also state that: "Note that it is not permitted to use the Static Maps API outside of browser based applications."
paracycle