管道基础大数据平台系统开发-【CS】-ExportMap
13693261870
2024-01-05 495e44f98de4517627982fdc11a96a06d4d29645
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>空间统计</title>
  <meta http-equiv="Expires" content="0" />
  <meta http-equiv="Cache" content="no-cache" />
  <meta http-equiv="Pragma" content="no-cache" />
  <meta http-equiv="Cache-control" content="no-cache" />
  <!--<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />-->
  <meta http-equiv="X-UA-Compatible" content="IE=9" />
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <script src="../Jquery/jquery.min.js"></script>
  <script src="../ToolsCommon71.js"></script>
  <link href="../Style.css" rel="StyleSheet" type="text/css" />
  <style>
    html, body {
      margin: 0;
      padding: 0;
      height: 100%;
      width: 100%;
    }
  </style>
  <script>
    var gAsync = true;
    var gDebug = false;
    var groupName = "空间统计";
 
    $(function () {
      init();
    });
 
    function init() {
      window.ondragstart = function () { return false; }
    }
 
    function getGroupId() {
      var gid = SGWorld.ProjectTree.FindItem(groupName);
      if (gid) return gid;
 
      return SGWorld.ProjectTree.CreateLockedGroup(groupName);
    }
 
    function delGroup() {
      try {
        var gid = SGWorld.ProjectTree.FindItem(groupName);
        if (gid) SGWorld.ProjectTree.DeleteItem(gid);
      }
      catch (e) {
        console.log(e);
      }
    }
 
    function getFeatureLayers() {
      var layers = [], index = 0;
      BuildObjectsList(SGWorld.ProjectTree.RootID, layers, 36);
 
      return layers;
    }
 
    function clear(e) {
      $("#totalNum").html("0"); //要素总个数
      $("#lineLen").html("0"); // 线对象长度
      $("#polyArea").html("0"); // 多边形面积
      $("#volume").html("0"); // 三维体体积
      $("#minHeight").html("0"); //三维体最低高度
      $("#maxHeight").html("0"); // 三维体最高高度
    }
 
    function startQuery(e) {
      delGroup();
      if (drawing.drawingEditMode != -1) {
        drawing.abort();
        return;
      }
 
      SGWorld.Window.ShowMessageBarText("按 Esc 键退出");
      drawing.drawPolygon({
        style: {
          lineColor: "#ff0000",
          lineWidth: 3,
        },
        altitudeMethod: 2, // use 2 of "OnTerrain" and 3 for "Absolute" (above mean sea level)
        deleteWhenExit: false, // 
        parentGoupID: getGroupId(),
        saveOnExit: true, // save the polyline/polygon when exiting the project. Default = false
        onFinish: DrawPoly,
        onAbort: ResetAsync
      });
    }
 
    function DrawPoly(geometry, type, altitudeType) {
      SGWorld.ProjectTree.EnableRedraw(0);
      //alert(null==geometry);
    }
 
    function ResetAsync(FirstTime, FromMouseInputMode) {
      if (gAsync)
        setTimeout(function () { Reset(FirstTime, FromMouseInputMode); }, 100);
      else
        Reset(FirstTime, FromMouseInputMode);
    }
 
    function Reset(FirstTime, FromMouseInputMode) {
      try {
        if (gPolyObj != null) SGWorld.Creator.DeleteObject(gPolyObj.ID);
      } catch (e) { }
 
      gPolyObj = null;
      SGWorld.ProjectTree.EnableRedraw(1);
      SGWorld.Window.HideMessageBarText();
      bInEdit = false;
 
      if (FirstTime != 1 && FromMouseInputMode == 0) SGWorld.Window.SetInputMode(0);
    }
  </script>
</head>
<body class="hideUntillTranslated">
  <table style="width: 100%; border: 0;" cellspacing="0" cellpadding="2">
    <tr>
      <td class="ToolTopArea" id="TopAreaTD" width="100%" valign="middle">
        <table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td width="55px">
              <img style="margin-left: 5px;" src="img/ToolIcon.png" alt="" /></td>
            <td id="TitleTD" align="center" class="s12w i18n">空间统计</td>
            <td align="right" id="CloseHelpTd">
              <img style="margin-right: 5px; cursor: pointer;" alt="" src="../CommonImg/help.png" border="0" class="i18n" alt="help" title="帮助" onclick="DisplayHelpPopup6(SGLang.i18nFile('help.html'),SGLang.i18n('help'))" /></td>
          </tr>
        </table>
      </td>
    </tr>
    <tr>
      <td class="ToolTopSeperator"></td>
    </tr>
    <tr class="s8">
      <td>
        <table class="PropertiesSheet" cellspacing="0" cellpadding="2">
          <tr class='TableOtherLine'>
            <td class="s8b">
              <label for="Mode" class="i18n">要素总个数</label>
            </td>
            <td>&nbsp;<span id="totalNum">0</span> 个
            </td>
          </tr>
          <tr>
            <td class="s8b">
              <label for="Mode" class="i18n">线对象长度</label>
            </td>
            <td>&nbsp;<span id="lineLen">0</span> 千米
            </td>
          </tr>
          <tr>
            <td class="s8b">
              <label for="Mode" class="i18n">多边形面积</label>
            </td>
            <td>&nbsp;<span id="polyArea">0</span> 平方千米
            </td>
          </tr>
          <tr>
            <td class="s8b">
              <label for="Mode" class="i18n">三维体体积</label>
            </td>
            <td>&nbsp;<span id="volume">0</span> 立方千米
            </td>
          </tr>
          <tr>
            <td class="s8b">
              <label for="Mode" class="i18n">三维体高度</label>
            </td>
            <td>&nbsp;最低 <span id="minHeight">0</span> 米,最高 <span id="maxHeight">0</span> 米
            </td>
          </tr>
        </table>
      </td>
    </tr>
    <tr class="s8">
      <td align="center" class="ToolButtonsArea">
        <div id="SurfaceDiv">
          <button id="clipboardButton" class="MenuButton" onclick="clear(this);" style="cursor: pointer;">
            <img src="img/delete.png" /><br />
            <span class="i18n">清 除</span></button>
          <button id="DrawPlaneBtn" class="MenuButton MenuButtonLast" onclick="startQuery(this);" style="cursor: pointer;">
            <img src="../commonImg/polygon.png" /><br />
            <span class="i18n">开始统计</span></button>
        </div>
      </td>
    </tr>
    <tr>
      <td>
        <object id="SGWorld" style="display:none" classid="CLSID:3a4f9199-65a8-11d5-85c1-0001023952c1"></object>
      </td>
    </tr>
  </table>
</body>
</html>