Can anyone explain (or point to another source that explains) how to
embed google earth into a java (desktop) application?
Cheers,
Ding
Are you trying to embed it in a web page or a windows app ?.
I extracted the following code from :-
http://earth-api-samples.googlecode.com/svn/trunk/demos/mapsapi/ggeoxml.html
This is usefull site and it's quite simple to understand.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-
transitional.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html;
charset=utf-8" />
<title>Using Google Earth with the Maps API - GGeoXml</title>
<!-- *** Replace the key below with your own API key, available at
http://code.google.com/apis/maps/signup.html *** -->
<script type="text/javascript" src="http://www.google.com/jsapi?
key=ABQIAA................"></script>
<script type="text/javascript">
google.load('maps', '2.160');
var map;
var geoXml;
function initialize() {
map = new GMap2(document.getElementById("map"));
map.setCenter(new GLatLng(37.4328, -122.077), 12);
map.addMapType(G_SATELLITE_3D_MAP);
var mapui = map.getDefaultUI();
mapui.maptypes.physical = false;
map.setUI(mapui);
map.setMapType(G_SATELLITE_MAP);
}
</script>
</head>
<body onload="initialize()" onunload="GUnload">
<div id="map" class="map" style="width:800px;height:600px"></div>
</body>
</html>
I think it should work although I haven't tested it.
John
www.gtrek.co.uk