• Skyline 二次实现单体化模型选择查询示例代码


     
    <!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>3dml的Feature对象选中和隐藏</title>
        <script type="text/javascript">
            function StartF() {
                try {
                    var sg = CreateSGObj();
                    sg.AttachEvent("OnLButtonDown", OnLButtonDown);
                }
                catch (e) {
                    alert(e);
                }
            }
    
            function EndF() {
                var sg = CreateSGObj();
                sg.DetachEvent("OnLButtonDown", OnLButtonDown);
            }
    
            function OnLButtonDown(Flags, X, Y) {
                try
                {
                    var sg = CreateSGObj();
                    var iwp = sg.Window.PixelToWorld(X, Y, 8192);
    
                    var pIFeature = sg.Creator.GetObject(iwp.ObjectID);
    
                    pIFeature.Tint.abgrColor = 0x66FF0000;
                    //pIFeature.Show = false;
                    var divobj = window.document.getElementById("res");
                    divobj.innerText = iwp.ObjectID + "****" + pIFeature.ParentGroupID;
                    var strResult = "";
                    for (var j = 0; j < pIFeature.FeatureAttributes.Count; j++) {
                        var pIFeatureAttribute = pIFeature.FeatureAttributes.Item(j);
                        strResult = strResult + "<td>" + pIFeatureAttribute.Name + "*" + pIFeatureAttribute.Value + "</td>";
                    }
                    divobj.innerText = divobj.innerText + strResult;
                }
                catch (e)
                { }
    
                return false;
    
            }
            
            //------------------------------------------------------------
            // 创建sgworld对象  赵贺 2015.06.09. TEPro6.6
            //------------------------------------------------------------
            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:3A4F9199-65a8-11d5-85c1-0001023952c1";
                }
                return obj;
            }        
            function $(id) {
                return window.document.getElementById(id);
            }
        </script>
    </head>
    <body>
        <input id="Button1" type="button" value="开始" onclick="StartF()" />
        <input id="Button2" type="button" value="结束" onclick="EndF()" />
        <div id="res"></div>
        <object id="TerraExplorer3DWindow" classid="CLSID:3a4f9192-65a8-11d5-85c1-0001023952c1" style="500px;height:400px;"></object>
        <object id="TerraExplorerInformationWindow" classid="CLSID:3a4f9193-65a8-11d5-85c1-0001023952c1" style="300px;height:400px;"></object>
    </body>
    </html>
    

      

     

    上面代码适用于Skyline TerraExplorer Pro 6.6.0 版本.

  • 相关阅读:
    gitment Error:validation failed错误解决办法
    Hexo博客yilia主题添加Gitment评论系统
    用DateTime的ParseExact方法解析特殊的日期时间
    C#中的日期处理函数
    SQL,Linq,Lambda之间的转换练习
    Windows Azure Platform 系列文章目录
    Linq查询表达式
    EF框架的三种工作方式
    jQuery UI 实现图片循环显示,常用于网站首页banner广告切换
    jQuery UI Datepicker
  • 原文地址:https://www.cnblogs.com/yitianhe/p/4563813.html
Copyright © 2020-2023  润新知