Java & Google Maps - java

Is it possible to render google maps in swing or applet?
I know i can also use NASA World Wind but it seems to much overkill for a simple app.

There is JXMapViewer component in SwingX project. You can write new TileProviderInfo,TileFactory to pull images from Google maps but using JXMapViewer to pull maps from Google was illegal when I used it(2008). Google was usually changing Map URL format so your program can be broken unexpectedly if this is still illegal.
in My last project we have used JXMapViewer and Microsoft Visual Earth instead of Google maps.

You can use JxMaps to render Google Maps in your Swing application. It provides Java API that covers most of Google Maps JavaScript API functionality.

Related

Google Maps view in Java application

My goal is to have a GPS Track displayed in a local Java Application with Google Maps. And I am pretty sure I am not the first one to try this, so there should be a way.
The Problem is that I found the Google Maps Engine API (Deprecated) which is stated as deprecated. But I didn't find any replacement. Only this page, which then links to the deprecated version again.
I also did some search, but all results seem to point to future deprecated API, and also are pretty old.
Can anyone point me a version or tooling that I will be able to still use in 2016? Or does anyone know an alternative to using Google Maps for displaying GPS tracks in a local java app.
Thanks
In case anyone has the same problem:
I used mapsforge https://github.com/mapsforge/mapsforge
JxMaps library provides possibility to add Google Maps to java swing application. Using this library you can draw GPS track either as polyline or set of markers on the map.

ways to implement desktop application with maps

i need to implement a desktop application (possibly with Java Swing) in which i can implement maps (not only Google maps but also other services) in two ways: online and offline. Online means the application calls API services by internet, while offline means that i have maps services saved locally and i can request for them also without an internet connection..
Specifically, my application has to draw a polygon on the map (with the API) and do some computations on the background..
Given this, what services can i use to implement at least one way (online or offline) or both? Thanks so much
Initially, google maps only allowed online use of it's API. Any attempt to save maps for use offline was an offence.
I know that the current google maps app (Android / IOS) supports storing maps offline but I don't think this is open to third parties such as yourself. As with everything google, they want your data so they won't let you use the maps offline since they can't see how it's being used.
I've seen many offline mapping applications based on open street map. These maps are open source and free to use as you please (online / offline).

What are the benefits of using the native Android Google Maps API over integrating Maps Javascript API V3?

I want to develop an Android app that uses google maps heavily. So far I started developing with the native google maps API: http://code.google.com/android/add-ons/google-apis/maps-overview.html
but it is quite limited and most of the new functions are not usable.
To use more function I'm thinking about integrating the Javascript API as discriped here: http://code.google.com/apis/maps/articles/android_v3.html#why
Are things like adding and removing markers etc. with this API possible, too? Are there any disadvantages of using the Javascript API?
this is a common question, I'm surprised nobody answered it yet.
Google Maps API is "optimized" for smartphones. Really, it is very powerful on iOS, much less on Android. With the native API, you can fully use the interface (i.e. touch events, pinch to zoom, etc...), but the massive downside of it is that you can have only ONE map instanciated by MapActivity... Therefore, your MapView needs to be attached to a MapActivity... So forget it if you want to use it in a WebView, it just won't work... At least not nicely.
The JAvascript API v3 now, has been designed for web pages, so it does not provide support for touch events : zomm is performed by buttons for exemple (this is customizable, but yet antique). You can add Overlays with both of the APIs, but remenber that the Google Maps native API is REALLY heavy...
So, to summerize, if you want a very quick app that doesn't care about touch event (you can catch a touch to add an Overlay, but this is quite unreliable if I recall), then use Javascript API.
if you, on the other hand, try to developp a wide audience app (i.e. meant to be on the market), I'd recommend the native API, as painfull and limited as it is, because your end-users won't understand. Let's face it, Javascript API is ugly, and looks antique !
I had the case some weeks ago : I had troubles including MapView in a WebView (not really meant to be used that way...), so I backed to the Javascript API, just for the app to look like the contract says it should. Well, believe it or not, the client was VERY unhappy of the result...
Hope I'd help someone, since this post is so old...

I want to use Google Map API for my Desktop application

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.
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.
You can use google maps in desktop applications.
For this you need to embed a browser in your application and then open up html/javascript files which render a map.
Different languages and api provide ways to embed a browser. For example wxwidgets/c++ has a widget called WebView which allows to embed webkit on linux and trident on windows. Similary mfc/c# also allow the same. So checkout how to embed a browser into your application.
The api should also provide a way to execute javascript code in the embedded browser. Then you can modify the google map through the code of the application as and when needed.
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.

Is there a Swing component for Google Maps?

I would like to have support for Google Maps in my Java Swing desktop application. Is there an Google Maps component for Swing that is freely available? It would be good if it was extendable and maybe had support for other maps i.e. like OpenStreetMaps.
You can use JXMapViewer
look here
http://today.java.net/pub/a/today/2007/10/30/building-maps-into-swing-app-with-jxmapviewer.html
How about JXMapViewer? Looks like it gets NASA's Blue Marble tile set by default (if you want 3D maps and Blue Marble WorldWindJava is an amazing API for mapping), but also works with OpenStreetMap. Or, looks like gmap-viewer is a project which can show you how it's done. Aerith also includes Google maps.
EDIT: Also, check out this related StackOverflow question. Looks like the FAQ, at least at that time, did not allow you to do what you want with Google Maps (OpenStreetMap, on the other hand, has desktop apps like Traveling Salesman and clearly embraces the desktop, as does WorldWind).
You can use Google visualisation library directly in java, where you can show Google Maps as you like.
Google Visualization API Gallery

Categories

Resources