zoukankan      html  css  js  c++  java
  • SkylineGlobe 如何实现二次开发加载KML文件

    示例代码如下:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title></title>
        <script type="text/javascript" language="javascript">
            function LoadKML() {
                try {
                    var sg = CreateSGObj();
                    var kmlLayer = sg.Creator.CreateKMLLayer(abspath()+"/Binoculars.kml","");                
                }
                catch (e) {
                    alert(e);
                }
            }
            
            /*  
            功能:   创建sgworld对象
            备注:   赵贺 2011.04.01.
            */
    
            function CreateSGObj() {
                var obj = $("sgworld");
                if (obj == null) {
                    obj = document.createElement('object');
                    document.body.appendChild(obj);
                    obj.name = "sgworld";
                    obj.id = "sgworld";
                    obj.classid = "CLSID:3a4f9197-65a8-11d5-85c1-0001023952c1";
                }
                return obj;
            }
            function $(id) {
                return window.document.getElementById(id);
            }
    
            //--------------
            // abspath
            function abspath() {
                var abspath = unescape(window.location.href);
    
                // Remove query String 
                var index = abspath.indexOf("?");
                if (index > 0) abspath = abspath.substr(0, index - 1);
    
                index = abspath.lastIndexOf("/");
                var index2 = abspath.lastIndexOf("\");
    
                index = (index > index2) ? index : index2;
                if (index <= 0) return abspath;
    
                abspath = abspath.substring(0, index);
    
                if (abspath.substring(0, 1) == "/") abspath = abspath.slice(1);
    
                var re = /file:////gi;
                if (abspath.match(re) != null) abspath = abspath.replace(re, ""); // if this is indeed a local file, we strip the "file://" prefix from it.    
    
                return (abspath);
            }
        </script>
    </head>
    <body >
        <input id="Button1" type="button" value="加载KML" onclick="LoadKML()" />
        <object id="TE3DWindow" classid="CLSID:3a4f9192-65a8-11d5-85c1-0001023952c1" width="1000px"
            height="600px">
        </object>
        <OBJECT ID="TerraExplorerInformationWindow" CLASSID="CLSID:3a4f9193-65a8-11d5-85c1-0001023952c1" width="200px"
            height="600px" ></OBJECT>
    </body>
    </html>
  • 相关阅读:
    变态跳台阶
    早期(编译器)优化--Java语法糖的味道
    早期(编译器)优化--javac编译器
    虚拟机字节码操作引擎-----基于栈的字节码解释引擎
    虚拟机字节码执行引擎-----方法调用
    虚拟机字节码执行引擎-----运行时栈帧结构
    虚拟机类加载机制--类加载器
    空间索引详解
    svn安装与使用
    IntelliJ IDEA 常用设置 (二)
  • 原文地址:https://www.cnblogs.com/yitianhe/p/4158089.html
Copyright © 2011-2022 走看看