Google map in swing app?
I was working on a project knows as gps vechile tracker,where we track the vechile using the gps hardware,which basically needs a map to track the vechiles successfully ,Neways my question is that is it possible to integrate google map onto the swing application?i googled this question but i dint get much help/info regarding this topic,
I even tryed to integrate the google map onto the swing application using jxmapviewer,but the map doesnt seem to appear on the frame :( :(
I would be really thankfull towards you if you can provide me "any" information on this!
Google maps is it's own application. There's no straightforward way to integrate it seamlessly into you application. However, you can launch it as an independent process and interact with it using KML.
You'd be better served starting from the google maps API and writing your application around it than trying to retrofit it into another application.
Sir,thanks for the reply.
how do you launch the webpage(google map) in swing app as a seperate process? can we integrate a "webpage" onto the swing app?can you please elaborate on this topic!
Kindly provide any tutorial/links in it!
You cannot integrate a webpage well (i''ve tried, for the same reason) due to rendering issues, portability, etc.
You can use NASA's World Wind SDK (more like google earth, but you can have street maps, e.g. Open Street map, which is very good. Bing maps has excellent high resolution sattelite imagrey). I have used this, and it is very good, with a lot of features. (For example, line drawing for GPS). I used it with GPS myself when developing a ground station for UAV's. I think it even has google maps integrated. Just add it as another swing component - and it's read to use!
Another light weight option is the JXMapViewer, part of SwingX. Havn't used this extensively, but pretty good.
World Wind JAVA SDK
Swingx-ws — Project Kenai
Thanks for the reply rp181.
i have already tryied out the JXMAPVIEWER component,it doesnt seem to display the map
in in netbeans 6.9.1 IDE.
Neways i have downloaded the world wind Java sdk as you suggested.what next? i would be really greatefull towards you if you can you guide me through this!.i googled about this topic a lot and i dint get much help on this topic!
To launch a subprocess, please read the API for java.lang.Runtime.exec().
The download comes with many, many examples. The readme should tell how to compile and run them. Basically, what I did, was run random examples, and get code (source is included) from the examples. In netbeans, first of all, add the world wind component to the palette. After adding the canvas (note, this isn't a class, add where appropriate):
Best way to learn the capabilities is to:
//different layers you can add. More are available
static final Layer boundries = new CountryBoundariesLayer(); //country boundries
static final Layer landsat = new LandsatI3WMSLayer(); //land sat, kinda bad
static final Layer osm = new OSMMapnikTransparentLayer(); //OpenStreetMap, very good
static final Layer oosm = new OSMCycleMapLayer(); //OSM with smaller trails, very good
static final Layer virtualearth = new MSVirtualEarthLayer(); //Bing Maps, Very, very good sattelite (high res)
static final Layer usgsurban = new USGSUrbanAreaOrtho(); //good, outdated
static final Layer grid = new UTMGraticuleLayer(); //a grid THIS CAN CAUSE IMMENSE SLOWDOWN ON SOME COMPUTERS
//do this first for no null exception. Before init components:
worldWindCanvas = new gov.nasa.worldwind.awt.WorldWindowGLCanvas();
OrbitView ov = (OrbitView) worldWindCanvas.getView(); // for navigation
worldWindCanvas.getModel().getLayers().add(osm); //add whatever layer, optional. The default is NASA's blue marble map - not much zoom available
1) Download WorldWind, it is an actual application (like google earth). Almost everything in there can be done
2) Look through examples!
3) More examples!