0

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>
4

1 に答える 1

0

同じ問題に遭遇し、「kmltree.css」ファイル内のすべての「images/..」リンクのパスを実際のフォルダー設定に適合させることで解決しました。たとえば、元の「images」と「css」の両方を配置した場合ルート ディレクトリの " フォルダのパスを "../images.." に変更する必要があります。

于 2014-01-30T14:57:23.810 に答える