I'm trying to wrap my head around the proper architecture for a demo app that uses Google Earth. I'd appreciate any suggestions, as I'm new to this!
The web page should:
What I have:
So, I guess the question is how to get the Java output into Google Earth. As GE's API is for Javascript, is there any way to call the Java-methods from there? Any other way to solve it?
You've got two options depending on how you want to serve up the kml.
A) You can set up a network link or use fetchkml with url that points to a servlet that gets kml from the java package already written. Check out this servlet lesson. Also be sure to set your response contentType to be "application/vnd.google-earth.kml+xml"
B) Store the kml in hidden fields in a form on the web page. Then use javascript to grab the kml from the form DOM and add it using the functions you mentioned.
I would reccomend option A