Im not too sure if ive written this in the right section but here goes
Some of you may have seen my posts before, however this is a total new thing to me now.
I need to incorporate google maps into my (homemade) java application. Im replicating a sat nav system and ive got the user inputting a destination address etc but now i need some way of passing that information to Google Maps and then retrieving the list of directions as well as the overview of the map that shows the highlighted route.
I need to be able to somehow stick that into a JFrame or JPanel if possible, as im using CardLayout to navigate between 'screens'
Is this possible as a whole?
My supervisor has mentioned using AJAX but ive never used that either and ive been trying to read up on it but it makes no sense to me - im pretty useless with web stuff
Anyone able to help???
p.s. ive been using NetBeans 6.5 to generate my GUI, just incase that makes any difference to people's expertise
Maybe a Swing component like JXMapViewer is a better fit.
Thanks for that, i actually came across that just after i posted on here but i hadnt read it yet
Do i need to change the classpath to use it? i added the .jar files that it mentioned but i still couldnt find the JXMapKit.class it was on about
Am i right to download the 'sources' from the http://swinglabs.org/downloads.jsp or should i download and unzip the 'binaries' or 'javadoc'?
Why would you download the sources (unless you intend to compile it yourself)? You should download the javadocs if you intend to use any of the classes in your application and so may need to look up the API (in other words, yes).
Joined: Feb 26, 2009
I tried using the JXMapViewer, did exactly as the tutorial said but when i dragged the class over to the panel, there was no image of a map at all, just a blank grey-ish screen with small images that i think were meant to represent a clock or a dial of some sort.
It didnt work at all when i ran it too, came up with the same thing.
Is there any way of just tapping into Google Maps' "data" in order to just retrieve the directions list and then worry about the actually graphical display later?
Joined: Feb 26, 2009
ive found out that JXMapViewer isnt 'legal' to use with Google Maps and that Google tend to change a parameter in their URL (i think) regularly to stop things like the JXMapViewer from accessing the service.
Has anyone used AJAX in java before? ive been told its a method of accessing a website which can update without actually having to refresh the entire page, slowing down the entire thing. Was wondering if a Google Maps key is required when using AJAX too or is that only when you use the Google Maps API?
Another thing is, is Google Earth any better to use in java or will it still pose the same problems as Google Maps does?
All help, asap, would be greatly appreciated as i have no idea!!!
Joined: Mar 22, 2005
Google Earth is a native desktop application; I don't see how it could help in a Java application.
AJAX is something you'd use in a browser, for instance if you were to go the "classical" integration route by using a browser component that I suggested in my first post. But you'd need a Google maps key either way, and you need to adhere to the license (which may mean purchasing a commercial package if you can't work within the restrictions of the free license).