Results 1 to 8 of 8
  1. #1
    Manish87 is offline Member
    Join Date
    Aug 2010
    Posts
    29
    Rep Power
    0

    Default Google map in swing app?

    Hi,

    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!



    Kind Regards,
    Manish87

  2. #2
    Manish87 is offline Member
    Join Date
    Aug 2010
    Posts
    29
    Rep Power
    0

    Default

    Anyone?????

  3. #3
    toadaly is offline Senior Member
    Join Date
    Jan 2009
    Posts
    671
    Rep Power
    6

    Default

    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.

  4. #4
    Manish87 is offline Member
    Join Date
    Aug 2010
    Posts
    29
    Rep Power
    0

    Default

    Hi,

    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!



    Kind Regards,
    Manish87

  5. #5
    rp181 is offline Member
    Join Date
    Mar 2009
    Posts
    70
    Rep Power
    0

    Default

    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

  6. #6
    Manish87 is offline Member
    Join Date
    Aug 2010
    Posts
    29
    Rep Power
    0

    Default

    Hi,

    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!



    Kind Regards,
    Manish87

  7. #7
    toadaly is offline Senior Member
    Join Date
    Jan 2009
    Posts
    671
    Rep Power
    6

    Default

    To launch a subprocess, please read the API for java.lang.Runtime.exec().

  8. #8
    rp181 is offline Member
    Join Date
    Mar 2009
    Posts
    70
    Rep Power
    0

    Default

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

    Java Code:
    //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();
    worldWindCanvas.setModel(new BasicModel());
    
    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
    worldWindCanvas.redrawNow();
    Best way to learn the capabilities is to:
    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!

Similar Threads

  1. Java and Google Search
    By V.J in forum Networking
    Replies: 7
    Last Post: 12-27-2010, 07:19 AM
  2. Google app engine error
    By prabhug1987 in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 11-29-2010, 06:41 AM
  3. google in web browser
    By jeff666 in forum AWT / Swing
    Replies: 1
    Last Post: 07-06-2008, 09:03 PM
  4. Google Maps API
    By mew in forum New To Java
    Replies: 0
    Last Post: 12-26-2007, 11:28 AM
  5. Google Singleton Detector 0.7.2
    By levent in forum Java Software
    Replies: 0
    Last Post: 07-26-2007, 09:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •