I want to use Google Map API for my Desktop application

google-maps, java

Solution

At the moment it is illegal to use the JXMapViewer with google maps, reason being that this component requires direct access to Google's tile server. According to Google's ToC:

Can I access the Maps and Satellite images directly?

You may not access the maps or satellite images through any mechanism besides the Google Maps APIs (such as the creation of your own mapping API or the use of a bulk tile download script). Your application's access to the tiles will be blocked if it accesses them outside of the Google Maps APIs. See section 5.3 of the Google Terms of Use for more details.

More information can be found here. You should be able to download the packages from here. They moved the domain and many sites still point to the old domain, hence taking you nowhere.

Currently the only way you can use the JXMapViewer by displaying maps from OpenStreetMap.

You can, however, display static maps on your application. You basically build a URL. This tutorial should give you a basic idea on how to be able to build a URL to be able to request static maps. You then use an HTTP Get request to get the image back.

Last but not least, Google is planning on allowing direct access to their tile servers, but this might take a while.

Problem

I want to use google map API for my desktop application. The application will be totally connected to the internet. While I was searching some research notes about this implementation. I found a ideal site with the configurations, but it has some java files to be downloaded, but when I tried that website its not loading. which is swinglabs.org http://today.java.net/pub/a/today/2007/10/30/building-maps-into-swing-app-with-jxmapviewer.html Any other options of doing this api implementation to my desktop application? and one more thing. I tried downloading the google api. even it ask a url.We have to provide a url then only we get a key to download it. And the api should run in that specific url. Otherwise, its not working. How this appears to a desktop application any ideas welcome.

Original source