zoukankan      html  css  js  c++  java
  • SkylineGlobe 如何实现绘制圆形Polygon和对图层的圆形范围选择查询

    //结束绘制圆形之前,得到Polygon
                 var pos = gPolyObj.Position;
                 var bufferR = gPolyObj.Radius;
                 var cVerticesArray = [-122.415025, 37.76059, 10, ];
                 var point = sgworld.Creator.GeometryCreator.CreatePointGeometry(cVerticesArray);
                 point.X = pos.X;
                 point.Y = pos.Y;
                 point.Z = pos.Altitude;
                 var newGeo = point.SpatialOperator.buffer(bufferR);
    ExecuteSpatialQuery(null, newGeo);
    function ExecuteSpatialQuery(pLayer, pGeo) {
                 var sgworld = CreateSGObj();
                 var htmlStr = "";
                 var layerItemId = sgworld.ProjectTree.FindItem("Building");
                 if (layerItemId != sgworld.ProjectTree.RootID) {
                     var pipeLayer = sgworld.ProjectTree.GetObject(layerItemId);
                     if (pipeLayer.ObjectType == 36) { // OT_FEATURE_LAYER = 36  // OT_3D_MESH_FEATURE_LAYER = 39
                         var statisticsedLayer = pipeLayer.ExecuteSpatialQuery(pGeo, 1);
    
                         //alert(statisticsedLayer.Count);
                         sgworld.Command.Execute(1086,0);
                         htmlStr = "<html><head><title></title>";
                         htmlStr += "<style>table{border-right:1px solid #ED7D31;border-bottom:1px solid #ED7D31}table td{border-left:1px solid #ED7D31;border-top:1px solid #ED7D31}</style>";
                         htmlStr += "</head><body style='100%;height:100%;  margin:2px; padding:2px;'><table style='100%; text-align:center;font-size:12px;' border='0' cellspacing='0' cellpadding='0'><tr style='background-color:#ED7D31'>";
                         // var firstFeature = statisticsedLayer(0);
                         htmlStr += "<td>";
                         htmlStr += "选取设备数量";
                         htmlStr += "</td>";
                         htmlStr += "<td>";
                         htmlStr += "&nbsp;&nbsp;&nbsp;&nbsp;" + statisticsedLayer.Count;
                         htmlStr += "</td>";
                         htmlStr += "</tr>";
                         htmlStr += "</table></body></html>";
                         if (htmlStr != "") {
                             var ScreenRectHeight = sgworld.Window.Rect.Height;
                             var ScreenRectWidth = sgworld.Window.Rect.Width;
                             var areaPopup = sgworld.Creator.CreatePopupMessage("检修计划表", "", 231, 150, 231, 120);
                             areaPopup.InnerText = htmlStr;
                             areaPopup.Flags = 512;
                             areaPopup.AllowResize = true;
                             areaPopup.AllowDrag = true;
                             sgworld.Window.ShowPopup(areaPopup);
                         }
                     }
                 }
             }
  • 相关阅读:
    C#线程使用学习
    C# 线程
    C# Lambda表达式与Linq
    C#聚合运算方法
    责任链模式
    代理模式
    享元模式
    门面模式(外观模式)
    桥梁模式
    设计模式-创建型、结构型、行为型之间的区别
  • 原文地址:https://www.cnblogs.com/yitianhe/p/4227486.html
Copyright © 2011-2022 走看看