我正在尝试让 kmltree 工作。正在加载 kmz,但树不会展开以显示子元素。他也没有出现正确的文件夹图标。可能有关系?
任何人都看到我可能做错了什么?
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Simple Example</title>
<script src="http://www.google.com/jsapi?key=ABCD"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<!-- earth-api-utility-library dependencies -->
<script src="http://geojs.googlecode.com/svn/trunk/dist/geo.pack.js"></script>
<script src="http://earth-api-utility-library.googlecode.com/svn/trunk/extensions/dist/extensions.pack.js">
</script>
<!-- kmltree source files -->
<link rel="stylesheet" href="../dist/kmltree.css" media="screen">
<script src="../dist/kmltree.min.js"></script>
<script>
google.load("earth", "1");
function init() {
google.earth.createInstance('map3d', initCB, failureCB);
}
function initCB(instance) {
ge = instance;
ge.getWindow().setVisibility(true);
var gex = gex = new GEarthExtensions(ge);
var tree = kmltree({
url: 'http://kmltree.googlecode.com/hg/examples/kml/hello.kml',
gex: gex,
mapElement: $('#map3d'),
element: $('#tree'),
});
tree.load();
}
function failureCB(errorCode) {
alert('failed to load plugin');
}
$(document).ready(init);
</script>
</head>
<body>
<div id="tree" style="float:left; width:300px; height: 400px;"></div>
<div id="map3d" style="float:left; height: 400px; width: 600px;"></div>
</body>
</html>