views:

159

answers:

2

i want to use google map api for my desktop application. the application will be totally connected to 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..

A: 

I have a desktop application that calls a similar API. They require the API calls to come from one particular domain (and URL). So, I have the desktop app contact my own web server, which calls the third party API and returns the results.

Marcus Adams
if it need a URL how come its a desktop application. so its not a desktop application. my question is for a desktop application
Nubkadiya
@Nubkadiya, Do you understand that you can have your desktop application contact your own web server, which then calls the API?
Marcus Adams
+2  A: 

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

npinti
thanks for the replies. but my application is a desktop application. so i do need to download google api. but they asking for a URL to get the key. i do need to get the key to download and use it. please is there any other way. is there any other tutorials for teaching how to setup google map api with a desktop application
Nubkadiya
any more answers
Nubkadiya
You need a key to get access to google maps. I posted a link to a tutorial that shows you how to build the URL to get a map from google maps. You can get a static map from Google to display on your desktop application as long as your application can be downloaded for free.
npinti