月球大数据地理空间分析展示平台-【前端】-月球2期前端
surprise
2023-12-01 cf0f6175e065724b99a8638b0f33050880d5571d
sdk版本更新
已修改7个文件
1720 ■■■■ 文件已修改
public/CIMSDK/Workers/path/Path.html 839 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/SmartEarthSDK/Workers/path/Path.html 841 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/WebSDK/WebSDK.min.js 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/WebSDK/index.cjs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/WebSDK/index.js 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/config/config.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/index.html 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/CIMSDK/Workers/path/Path.html
@@ -2,465 +2,458 @@
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport"
        content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
    <title>SmartEarth-SDK示例</title>
    <link rel="stylesheet" href="../layui/css/layui.css">
    <style>
        html,
        body,
        .layui-prop {
            background-color: rgba(0, 0, 0, 0);
            height: 100%;
            color: #fff;
            overflow-y: auto;
            overflow-x: hidden;
        }
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta name="viewport"
    content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
  <title>SmartEarth-SDK示例</title>
  <link rel="stylesheet" href="../layui/css/layui.css">
  <style>
    html,
    body,
    .layui-prop {
      background-color: rgba(0, 0, 0, 0);
      height: 100%;
      color: #fff;
      overflow-y: auto;
      overflow-x: hidden;
    }
        .layui-prop::-webkit-scrollbar {
            /*滚动条整体样式*/
            width: 8px;
            /*高宽分别对应横竖滚动条的尺寸*/
            height: 8px;
            scrollbar-arrow-color: red;
        }
    .layui-prop::-webkit-scrollbar {
      /*滚动条整体样式*/
      width: 8px;
      /*高宽分别对应横竖滚动条的尺寸*/
      height: 8px;
      scrollbar-arrow-color: red;
    }
        .layui-prop::-webkit-scrollbar-thumb {
            border-radius: 5px;
            -webkit-box-shadow: inset 0 0 5px rgba(218, 218, 218, 0.2);
            box-shadow: inset 0 0 5px rgba(218, 218, 218, 0.2);
            background: rgba(218, 218, 218, 0.5);
            scrollbar-arrow-color: red;
        }
    .layui-prop::-webkit-scrollbar-thumb {
      border-radius: 5px;
      -webkit-box-shadow: inset 0 0 5px rgba(218, 218, 218, 0.2);
      box-shadow: inset 0 0 5px rgba(218, 218, 218, 0.2);
      background: rgba(218, 218, 218, 0.5);
      scrollbar-arrow-color: red;
    }
        .layui-prop::-webkit-scrollbar-track {
            -webkit-box-shadow: inset 0 0 5px rgba(218, 218, 218, 0.2);
            box-shadow: inset 0 0 5px rgba(218, 218, 218, 0.2);
            border-radius: 0;
            background: rgba(218, 218, 218, 0.1);
        }
    .layui-prop::-webkit-scrollbar-track {
      -webkit-box-shadow: inset 0 0 5px rgba(218, 218, 218, 0.2);
      box-shadow: inset 0 0 5px rgba(218, 218, 218, 0.2);
      border-radius: 0;
      background: rgba(218, 218, 218, 0.1);
    }
        form {
            width: 95%;
        }
    form {
      width: 95%;
    }
        html {
            overflow: hidden;
        }
    html {
      overflow: hidden;
    }
        .layui-form-item {
            width: 313px !important;
        }
    .layui-form-item {
      width: 313px !important;
    }
        .layui-input {
            background-color: #fff !important;
            height: 30px;
            margin-top: 5px;
        }
    .layui-input {
      background-color: #fff !important;
      height: 30px;
      margin-top: 5px;
    }
        .layui-form-label {
            width: 96px !important;
        }
    .layui-form-label {
      width: 96px !important;
    }
        .layui-input-block {
            width: 150px !important;
            margin-left: 150px !important;
        }
    .layui-input-block {
      width: 150px !important;
      margin-left: 150px !important;
    }
        .layui-prop {
            margin-left: 10px;
        }
    .layui-prop {
      margin-left: 10px;
    }
        .layui-form-item .line {
            display: block;
        }
    .layui-form-item .line {
      display: block;
    }
        .layui-input-block {
            margin-left: 0;
        }
    .layui-input-block {
      margin-left: 0;
    }
        .layui-form-item {
            border: 1px solid;
            margin-bottom: 0px !important;
            border-bottom: none;
        }
    .layui-form-item {
      border: 1px solid;
      margin-bottom: 0px !important;
      border-bottom: none;
    }
        .layui-input {
            background-color: rgba(0, 0, 0, 0) !important;
            margin-top: 5px;
            color: #fff;
        }
    .layui-input {
      background-color: rgba(0, 0, 0, 0) !important;
      margin-top: 5px;
      color: #fff;
    }
        .layui-form-select dl {
            background-color: rgba(0, 0, 0, 0.5) !important;
        }
    .layui-form-select dl {
      background-color: rgba(0, 0, 0, 0.5) !important;
    }
        .layui-form-select dl dd:hover {
            background-color: #f2f2f250;
        }
    .layui-form-select dl dd:hover {
      background-color: #f2f2f250;
    }
        .bnt-box {
            text-align: center;
            height: 58px;
        }
    .bnt-box {
      text-align: center;
      height: 58px;
    }
        .bnt-box button {
            margin-top: 10px;
        }
    .bnt-box button {
      margin-top: 10px;
    }
        .fly {
            display: none;
        }
    .fly {
      display: none;
    }
        #flySpeed {
            padding: 19px 0;
        }
    </style>
    #flySpeed {
      padding: 19px 0;
    }
  </style>
</head>
<body>
    <div class="layui-prop">
        <div class="bnt-box">
            <button type="button" class="layui-btn layui-btn-normal" id="start">继续漫游</button>
            <button type="button" class="layui-btn layui-btn-normal" id="stop" style="margin-left: 0;">暂停漫游</button>
            <button type="button" class="layui-btn layui-btn-normal" id="exit">退出漫游</button>
        </div>
        <form class="layui-form" action="">
            <div class="layui-form-item">
                <label class="layui-form-label">路线名称</label>
                <div class="layui-input-block" id="roadName" style="line-height: 38px;">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">视角模式</label>
                <div class="layui-input-block">
                    <select id="sjms" name="sjms" lay-filter="sjms">
                        <option value="0">跟随模型</option>
                        <!-- <option value="1">第一人称视角</option>
                        <option value="2">上帝视角</option> -->
                    </select>
                </div>
            </div>
            <div class="layui-form-item norline fly">
                <label class="layui-form-label">飞行高度</label>
                <div class="layui-input-block">
                    <input id="cameraHeight" type="text" value="0" name="cameraHeight" lay-filter="cameraHeight"
                        class="layui-input" onkeyup="value=value.replace(/[^\d\.\-]/g,'')">
                </div>
            </div>
            <div class="layui-form-item norline fly notGod">
                <label class="layui-form-label">飞行距离</label>
                <div class="layui-input-block">
                    <input id="cameraDistance" type="text" value="0" name="cameraDistance" lay-filter="cameraDistance"
                        class="layui-input" onkeyup="value=value.replace(/[^\d\.\-]/g,'')">
                </div>
            </div>
            <div class="layui-form-item norline fly notGod">
                <label class="layui-form-label">俯仰角</label>
                <div class="layui-input-block">
                    <input id="pitch" type="text" value="0" name="pitch" lay-filter="pitch" class="layui-input"
                        onkeyup="value=value.replace(/[^\d\.\-]/g,'')">
                </div>
            </div>
            <div class="layui-form-item norline">
                <label class="layui-form-label">漫游速度(m/s)</label>
                <div class="layui-input-block">
                    <div id="flySpeed" class="flySpeed"></div>
                </div>
            </div>
            <div class="layui-form-item norline">
                <label class="layui-form-label">总长度</label>
                <div class="layui-input-block" id="totalLen" style="line-height: 38px;">
                </div>
            </div>
            <div class="layui-form-item norline">
                <label class="layui-form-label">已漫游长度</label>
                <div class="layui-input-block" id="distanceTraveled" style="line-height: 38px;">
                    0
                </div>
            </div>
            <div class="layui-form-item norline">
                <label class="layui-form-label">总时长</label>
                <div class="layui-input-block" id="totalTime" style="line-height: 38px;">
                </div>
            </div>
            <div class="layui-form-item norline">
                <label class="layui-form-label">已漫游时间</label>
                <div class="layui-input-block" id="time" style="line-height: 38px;">
                    0
                </div>
            </div>
            <div class="layui-form-item norline">
                <label class="layui-form-label">是否显示模型</label>
                <div class="layui-input-block">
                    <input id="showModel" type="checkbox" lay-skin="switch" lay-filter="showModel" value="off"
                        lay-text="是|否">
                </div>
            </div>
            <div class="layui-form-item norline">
                <label class="layui-form-label">是否显示路线</label>
                <div class="layui-input-block">
                    <input id="showLine" type="checkbox" lay-skin="switch" lay-filter="showLine" value="off"
                        lay-text="是|否">
                </div>
            </div>
            <div class="layui-form-item norline">
                <label class="layui-form-label">速度</label>
                <div class="layui-input-block" id="sd" style="line-height: 38px;">
                    50m/s
                </div>
            </div>
            <div class="layui-form-item norline">
                <label class="layui-form-label">经度</label>
                <div class="layui-input-block" id="jd" style="line-height: 38px;">
                </div>
            </div>
            <div class="layui-form-item norline">
                <label class="layui-form-label">纬度</label>
                <div class="layui-input-block" id="wd" style="line-height: 38px;">
                </div>
            </div>
            <div class="layui-form-item norline">
                <label class="layui-form-label">漫游高程</label>
                <div class="layui-input-block" id="height" style="line-height: 38px;">
                </div>
            </div>
            <div class="layui-form-item norline">
                <label class="layui-form-label">地面高程</label>
                <div class="layui-input-block" id="globeHeight" style="line-height: 38px;">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-progress layui-progress-big" lay-showpercent="true" lay-filter="ratio">
                    <div class="layui-progress-bar layui-bg-red" lay-percent="0%"></div>
                </div>
            </div>
        </form>
  <div class="layui-prop">
    <div class="bnt-box">
      <button type="button" class="layui-btn layui-btn-normal" id="start">继续漫游</button>
      <button type="button" class="layui-btn layui-btn-normal" id="stop" style="margin-left: 0;">暂停漫游</button>
      <button type="button" class="layui-btn layui-btn-normal" id="exit">退出漫游</button>
    </div>
    <script src="../jquery-2.0.3.js"></script>
    <script src="../layui/layui.js"></script>
    <form class="layui-form" action="">
      <div class="layui-form-item">
        <label class="layui-form-label">路线名称</label>
        <div class="layui-input-block" id="roadName" style="line-height: 38px;">
    <script>
        /// <reference path="sjcs.js" />
        var fly = null;
        var sgworld = parent.sgworld;
        var routeData = parent.PathAnimationData.flyData;
        var url = parent.SmartEarthRootUrl + "Workers/Model/xiaoche.glb";
        $('#start').hide();
        $('#stop').show();
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label">视角模式</label>
        <div class="layui-input-block">
          <select id="sjms" name="sjms" lay-filter="sjms">
            <option value="0">跟随模型</option>
            <option value="1">第一人称视角</option>
            <option value="2">上帝视角</option>
          </select>
        </div>
      </div>
      <div class="layui-form-item norline fly">
        <label class="layui-form-label">飞行高度</label>
        <div class="layui-input-block">
          <input id="cameraHeight" type="text" value="0" name="cameraHeight" lay-filter="cameraHeight"
            class="layui-input" onkeyup="value=value.replace(/[^\d\.\-]/g,'')">
        </div>
      </div>
      <div class="layui-form-item norline fly notGod">
        <label class="layui-form-label">飞行距离</label>
        <div class="layui-input-block">
          <input id="cameraDistance" type="text" value="0" name="cameraDistance" lay-filter="cameraDistance"
            class="layui-input" onkeyup="value=value.replace(/[^\d\.\-]/g,'')">
        </div>
      </div>
      <div class="layui-form-item norline fly notGod">
        <label class="layui-form-label">俯仰角</label>
        <div class="layui-input-block">
          <input id="pitch" type="text" value="0" name="pitch" lay-filter="pitch" class="layui-input"
            onkeyup="value=value.replace(/[^\d\.\-]/g,'')">
        </div>
      </div>
      <div class="layui-form-item norline">
        <label class="layui-form-label">漫游速度(m/s)</label>
        <div class="layui-input-block">
          <div id="flySpeed" class="flySpeed"></div>
        </div>
      </div>
      <div class="layui-form-item norline">
        <label class="layui-form-label">总长度</label>
        <div class="layui-input-block" id="totalLen" style="line-height: 38px;">
        </div>
      </div>
      <div class="layui-form-item norline">
        <label class="layui-form-label">已漫游长度</label>
        <div class="layui-input-block" id="distanceTraveled" style="line-height: 38px;">
          0
        </div>
      </div>
      <div class="layui-form-item norline">
        <label class="layui-form-label">总时长</label>
        <div class="layui-input-block" id="totalTime" style="line-height: 38px;">
        </div>
      </div>
      <div class="layui-form-item norline">
        <label class="layui-form-label">已漫游时间</label>
        <div class="layui-input-block" id="time" style="line-height: 38px;">
          0
        </div>
      </div>
      <div class="layui-form-item norline">
        <label class="layui-form-label">是否显示模型</label>
        <div class="layui-input-block">
          <input id="showModel" type="checkbox" lay-skin="switch" lay-filter="showModel" value="off" lay-text="是|否">
        </div>
      </div>
      <div class="layui-form-item norline">
        <label class="layui-form-label">是否显示路线</label>
        <div class="layui-input-block">
          <input id="showLine" type="checkbox" lay-skin="switch" lay-filter="showLine" value="off" lay-text="是|否">
        </div>
      </div>
      <div class="layui-form-item norline">
        <label class="layui-form-label">速度</label>
        <div class="layui-input-block" id="sd" style="line-height: 38px;">
          50m/s
        </div>
      </div>
      <div class="layui-form-item norline">
        <label class="layui-form-label">经度</label>
        <div class="layui-input-block" id="jd" style="line-height: 38px;">
        </div>
      </div>
        var form, element, slider;
        var ratio = 0;
        layui.use(['form', 'element', 'slider'], function () {
            form = layui.form;
            element = layui.element;
            slider = layui.slider;
      <div class="layui-form-item norline">
        <label class="layui-form-label">纬度</label>
        <div class="layui-input-block" id="wd" style="line-height: 38px;">
        </div>
      </div>
            if (routeData.distance) {
                document.getElementById("totalLen").innerText = getDistance(routeData.distance);
            }
            if (routeData.Totaltime) {
                document.getElementById("totalTime").innerText = getTime(routeData.Totaltime);
            }
            if (routeData.range) {
                document.getElementById("cameraDistance").value = routeData.range;
            }
            if (routeData.height) {
                document.getElementById("cameraHeight").value = routeData.height;
            }
            if (routeData.pitch) {
                document.getElementById("pitch").value = routeData.pitch;
            }
            document.getElementById("roadName").innerText = routeData.name;
      <div class="layui-form-item norline">
        <label class="layui-form-label">漫游高程</label>
        <div class="layui-input-block" id="height" style="line-height: 38px;">
        </div>
      </div>
      <div class="layui-form-item norline">
        <label class="layui-form-label">地面高程</label>
        <div class="layui-input-block" id="globeHeight" style="line-height: 38px;">
        </div>
      </div>
      <div class="layui-form-item">
        <div class="layui-progress layui-progress-big" lay-showpercent="true" lay-filter="ratio">
          <div class="layui-progress-bar layui-bg-red" lay-percent="0%"></div>
        </div>
      </div>
    </form>
  </div>
  <script src="../jquery-2.0.3.js"></script>
  <script src="../layui/layui.js"></script>
  <script>
    /// <reference path="sjcs.js" />
    var fly = null;
    var sgworld = parent.sgworld;
    var routeData = parent.PathAnimationData.flyData;
    var url = parent.SmartEarthRootUrl + "Workers/Model/xiaoche.glb";
    $('#start').hide();
    $('#stop').show();
    var form, element, slider;
    var ratio = 0;
    layui.use(['form', 'element', 'slider'], function() {
      form = layui.form;
      element = layui.element;
      slider = layui.slider;
            fly = sgworld.Creator.createDynamicObject(routeData, url, shuj);
            parent.PathAnimationData.fly = fly
            fly && fly.changeFlyMode(0);
            routeData && (routeData.mode = 0);
            $('.fly').hide();
            if (routeData.mode) {
                // $('#sjms option[value="' + routeData.mode + '"]').attr('selected', '');
                // form.render();
                // switch (routeData.mode) {
                //     case 1:
                //         $('.fly').show();
                //         break;
                //     case 2:
                //         $('.fly').show();
                //         $('.notGod').hide();
                //         break;
                // }
      if (routeData.distance) {
        document.getElementById("totalLen").innerText = getDistance(routeData.distance);
      }
      if (routeData.Totaltime) {
        document.getElementById("totalTime").innerText = getTime(routeData.Totaltime);
      }
      if (routeData.range) {
        document.getElementById("cameraDistance").value = routeData.range;
      }
      if (routeData.height) {
        document.getElementById("cameraHeight").value = routeData.height;
      }
      if (routeData.pitch) {
        document.getElementById("pitch").value = routeData.pitch;
      }
      document.getElementById("roadName").innerText = routeData.name;
            }
            form.on('select(sjms)', function (data) {
                if (data.value === "0") {
                    fly && fly.changeFlyMode(0);
                    routeData && (routeData.mode = 0);
                    $('.fly').hide();
                } else if (data.value === "1") {
                    fly && fly.changeFlyMode(1);
                    routeData && (routeData.mode = 1);
                    $('.fly').show();
                } else if (data.value === "2") {
                    fly && fly.changeFlyMode(2);
                    routeData && (routeData.mode = 2);
                    $('.fly').show();
                    $('.notGod').hide();
                }
            });
      fly = sgworld.Creator.createDynamicObject(routeData, url, shuj);
      parent.PathAnimationData.fly = fly
            slider.render({
                elem: '#flySpeed',
                theme: '#1E9FFF', //主题色
                min: 1,
                max: 500,
                value: 50,
                change: function (value) {
                    let speed = value / 50.5;
                    fly && fly.setSpeed(speed);
                    routeData && (routeData.speed = speed);
                    document.getElementById("sd").innerText = value + 'm/s';
                }
            });
            $('#cameraDistance').on('input propertychange', function (event) {
                var distance = $(this).val().replace(/[^\d\.\-]/g, '');
                fly && fly.setFlyDistance(parseFloat(distance));
                routeData && (routeData.range = parseFloat(distance));
            });
            $('#cameraHeight').on('input propertychange', function (event) {
                var height = $(this).val().replace(/[^\d\.\-]/g, '');
                fly && fly.setFlyHeight(parseFloat(height));
                routeData && (routeData.height = parseFloat(height));
            });
            $('#pitch').on('input propertychange', function (event) {
                var pitch = $(this).val().replace(/[^\d\.\-]/g, '');
                fly && fly.setFlyPitch(parseFloat(pitch));
                routeData && (routeData.pitch = parseFloat(pitch));
            });
            if (routeData.showModel) {
                $('#showModel').next().click();
                $('#showModel').attr('value', 'on');
            }
            form.on('switch(showModel)', function (data) {
                fly && fly.showModel(this.checked);
                routeData && (routeData.showModel = this.checked);
            });
            if (routeData.showLine) {
                $('#showLine').next().click();
                $('#showLine').attr('value', 'on');
            }
            form.on('switch(showLine)', function (data) {
                fly && fly.showLine(this.checked);
                routeData && (routeData.showLine = this.checked);
            });
            //进度条
            setInterval(function () {
                element.progress('ratio', ratio + '%');
            }, 500);
        });
        //按钮事件
        $(".bnt-box button").click(function () {
            var id = this.id;
            switch (id) {
                case 'start':
                    fly && fly.isPause(false);
                    $('#start').hide();
                    $('#stop').show();
                    break;
                case 'stop':
                    fly && fly.isPause(true);
                    $('#start').show();
                    $('#stop').hide();
                    break;
                case 'exit':
                    parent.layer.close(parent.PathAnimationData.winIndex)
                    break;
            }
        });
        function shuj(data) {
            if (data.distanceTraveled) {
                //已漫游长度
                document.getElementById("distanceTraveled").innerText = getDistance(data.distanceTraveled);
            }
            if (data.time) {
                //已漫游时间
                document.getElementById("time").innerText = getTime(parseInt(data.time));
            }
            if (data.longitude) {
                //经度
                document.getElementById("jd").innerText = data.longitude.toFixed(7) + '°';
            }
            if (data.latitude) {
                //纬度
                document.getElementById("wd").innerText = data.latitude.toFixed(7) + '°';
            }
            // if (data.speed) {
            //     //速度
            //     document.getElementById("sd").innerText = data.speed;
            // }
            if (data.height) {
                //速度
                document.getElementById("height").innerText = getDistance(data.height);
            }
            if (data.globeHeight) {
                //速度
                document.getElementById("globeHeight").innerText = getDistance(data.globeHeight);
            }
            if (data.ratio) {
                ratio = parseInt(data.ratio * 100);
            }
      if (routeData.mode) {
        $('#sjms option[value="' + routeData.mode + '"]').attr('selected', '');
        form.render();
        switch (routeData.mode) {
          case 1:
            $('.fly').show();
            break;
          case 2:
            $('.fly').show();
            $('.notGod').hide();
            break;
        }
        //自动点击关闭窗口点关闭事件
        function closeLayer() {
            var $title = $(window.parent.document).find('.layui-layer-title');
            if ($title.length > 0) {
                $title.each(function (i, item) {
                    if (item.innerHTML === "漫游路线") {
                        var closeButton = $(item).parent().find('.layui-layer-close');
                        var event = document.createEvent('MouseEvents');
                        event.initEvent("click", false, true);
                        closeButton[0].dispatchEvent(event);
                    }
                })
            }
      }
      form.on('select(sjms)', function(data) {
        if (data.value === "0") {
          fly && fly.changeFlyMode(0);
          routeData && (routeData.mode = 0);
          $('.fly').hide();
        } else if (data.value === "1") {
          fly && fly.changeFlyMode(1);
          routeData && (routeData.mode = 1);
          $('.fly').show();
        } else if (data.value === "2") {
          fly && fly.changeFlyMode(2);
          routeData && (routeData.mode = 2);
          $('.fly').show();
          $('.notGod').hide();
        }
      });
        function getTime(data) {
            var time;
            if (data < 60) {
                time = data + "秒";
            } else if (data >= 60 && data < 3600) {
                time = Math.floor(data / 60) + '分' + data % 60 + '秒';
            } else {
                var h = Math.floor(data / 3600);
                data -= h * 3600;
                var m = Math.floor(data / 60);
                data -= m * 60;
                time = h + '小时' + m + '分' + data + '秒';
            }
            return time;
      slider.render({
        elem: '#flySpeed',
        theme: '#1E9FFF', //主题色
        min: 1,
        max: 500,
        value: 50,
        change: function(value) {
          let speed = value / 50.5;
          fly && fly.setMultiplier(speed);
          routeData && (routeData.speed = speed);
          document.getElementById("sd").innerText = value + 'm/s';
        }
      });
        function getDistance(data) {
            var dis;
            data = parseFloat(data).toFixed(2);
            data = parseFloat(data);
            if (data >= 1000) {
                dis = (data / 1000).toFixed(3) + "千米";
            } else {
                dis = data + "米";
            }
            return dis;
        }
    </script>
      $('#cameraDistance').on('input propertychange', function(event) {
        var distance = $(this).val().replace(/[^\d\.\-]/g, '');
        fly && fly.setFlyDistance(parseFloat(distance));
        routeData && (routeData.range = parseFloat(distance));
      });
      $('#cameraHeight').on('input propertychange', function(event) {
        var height = $(this).val().replace(/[^\d\.\-]/g, '');
        fly && fly.setFlyHeight(parseFloat(height));
        routeData && (routeData.height = parseFloat(height));
      });
      $('#pitch').on('input propertychange', function(event) {
        var pitch = $(this).val().replace(/[^\d\.\-]/g, '');
        fly && fly.setFlyPitch(parseFloat(pitch));
        routeData && (routeData.pitch = parseFloat(pitch));
      });
      if (routeData.showModel) {
        $('#showModel').next().click();
        $('#showModel').attr('value', 'on');
      }
      form.on('switch(showModel)', function(data) {
        fly && fly.showModel(this.checked);
        routeData && (routeData.showModel = this.checked);
      });
      if (routeData.showLine) {
        $('#showLine').next().click();
        $('#showLine').attr('value', 'on');
      }
      form.on('switch(showLine)', function(data) {
        fly && fly.showLine(this.checked);
        routeData && (routeData.showLine = this.checked);
      });
      //进度条
      setInterval(function() {
        element.progress('ratio', ratio + '%');
      }, 500);
    });
    //按钮事件
    $(".bnt-box button").click(function() {
      var id = this.id;
      switch (id) {
        case 'start':
          fly && fly.isPause(false);
          $('#start').hide();
          $('#stop').show();
          break;
        case 'stop':
          fly && fly.isPause(true);
          $('#start').show();
          $('#stop').hide();
          break;
        case 'exit':
          parent.layer.close(parent.PathAnimationData.winIndex)
          break;
      }
    });
    function shuj (data) {
      if (data.distanceTraveled) {
        //已漫游长度
        document.getElementById("distanceTraveled").innerText = getDistance(data.distanceTraveled);
      }
      if (data.time) {
        //已漫游时间
        document.getElementById("time").innerText = getTime(parseInt(data.time));
      }
      if (data.longitude) {
        //经度
        document.getElementById("jd").innerText = data.longitude.toFixed(7) + '°';
      }
      if (data.latitude) {
        //纬度
        document.getElementById("wd").innerText = data.latitude.toFixed(7) + '°';
      }
      // if (data.speed) {
      //     //速度
      //     document.getElementById("sd").innerText = data.speed;
      // }
      if (data.height) {
        //速度
        document.getElementById("height").innerText = getDistance(data.height);
      }
      if (data.globeHeight) {
        //速度
        document.getElementById("globeHeight").innerText = getDistance(data.globeHeight);
      }
      if (data.ratio) {
        ratio = parseInt(data.ratio * 100);
      }
    }
    //自动点击关闭窗口点关闭事件
    function closeLayer () {
      var $title = $(window.parent.document).find('.layui-layer-title');
      if ($title.length > 0) {
        $title.each(function(i, item) {
          if (item.innerHTML === "漫游路线") {
            var closeButton = $(item).parent().find('.layui-layer-close');
            var event = document.createEvent('MouseEvents');
            event.initEvent("click", false, true);
            closeButton[0].dispatchEvent(event);
          }
        })
      }
    }
    function getTime (data) {
      var time;
      if (data < 60) {
        time = data + "秒";
      } else if (data >= 60 && data < 3600) {
        time = Math.floor(data / 60) + '分' + data % 60 + '秒';
      } else {
        var h = Math.floor(data / 3600);
        data -= h * 3600;
        var m = Math.floor(data / 60);
        data -= m * 60;
        time = h + '小时' + m + '分' + data + '秒';
      }
      return time;
    }
    function getDistance (data) {
      var dis;
      data = parseFloat(data).toFixed(2);
      data = parseFloat(data);
      if (data >= 1000) {
        dis = (data / 1000).toFixed(3) + "千米";
      } else {
        dis = data + "米";
      }
      return dis;
    }
  </script>
</body>
</html>
public/SmartEarthSDK/Workers/path/Path.html
@@ -1,466 +1,459 @@
<!DOCTYPE html>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport"
        content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
    <title>SmartEarth-SDK示例</title>
    <link rel="stylesheet" href="../layui/css/layui.css">
    <style>
        html,
        body,
        .layui-prop {
            background-color: rgba(0, 0, 0, 0);
            height: 100%;
            color: #fff;
            overflow-y: auto;
            overflow-x: hidden;
        }
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta name="viewport"
    content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
  <title>SmartEarth-SDK示例</title>
  <link rel="stylesheet" href="../layui/css/layui.css">
  <style>
    html,
    body,
    .layui-prop {
      background-color: rgba(0, 0, 0, 0);
      height: 100%;
      color: #fff;
      overflow-y: auto;
      overflow-x: hidden;
    }
        .layui-prop::-webkit-scrollbar {
            /*滚动条整体样式*/
            width: 8px;
            /*高宽分别对应横竖滚动条的尺寸*/
            height: 8px;
            scrollbar-arrow-color: red;
        }
    .layui-prop::-webkit-scrollbar {
      /*滚动条整体样式*/
      width: 8px;
      /*高宽分别对应横竖滚动条的尺寸*/
      height: 8px;
      scrollbar-arrow-color: red;
    }
        .layui-prop::-webkit-scrollbar-thumb {
            border-radius: 5px;
            -webkit-box-shadow: inset 0 0 5px rgba(218, 218, 218, 0.2);
            box-shadow: inset 0 0 5px rgba(218, 218, 218, 0.2);
            background: rgba(218, 218, 218, 0.5);
            scrollbar-arrow-color: red;
        }
    .layui-prop::-webkit-scrollbar-thumb {
      border-radius: 5px;
      -webkit-box-shadow: inset 0 0 5px rgba(218, 218, 218, 0.2);
      box-shadow: inset 0 0 5px rgba(218, 218, 218, 0.2);
      background: rgba(218, 218, 218, 0.5);
      scrollbar-arrow-color: red;
    }
        .layui-prop::-webkit-scrollbar-track {
            -webkit-box-shadow: inset 0 0 5px rgba(218, 218, 218, 0.2);
            box-shadow: inset 0 0 5px rgba(218, 218, 218, 0.2);
            border-radius: 0;
            background: rgba(218, 218, 218, 0.1);
        }
    .layui-prop::-webkit-scrollbar-track {
      -webkit-box-shadow: inset 0 0 5px rgba(218, 218, 218, 0.2);
      box-shadow: inset 0 0 5px rgba(218, 218, 218, 0.2);
      border-radius: 0;
      background: rgba(218, 218, 218, 0.1);
    }
        form {
            width: 95%;
        }
    form {
      width: 95%;
    }
        html {
            overflow: hidden;
        }
    html {
      overflow: hidden;
    }
        .layui-form-item {
            width: 313px !important;
        }
    .layui-form-item {
      width: 313px !important;
    }
        .layui-input {
            background-color: #fff !important;
            height: 30px;
            margin-top: 5px;
        }
    .layui-input {
      background-color: #fff !important;
      height: 30px;
      margin-top: 5px;
    }
        .layui-form-label {
            width: 96px !important;
        }
    .layui-form-label {
      width: 96px !important;
    }
        .layui-input-block {
            width: 150px !important;
            margin-left: 150px !important;
        }
    .layui-input-block {
      width: 150px !important;
      margin-left: 150px !important;
    }
        .layui-prop {
            margin-left: 10px;
        }
    .layui-prop {
      margin-left: 10px;
    }
        .layui-form-item .line {
            display: block;
        }
    .layui-form-item .line {
      display: block;
    }
        .layui-input-block {
            margin-left: 0;
        }
    .layui-input-block {
      margin-left: 0;
    }
        .layui-form-item {
            border: 1px solid;
            margin-bottom: 0px !important;
            border-bottom: none;
        }
    .layui-form-item {
      border: 1px solid;
      margin-bottom: 0px !important;
      border-bottom: none;
    }
        .layui-input {
            background-color: rgba(0, 0, 0, 0) !important;
            margin-top: 5px;
            color: #fff;
        }
    .layui-input {
      background-color: rgba(0, 0, 0, 0) !important;
      margin-top: 5px;
      color: #fff;
    }
        .layui-form-select dl {
            background-color: rgba(0, 0, 0, 0.5) !important;
        }
    .layui-form-select dl {
      background-color: rgba(0, 0, 0, 0.5) !important;
    }
        .layui-form-select dl dd:hover {
            background-color: #f2f2f250;
        }
    .layui-form-select dl dd:hover {
      background-color: #f2f2f250;
    }
        .bnt-box {
            text-align: center;
            height: 58px;
        }
    .bnt-box {
      text-align: center;
      height: 58px;
    }
        .bnt-box button {
            margin-top: 10px;
        }
    .bnt-box button {
      margin-top: 10px;
    }
        .fly {
            display: none;
        }
    .fly {
      display: none;
    }
        #flySpeed {
            padding: 19px 0;
        }
    </style>
    #flySpeed {
      padding: 19px 0;
    }
  </style>
</head>
<body>
    <div class="layui-prop">
        <div class="bnt-box">
            <button type="button" class="layui-btn layui-btn-normal" id="start">继续漫游</button>
            <button type="button" class="layui-btn layui-btn-normal" id="stop" style="margin-left: 0;">暂停漫游</button>
            <button type="button" class="layui-btn layui-btn-normal" id="exit">退出漫游</button>
        </div>
        <form class="layui-form" action="">
            <div class="layui-form-item">
                <label class="layui-form-label">路线名称</label>
                <div class="layui-input-block" id="roadName" style="line-height: 38px;">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">视角模式</label>
                <div class="layui-input-block">
                    <select id="sjms" name="sjms" lay-filter="sjms">
                        <option value="0">跟随模型</option>
                        <!-- <option value="1">第一人称视角</option>
                        <option value="2">上帝视角</option> -->
                    </select>
                </div>
            </div>
            <div class="layui-form-item norline fly">
                <label class="layui-form-label">飞行高度</label>
                <div class="layui-input-block">
                    <input id="cameraHeight" type="text" value="0" name="cameraHeight" lay-filter="cameraHeight"
                        class="layui-input" onkeyup="value=value.replace(/[^\d\.\-]/g,'')">
                </div>
            </div>
            <div class="layui-form-item norline fly notGod">
                <label class="layui-form-label">飞行距离</label>
                <div class="layui-input-block">
                    <input id="cameraDistance" type="text" value="0" name="cameraDistance" lay-filter="cameraDistance"
                        class="layui-input" onkeyup="value=value.replace(/[^\d\.\-]/g,'')">
                </div>
            </div>
            <div class="layui-form-item norline fly notGod">
                <label class="layui-form-label">俯仰角</label>
                <div class="layui-input-block">
                    <input id="pitch" type="text" value="0" name="pitch" lay-filter="pitch" class="layui-input"
                        onkeyup="value=value.replace(/[^\d\.\-]/g,'')">
                </div>
            </div>
            <div class="layui-form-item norline">
                <label class="layui-form-label">漫游速度(m/s)</label>
                <div class="layui-input-block">
                    <div id="flySpeed" class="flySpeed"></div>
                </div>
            </div>
            <div class="layui-form-item norline">
                <label class="layui-form-label">总长度</label>
                <div class="layui-input-block" id="totalLen" style="line-height: 38px;">
                </div>
            </div>
            <div class="layui-form-item norline">
                <label class="layui-form-label">已漫游长度</label>
                <div class="layui-input-block" id="distanceTraveled" style="line-height: 38px;">
                    0
                </div>
            </div>
            <div class="layui-form-item norline">
                <label class="layui-form-label">总时长</label>
                <div class="layui-input-block" id="totalTime" style="line-height: 38px;">
                </div>
            </div>
            <div class="layui-form-item norline">
                <label class="layui-form-label">已漫游时间</label>
                <div class="layui-input-block" id="time" style="line-height: 38px;">
                    0
                </div>
            </div>
            <div class="layui-form-item norline">
                <label class="layui-form-label">是否显示模型</label>
                <div class="layui-input-block">
                    <input id="showModel" type="checkbox" lay-skin="switch" lay-filter="showModel" value="off"
                        lay-text="是|否">
                </div>
            </div>
            <div class="layui-form-item norline">
                <label class="layui-form-label">是否显示路线</label>
                <div class="layui-input-block">
                    <input id="showLine" type="checkbox" lay-skin="switch" lay-filter="showLine" value="off"
                        lay-text="是|否">
                </div>
            </div>
            <div class="layui-form-item norline">
                <label class="layui-form-label">速度</label>
                <div class="layui-input-block" id="sd" style="line-height: 38px;">
                    50m/s
                </div>
            </div>
            <div class="layui-form-item norline">
                <label class="layui-form-label">经度</label>
                <div class="layui-input-block" id="jd" style="line-height: 38px;">
                </div>
            </div>
            <div class="layui-form-item norline">
                <label class="layui-form-label">纬度</label>
                <div class="layui-input-block" id="wd" style="line-height: 38px;">
                </div>
            </div>
            <div class="layui-form-item norline">
                <label class="layui-form-label">漫游高程</label>
                <div class="layui-input-block" id="height" style="line-height: 38px;">
                </div>
            </div>
            <div class="layui-form-item norline">
                <label class="layui-form-label">地面高程</label>
                <div class="layui-input-block" id="globeHeight" style="line-height: 38px;">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-progress layui-progress-big" lay-showpercent="true" lay-filter="ratio">
                    <div class="layui-progress-bar layui-bg-red" lay-percent="0%"></div>
                </div>
            </div>
        </form>
  <div class="layui-prop">
    <div class="bnt-box">
      <button type="button" class="layui-btn layui-btn-normal" id="start">继续漫游</button>
      <button type="button" class="layui-btn layui-btn-normal" id="stop" style="margin-left: 0;">暂停漫游</button>
      <button type="button" class="layui-btn layui-btn-normal" id="exit">退出漫游</button>
    </div>
    <script src="../jquery-2.0.3.js"></script>
    <script src="../layui/layui.js"></script>
    <form class="layui-form" action="">
      <div class="layui-form-item">
        <label class="layui-form-label">路线名称</label>
        <div class="layui-input-block" id="roadName" style="line-height: 38px;">
    <script>
        /// <reference path="sjcs.js" />
        var fly = null;
        var sgworld = parent.sgworld;
        var routeData = parent.PathAnimationData.flyData;
        var url = parent.SmartEarthRootUrl + "Workers/Model/xiaoche.glb";
        $('#start').hide();
        $('#stop').show();
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label">视角模式</label>
        <div class="layui-input-block">
          <select id="sjms" name="sjms" lay-filter="sjms">
            <option value="0">跟随模型</option>
            <option value="1">第一人称视角</option>
            <option value="2">上帝视角</option>
          </select>
        </div>
      </div>
      <div class="layui-form-item norline fly">
        <label class="layui-form-label">飞行高度</label>
        <div class="layui-input-block">
          <input id="cameraHeight" type="text" value="0" name="cameraHeight" lay-filter="cameraHeight"
            class="layui-input" onkeyup="value=value.replace(/[^\d\.\-]/g,'')">
        </div>
      </div>
      <div class="layui-form-item norline fly notGod">
        <label class="layui-form-label">飞行距离</label>
        <div class="layui-input-block">
          <input id="cameraDistance" type="text" value="0" name="cameraDistance" lay-filter="cameraDistance"
            class="layui-input" onkeyup="value=value.replace(/[^\d\.\-]/g,'')">
        </div>
      </div>
      <div class="layui-form-item norline fly notGod">
        <label class="layui-form-label">俯仰角</label>
        <div class="layui-input-block">
          <input id="pitch" type="text" value="0" name="pitch" lay-filter="pitch" class="layui-input"
            onkeyup="value=value.replace(/[^\d\.\-]/g,'')">
        </div>
      </div>
      <div class="layui-form-item norline">
        <label class="layui-form-label">漫游速度(m/s)</label>
        <div class="layui-input-block">
          <div id="flySpeed" class="flySpeed"></div>
        </div>
      </div>
      <div class="layui-form-item norline">
        <label class="layui-form-label">总长度</label>
        <div class="layui-input-block" id="totalLen" style="line-height: 38px;">
        </div>
      </div>
      <div class="layui-form-item norline">
        <label class="layui-form-label">已漫游长度</label>
        <div class="layui-input-block" id="distanceTraveled" style="line-height: 38px;">
          0
        </div>
      </div>
      <div class="layui-form-item norline">
        <label class="layui-form-label">总时长</label>
        <div class="layui-input-block" id="totalTime" style="line-height: 38px;">
        </div>
      </div>
      <div class="layui-form-item norline">
        <label class="layui-form-label">已漫游时间</label>
        <div class="layui-input-block" id="time" style="line-height: 38px;">
          0
        </div>
      </div>
      <div class="layui-form-item norline">
        <label class="layui-form-label">是否显示模型</label>
        <div class="layui-input-block">
          <input id="showModel" type="checkbox" lay-skin="switch" lay-filter="showModel" value="off" lay-text="是|否">
        </div>
      </div>
      <div class="layui-form-item norline">
        <label class="layui-form-label">是否显示路线</label>
        <div class="layui-input-block">
          <input id="showLine" type="checkbox" lay-skin="switch" lay-filter="showLine" value="off" lay-text="是|否">
        </div>
      </div>
      <div class="layui-form-item norline">
        <label class="layui-form-label">速度</label>
        <div class="layui-input-block" id="sd" style="line-height: 38px;">
          50m/s
        </div>
      </div>
      <div class="layui-form-item norline">
        <label class="layui-form-label">经度</label>
        <div class="layui-input-block" id="jd" style="line-height: 38px;">
        </div>
      </div>
        var form, element, slider;
        var ratio = 0;
        layui.use(['form', 'element', 'slider'], function () {
            form = layui.form;
            element = layui.element;
            slider = layui.slider;
      <div class="layui-form-item norline">
        <label class="layui-form-label">纬度</label>
        <div class="layui-input-block" id="wd" style="line-height: 38px;">
        </div>
      </div>
            if (routeData.distance) {
                document.getElementById("totalLen").innerText = getDistance(routeData.distance);
            }
            if (routeData.Totaltime) {
                document.getElementById("totalTime").innerText = getTime(routeData.Totaltime);
            }
            if (routeData.range) {
                document.getElementById("cameraDistance").value = routeData.range;
            }
            if (routeData.height) {
                document.getElementById("cameraHeight").value = routeData.height;
            }
            if (routeData.pitch) {
                document.getElementById("pitch").value = routeData.pitch;
            }
            document.getElementById("roadName").innerText = routeData.name;
      <div class="layui-form-item norline">
        <label class="layui-form-label">漫游高程</label>
        <div class="layui-input-block" id="height" style="line-height: 38px;">
        </div>
      </div>
      <div class="layui-form-item norline">
        <label class="layui-form-label">地面高程</label>
        <div class="layui-input-block" id="globeHeight" style="line-height: 38px;">
        </div>
      </div>
      <div class="layui-form-item">
        <div class="layui-progress layui-progress-big" lay-showpercent="true" lay-filter="ratio">
          <div class="layui-progress-bar layui-bg-red" lay-percent="0%"></div>
        </div>
      </div>
    </form>
  </div>
  <script src="../jquery-2.0.3.js"></script>
  <script src="../layui/layui.js"></script>
  <script>
    /// <reference path="sjcs.js" />
    var fly = null;
    var sgworld = parent.sgworld;
    var routeData = parent.PathAnimationData.flyData;
    var url = parent.SmartEarthRootUrl + "Workers/Model/xiaoche.glb";
    $('#start').hide();
    $('#stop').show();
    var form, element, slider;
    var ratio = 0;
    layui.use(['form', 'element', 'slider'], function() {
      form = layui.form;
      element = layui.element;
      slider = layui.slider;
            fly = sgworld.Creator.createDynamicObject(routeData, url, shuj);
            parent.PathAnimationData.fly = fly
            fly && fly.changeFlyMode(0);
            routeData && (routeData.mode = 0);
            $('.fly').hide();
            if (routeData.mode) {
                // $('#sjms option[value="' + routeData.mode + '"]').attr('selected', '');
                // form.render();
                // switch (routeData.mode) {
                //     case 1:
                //         $('.fly').show();
                //         break;
                //     case 2:
                //         $('.fly').show();
                //         $('.notGod').hide();
                //         break;
                // }
      if (routeData.distance) {
        document.getElementById("totalLen").innerText = getDistance(routeData.distance);
      }
      if (routeData.Totaltime) {
        document.getElementById("totalTime").innerText = getTime(routeData.Totaltime);
      }
      if (routeData.range) {
        document.getElementById("cameraDistance").value = routeData.range;
      }
      if (routeData.height) {
        document.getElementById("cameraHeight").value = routeData.height;
      }
      if (routeData.pitch) {
        document.getElementById("pitch").value = routeData.pitch;
      }
      document.getElementById("roadName").innerText = routeData.name;
            }
            form.on('select(sjms)', function (data) {
                if (data.value === "0") {
                    fly && fly.changeFlyMode(0);
                    routeData && (routeData.mode = 0);
                    $('.fly').hide();
                } else if (data.value === "1") {
                    fly && fly.changeFlyMode(1);
                    routeData && (routeData.mode = 1);
                    $('.fly').show();
                } else if (data.value === "2") {
                    fly && fly.changeFlyMode(2);
                    routeData && (routeData.mode = 2);
                    $('.fly').show();
                    $('.notGod').hide();
                }
            });
      fly = sgworld.Creator.createDynamicObject(routeData, url, shuj);
      parent.PathAnimationData.fly = fly
            slider.render({
                elem: '#flySpeed',
                theme: '#1E9FFF', //主题色
                min: 1,
                max: 500,
                value: 50,
                change: function (value) {
                    let speed = value / 50.5;
                    fly && fly.setSpeed(speed);
                    routeData && (routeData.speed = speed);
                    document.getElementById("sd").innerText = value + 'm/s';
                }
            });
            $('#cameraDistance').on('input propertychange', function (event) {
                var distance = $(this).val().replace(/[^\d\.\-]/g, '');
                fly && fly.setFlyDistance(parseFloat(distance));
                routeData && (routeData.range = parseFloat(distance));
            });
            $('#cameraHeight').on('input propertychange', function (event) {
                var height = $(this).val().replace(/[^\d\.\-]/g, '');
                fly && fly.setFlyHeight(parseFloat(height));
                routeData && (routeData.height = parseFloat(height));
            });
            $('#pitch').on('input propertychange', function (event) {
                var pitch = $(this).val().replace(/[^\d\.\-]/g, '');
                fly && fly.setFlyPitch(parseFloat(pitch));
                routeData && (routeData.pitch = parseFloat(pitch));
            });
            if (routeData.showModel) {
                $('#showModel').next().click();
                $('#showModel').attr('value', 'on');
            }
            form.on('switch(showModel)', function (data) {
                fly && fly.showModel(this.checked);
                routeData && (routeData.showModel = this.checked);
            });
            if (routeData.showLine) {
                $('#showLine').next().click();
                $('#showLine').attr('value', 'on');
            }
            form.on('switch(showLine)', function (data) {
                fly && fly.showLine(this.checked);
                routeData && (routeData.showLine = this.checked);
            });
            //进度条
            setInterval(function () {
                element.progress('ratio', ratio + '%');
            }, 500);
        });
        //按钮事件
        $(".bnt-box button").click(function () {
            var id = this.id;
            switch (id) {
                case 'start':
                    fly && fly.isPause(false);
                    $('#start').hide();
                    $('#stop').show();
                    break;
                case 'stop':
                    fly && fly.isPause(true);
                    $('#start').show();
                    $('#stop').hide();
                    break;
                case 'exit':
                    parent.layer.close(parent.PathAnimationData.winIndex)
                    break;
            }
        });
        function shuj(data) {
            if (data.distanceTraveled) {
                //已漫游长度
                document.getElementById("distanceTraveled").innerText = getDistance(data.distanceTraveled);
            }
            if (data.time) {
                //已漫游时间
                document.getElementById("time").innerText = getTime(parseInt(data.time));
            }
            if (data.longitude) {
                //经度
                document.getElementById("jd").innerText = data.longitude.toFixed(7) + '°';
            }
            if (data.latitude) {
                //纬度
                document.getElementById("wd").innerText = data.latitude.toFixed(7) + '°';
            }
            // if (data.speed) {
            //     //速度
            //     document.getElementById("sd").innerText = data.speed;
            // }
            if (data.height) {
                //速度
                document.getElementById("height").innerText = getDistance(data.height);
            }
            if (data.globeHeight) {
                //速度
                document.getElementById("globeHeight").innerText = getDistance(data.globeHeight);
            }
            if (data.ratio) {
                ratio = parseInt(data.ratio * 100);
            }
      if (routeData.mode) {
        $('#sjms option[value="' + routeData.mode + '"]').attr('selected', '');
        form.render();
        switch (routeData.mode) {
          case 1:
            $('.fly').show();
            break;
          case 2:
            $('.fly').show();
            $('.notGod').hide();
            break;
        }
        //自动点击关闭窗口点关闭事件
        function closeLayer() {
            var $title = $(window.parent.document).find('.layui-layer-title');
            if ($title.length > 0) {
                $title.each(function (i, item) {
                    if (item.innerHTML === "漫游路线") {
                        var closeButton = $(item).parent().find('.layui-layer-close');
                        var event = document.createEvent('MouseEvents');
                        event.initEvent("click", false, true);
                        closeButton[0].dispatchEvent(event);
                    }
                })
            }
      }
      form.on('select(sjms)', function(data) {
        if (data.value === "0") {
          fly && fly.changeFlyMode(0);
          routeData && (routeData.mode = 0);
          $('.fly').hide();
        } else if (data.value === "1") {
          fly && fly.changeFlyMode(1);
          routeData && (routeData.mode = 1);
          $('.fly').show();
        } else if (data.value === "2") {
          fly && fly.changeFlyMode(2);
          routeData && (routeData.mode = 2);
          $('.fly').show();
          $('.notGod').hide();
        }
      });
        function getTime(data) {
            var time;
            if (data < 60) {
                time = data + "秒";
            } else if (data >= 60 && data < 3600) {
                time = Math.floor(data / 60) + '分' + data % 60 + '秒';
            } else {
                var h = Math.floor(data / 3600);
                data -= h * 3600;
                var m = Math.floor(data / 60);
                data -= m * 60;
                time = h + '小时' + m + '分' + data + '秒';
            }
            return time;
      slider.render({
        elem: '#flySpeed',
        theme: '#1E9FFF', //主题色
        min: 1,
        max: 500,
        value: 50,
        change: function(value) {
          let speed = value / 50.5;
          fly && fly.setMultiplier(speed);
          routeData && (routeData.speed = speed);
          document.getElementById("sd").innerText = value + 'm/s';
        }
      });
        function getDistance(data) {
            var dis;
            data = parseFloat(data).toFixed(2);
            data = parseFloat(data);
            if (data >= 1000) {
                dis = (data / 1000).toFixed(3) + "千米";
            } else {
                dis = data + "米";
            }
            return dis;
        }
    </script>
      $('#cameraDistance').on('input propertychange', function(event) {
        var distance = $(this).val().replace(/[^\d\.\-]/g, '');
        fly && fly.setFlyDistance(parseFloat(distance));
        routeData && (routeData.range = parseFloat(distance));
      });
      $('#cameraHeight').on('input propertychange', function(event) {
        var height = $(this).val().replace(/[^\d\.\-]/g, '');
        fly && fly.setFlyHeight(parseFloat(height));
        routeData && (routeData.height = parseFloat(height));
      });
      $('#pitch').on('input propertychange', function(event) {
        var pitch = $(this).val().replace(/[^\d\.\-]/g, '');
        fly && fly.setFlyPitch(parseFloat(pitch));
        routeData && (routeData.pitch = parseFloat(pitch));
      });
      if (routeData.showModel) {
        $('#showModel').next().click();
        $('#showModel').attr('value', 'on');
      }
      form.on('switch(showModel)', function(data) {
        fly && fly.showModel(this.checked);
        routeData && (routeData.showModel = this.checked);
      });
      if (routeData.showLine) {
        $('#showLine').next().click();
        $('#showLine').attr('value', 'on');
      }
      form.on('switch(showLine)', function(data) {
        fly && fly.showLine(this.checked);
        routeData && (routeData.showLine = this.checked);
      });
      //进度条
      setInterval(function() {
        element.progress('ratio', ratio + '%');
      }, 500);
    });
    //按钮事件
    $(".bnt-box button").click(function() {
      var id = this.id;
      switch (id) {
        case 'start':
          fly && fly.isPause(false);
          $('#start').hide();
          $('#stop').show();
          break;
        case 'stop':
          fly && fly.isPause(true);
          $('#start').show();
          $('#stop').hide();
          break;
        case 'exit':
          parent.layer.close(parent.PathAnimationData.winIndex)
          break;
      }
    });
    function shuj (data) {
      if (data.distanceTraveled) {
        //已漫游长度
        document.getElementById("distanceTraveled").innerText = getDistance(data.distanceTraveled);
      }
      if (data.time) {
        //已漫游时间
        document.getElementById("time").innerText = getTime(parseInt(data.time));
      }
      if (data.longitude) {
        //经度
        document.getElementById("jd").innerText = data.longitude.toFixed(7) + '°';
      }
      if (data.latitude) {
        //纬度
        document.getElementById("wd").innerText = data.latitude.toFixed(7) + '°';
      }
      // if (data.speed) {
      //     //速度
      //     document.getElementById("sd").innerText = data.speed;
      // }
      if (data.height) {
        //速度
        document.getElementById("height").innerText = getDistance(data.height);
      }
      if (data.globeHeight) {
        //速度
        document.getElementById("globeHeight").innerText = getDistance(data.globeHeight);
      }
      if (data.ratio) {
        ratio = parseInt(data.ratio * 100);
      }
    }
    //自动点击关闭窗口点关闭事件
    function closeLayer () {
      var $title = $(window.parent.document).find('.layui-layer-title');
      if ($title.length > 0) {
        $title.each(function(i, item) {
          if (item.innerHTML === "漫游路线") {
            var closeButton = $(item).parent().find('.layui-layer-close');
            var event = document.createEvent('MouseEvents');
            event.initEvent("click", false, true);
            closeButton[0].dispatchEvent(event);
          }
        })
      }
    }
    function getTime (data) {
      var time;
      if (data < 60) {
        time = data + "秒";
      } else if (data >= 60 && data < 3600) {
        time = Math.floor(data / 60) + '分' + data % 60 + '秒';
      } else {
        var h = Math.floor(data / 3600);
        data -= h * 3600;
        var m = Math.floor(data / 60);
        data -= m * 60;
        time = h + '小时' + m + '分' + data + '秒';
      }
      return time;
    }
    function getDistance (data) {
      var dis;
      data = parseFloat(data).toFixed(2);
      data = parseFloat(data);
      if (data >= 1000) {
        dis = (data / 1000).toFixed(3) + "千米";
      } else {
        dis = data + "米";
      }
      return dis;
    }
  </script>
</body>
</html>
public/WebSDK/WebSDK.min.js
@@ -1,11 +1,11 @@
/**
 *
 * SmartEarth WebSDK - https://websdk.terra-it.cn
 * Version 3.2.4-11
 * Version 3.2.4-12
 *
 **/
var SmartEarth=(()=>{var W_t=Object.create;var vX=Object.defineProperty;var j_t=Object.getOwnPropertyDescriptor;var q_t=Object.getOwnPropertyNames;var X_t=Object.getPrototypeOf,Z_t=Object.prototype.hasOwnProperty;var qy=(o=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(o,{get:(A,f)=>(typeof require<"u"?require:A)[f]}):o)(function(o){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+o+'" is not supported')});var $_t=(o,A)=>()=>(A||o((A={exports:{}}).exports,A),A.exports),lde=(o,A)=>{for(var f in A)vX(o,f,{get:A[f],enumerable:!0})},x5e=(o,A,f,m)=>{if(A&&typeof A=="object"||typeof A=="function")for(let C of q_t(A))!Z_t.call(o,C)&&C!==f&&vX(o,C,{get:()=>A[C],enumerable:!(m=j_t(A,C))||m.enumerable});return o};var D9=(o,A,f)=>(f=o!=null?W_t(X_t(o)):{},x5e(A||!o||!o.__esModule?vX(f,"default",{value:o,enumerable:!0}):f,o)),eBt=o=>x5e(vX({},"__esModule",{value:!0}),o);var Dct=$_t((Sct,Tse)=>{(function(o,A,f){typeof Tse<"u"&&Tse.exports?Tse.exports=f():typeof define=="function"&&define.amd?define(f):A[o]=f()})("h337",Sct,function(){var o={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.25:"rgb(0,0,255)",.55:"rgb(0,255,0)",.85:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}},A=function(){var E=function(Q){this._coordinator={},this._data=[],this._radi=[],this._min=10,this._max=1,this._xField=Q.xField||Q.defaultXField,this._yField=Q.yField||Q.defaultYField,this._valueField=Q.valueField||Q.defaultValueField,Q.radius&&(this._cfgRadius=Q.radius)},I=o.defaultRadius;return E.prototype={_organiseData:function(w,Q){var M=w[this._xField],B=w[this._yField],T=this._radi,D=this._data,F=this._max,L=this._min,R=w[this._valueField]||1,k=w.radius||this._cfgRadius||I;D[M]||(D[M]=[],T[M]=[]),D[M][B]?D[M][B]+=R:(D[M][B]=R,T[M][B]=k);var U=D[M][B];return U>F?(Q?this.setDataMax(U):this._max=U,!1):U<L?(Q?this.setDataMin(U):this._min=U,!1):{x:M,y:B,value:R,radius:k,min:L,max:F}},_unOrganizeData:function(){var w=[],Q=this._data,M=this._radi;for(var B in Q)for(var T in Q[B])w.push({x:B,y:T,radius:M[B][T],value:Q[B][T]});return{min:this._min,max:this._max,data:w}},_onExtremaChange:function(){this._coordinator.emit("extremachange",{min:this._min,max:this._max})},addData:function(){if(arguments[0].length>0)for(var w=arguments[0],Q=w.length;Q--;)this.addData.call(this,w[Q]);else{var M=this._organiseData(arguments[0],!0);M&&(this._data.length===0&&(this._min=this._max=M.value),this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[M]}))}return this},setData:function(w){var Q=w.data,M=Q.length;this._data=[],this._radi=[];for(var B=0;B<M;B++)this._organiseData(Q[B],!1);return this._max=w.max,this._min=w.min||0,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},removeData:function(){},setDataMax:function(w){return this._max=w,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setDataMin:function(w){return this._min=w,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setCoordinator:function(w){this._coordinator=w},_getInternalData:function(){return{max:this._max,min:this._min,data:this._data,radi:this._radi}},getData:function(){return this._unOrganizeData()}},E}(),f=function(){var E=function(M){var B=M.gradient||M.defaultGradient,T=document.createElement("canvas"),D=T.getContext("2d");T.width=256,T.height=1;var F=D.createLinearGradient(0,0,256,1);for(var L in B)F.addColorStop(L,B[L]);return D.fillStyle=F,D.fillRect(0,0,256,1),D.getImageData(0,0,256,1).data},I=function(M,B){var T=document.createElement("canvas"),D=T.getContext("2d"),F=M,L=M;if(T.width=T.height=M*2,B==1)D.beginPath(),D.arc(F,L,M,0,2*Math.PI,!1),D.fillStyle="rgba(0,0,0,1)",D.fill();else{var R=D.createRadialGradient(F,L,M*B,F,L,M);R.addColorStop(0,"rgba(0,0,0,1)"),R.addColorStop(1,"rgba(0,0,0,0)"),D.fillStyle=R,D.fillRect(0,0,2*M,2*M)}return T},w=function(L){for(var B=[],T=L.min,D=L.max,F=L.radi,L=L.data,R=Object.keys(L),k=R.length;k--;)for(var U=R[k],V=Object.keys(L[U]),H=V.length;H--;){var q=V[H],ie=L[U][q],Z=F[U][q];B.push({x:U,y:q,value:ie,radius:Z})}return{min:T,max:D,data:B}};function Q(M){var B=M.container,T=this.shadowCanvas=document.createElement("canvas"),D=this.canvas=M.canvas||document.createElement("canvas"),F=this._renderBoundaries=[1e4,1e4,0,0],L=getComputedStyle(M.container)||{};D.className="heatmap-canvas",this._width=D.width=T.width=M.width||+L.width.replace(/px/,""),this._height=D.height=T.height=M.height||+L.height.replace(/px/,""),this.shadowCtx=T.getContext("2d"),this.ctx=D.getContext("2d"),D.style.cssText=T.style.cssText="position:absolute;left:0;top:0;",B.style.position="relative",B.appendChild(D),this._palette=E(M),this._templates={},this._setStyles(M)}return Q.prototype={renderPartial:function(M){M.data.length>0&&(this._drawAlpha(M),this._colorize())},renderAll:function(M){this._clear(),M.data.length>0&&(this._drawAlpha(w(M)),this._colorize())},_updateGradient:function(M){this._palette=E(M)},updateConfig:function(M){M.gradient&&this._updateGradient(M),this._setStyles(M)},setDimensions:function(M,B){this._width=M,this._height=B,this.canvas.width=this.shadowCanvas.width=M,this.canvas.height=this.shadowCanvas.height=B},_clear:function(){this.shadowCtx.clearRect(0,0,this._width,this._height),this.ctx.clearRect(0,0,this._width,this._height)},_setStyles:function(M){this._blur=M.blur==0?0:M.blur||M.defaultBlur,M.backgroundColor&&(this.canvas.style.backgroundColor=M.backgroundColor),this._width=this.canvas.width=this.shadowCanvas.width=M.width||this._width,this._height=this.canvas.height=this.shadowCanvas.height=M.height||this._height,this._opacity=(M.opacity||0)*255,this._maxOpacity=(M.maxOpacity||M.defaultMaxOpacity)*255,this._minOpacity=(M.minOpacity||M.defaultMinOpacity)*255,this._useGradientOpacity=!!M.useGradientOpacity},_drawAlpha:function(D){for(var B=this._min=D.min,T=this._max=D.max,D=D.data||[],F=D.length,L=1-this._blur;F--;){var R=D[F],k=R.x,U=R.y,V=R.radius,H=Math.min(R.value,T),q=k-V,ie=U-V,Z=this.shadowCtx,oe;this._templates[V]?oe=this._templates[V]:this._templates[V]=oe=I(V,L);var ne=(H-B)/(T-B);Z.globalAlpha=ne<.01?.01:ne,Z.drawImage(oe,q,ie),q<this._renderBoundaries[0]&&(this._renderBoundaries[0]=q),ie<this._renderBoundaries[1]&&(this._renderBoundaries[1]=ie),q+2*V>this._renderBoundaries[2]&&(this._renderBoundaries[2]=q+2*V),ie+2*V>this._renderBoundaries[3]&&(this._renderBoundaries[3]=ie+2*V)}},_colorize:function(){var M=this._renderBoundaries[0],B=this._renderBoundaries[1],T=this._renderBoundaries[2]-M,D=this._renderBoundaries[3]-B,F=this._width,L=this._height,R=this._opacity,k=this._maxOpacity,U=this._minOpacity,V=this._useGradientOpacity;M<0&&(M=0),B<0&&(B=0),M+T>F&&(T=F-M),B+D>L&&(D=L-B);for(var H=this.shadowCtx.getImageData(M,B,T,D),q=H.data,ie=q.length,Z=this._palette,oe=3;oe<ie;oe+=4){var ne=q[oe],se=ne*4;if(!!se){var ce;R>0?ce=R:ne<k?ne<U?ce=U:ce=ne:ce=k,q[oe-3]=Z[se],q[oe-2]=Z[se+1],q[oe-1]=Z[se+2],q[oe]=V?Z[se+3]:ce}}H.data=q,this.ctx.putImageData(H,M,B),this._renderBoundaries=[1e3,1e3,0,0]},getValueAt:function(M){var B,T=this.shadowCtx,D=T.getImageData(M.x,M.y,1,1),F=D.data[3],L=this._max,R=this._min;return B=Math.abs(L-R)*(F/255)>>0,B},getDataURL:function(){return this.canvas.toDataURL()}},Q}(),m=function(){var E=!1;return o.defaultRenderer==="canvas2d"&&(E=f),E}(),C={merge:function(){for(var v={},E=arguments.length,I=0;I<E;I++){var w=arguments[I];for(var Q in w)v[Q]=w[Q]}return v}},y=function(){var E=function(){function M(){this.cStore={}}return M.prototype={on:function(B,T,D){var F=this.cStore;F[B]||(F[B]=[]),F[B].push(function(L){return T.call(D,L)})},emit:function(B,T){var D=this.cStore;if(D[B])for(var F=D[B].length,L=0;L<F;L++){var R=D[B][L];R(T)}}},M}(),I=function(Q){var M=Q._renderer,B=Q._coordinator,T=Q._store;B.on("renderpartial",M.renderPartial,M),B.on("renderall",M.renderAll,M),B.on("extremachange",function(D){Q._config.onExtremaChange&&Q._config.onExtremaChange({min:D.min,max:D.max,gradient:Q._config.gradient||Q._config.defaultGradient})}),T.setCoordinator(B)};function w(){var Q=this._config=C.merge(o,arguments[0]||{});if(this._coordinator=new E,Q.plugin){var M=Q.plugin;if(o.plugins[M]){var B=o.plugins[M];this._renderer=new B.renderer(Q),this._store=new B.store(Q)}else throw new Error("Plugin '"+M+"' not found. Maybe it was not registered.")}else this._renderer=new m(Q),this._store=new A(Q);I(this)}return w.prototype={addData:function(){return this._store.addData.apply(this._store,arguments),this},removeData:function(){return this._store.removeData&&this._store.removeData.apply(this._store,arguments),this},setData:function(){return this._store.setData.apply(this._store,arguments),this},setDataMax:function(){return this._store.setDataMax.apply(this._store,arguments),this},setDataMin:function(){return this._store.setDataMin.apply(this._store,arguments),this},configure:function(Q){return this._config=C.merge(this._config,Q),this._renderer.updateConfig(this._config),this._coordinator.emit("renderall",this._store._getInternalData()),this},repaint:function(){return this._coordinator.emit("renderall",this._store._getInternalData()),this},getData:function(){return this._store.getData()},getDataURL:function(){return this._renderer.getDataURL()},getValueAt:function(Q){return this._store.getValueAt?this._store.getValueAt(Q):this._renderer.getValueAt?this._renderer.getValueAt(Q):null}},w}(),x={create:function(v){return new y(v)},register:function(v,E){o.plugins[v]=E}};return x})});var Vki={};lde(Vki,{Analysis:()=>Nle,BaseObject:()=>c0,Billboard:()=>Rse,Box:()=>Yse,BwMode:()=>gse,Camera:()=>jae,Cesium:()=>K2e,ClusterLayer:()=>Xut,ColorAdjustment:()=>fse,Core:()=>act,Cylinder:()=>Wse,Degrees:()=>Zut,DoubleClickObjectTool:()=>nse,DoubleScreen:()=>tct,DynamicEyeOffset:()=>aPi,EarthCtrl:()=>t0t,Edit:()=>Ele,EditTool:()=>cse,ElevationTool:()=>ict,Ellipse:()=>ele,Ellipsoid:()=>qse,Environment:()=>mse,EventHandler:()=>DN,Explosion:()=>Qse,FeatureLayer:()=>cle,Fire:()=>_se,Fireworks:()=>Dse,FisheyeVideoProjection:()=>vse,Fog:()=>Ase,Hawkeye:()=>gle,HorizontalDistanceTool:()=>$ae,HoverObjectTool:()=>rse,ImageryLayer:()=>nle,Label:()=>kse,LineOfSightTool:()=>r0t,Measure:()=>sse,MeasureAreaTool:()=>OH,MeasureHeightTool:()=>Xae,MeasureLineLengthTool:()=>qae,MeasurePathLengthTool:()=>TW,MeasureSlopeTool:()=>Zae,MeasureSurfaceAreaTool:()=>ese,MilitaryPlotting:()=>oue,Model:()=>Fse,ModelClipping:()=>Tle,ModelEdit:()=>LH,ModelLayer:()=>lle,NightMode:()=>pse,Node:()=>GO,ObjectFactory:()=>T2,PerspectiveVideoProjection:()=>xse,PickObjectTool:()=>tse,PickPositionTool:()=>ise,Point:()=>zse,Polygon:()=>Hse,Polyline:()=>Use,PolylineVolume:()=>ile,Profile:()=>wle,RClickObjectTool:()=>ose,RadarScan:()=>Mse,Rain:()=>hse,Rectangle:()=>Zse,RestrictHeight:()=>Dle,SampleRenderedDataFlags:()=>oPi,Scene:()=>vle,SceneManager:()=>i0t,SelectSet:()=>yse,Skyline:()=>Qle,Smoke:()=>wse,Snow:()=>dse,SpatialObject:()=>Qc,SpatialTransform:()=>zae,SpotLight:()=>mle,Submergence:()=>Ble,TerrainExcavation:()=>Lle,TerrainLayer:()=>ale,TerrainModifier:()=>Mle,Tool:()=>ja,ToolManager:()=>Wae,VERSIONINFO:()=>_5e,VideoProjection:()=>n0t,ViewShed:()=>Ile,Volumetric:()=>_le,WFSTool:()=>qut,Waters:()=>fle,WorkChart:()=>hle,ZBiasGeometryInstanceAttribute:()=>nPi,czmlPathAnimation:()=>ITe,loadArrayBuffer:()=>dPi,loadBlob:()=>hPi,loadImage:()=>fPi,loadJson:()=>APi,loadLayui:()=>_Te,loadText:()=>cPi,sampleRenderedData:()=>sPi,sampleRenderedMesh:()=>lPi,sampleRenderedTerrain:()=>uPi,viewerNavigationCubeMixin:()=>l0t});var v5e="WebSDK v3.2.4-11",E5e="Cesium v1.99",I5e="2023.11.28",tBt="SmartEarth",iBt={VERSION:v5e,CesiumVERSION:E5e,CompileTime:I5e},rBt=typeof window<"u"?window:typeof self<"u"?self:{};rBt.logSmartEarth=()=>{let o=`
var SmartEarth=(()=>{var W_t=Object.create;var vX=Object.defineProperty;var j_t=Object.getOwnPropertyDescriptor;var q_t=Object.getOwnPropertyNames;var X_t=Object.getPrototypeOf,Z_t=Object.prototype.hasOwnProperty;var qy=(o=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(o,{get:(A,f)=>(typeof require<"u"?require:A)[f]}):o)(function(o){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+o+'" is not supported')});var $_t=(o,A)=>()=>(A||o((A={exports:{}}).exports,A),A.exports),lde=(o,A)=>{for(var f in A)vX(o,f,{get:A[f],enumerable:!0})},x5e=(o,A,f,m)=>{if(A&&typeof A=="object"||typeof A=="function")for(let C of q_t(A))!Z_t.call(o,C)&&C!==f&&vX(o,C,{get:()=>A[C],enumerable:!(m=j_t(A,C))||m.enumerable});return o};var D9=(o,A,f)=>(f=o!=null?W_t(X_t(o)):{},x5e(A||!o||!o.__esModule?vX(f,"default",{value:o,enumerable:!0}):f,o)),eBt=o=>x5e(vX({},"__esModule",{value:!0}),o);var Dct=$_t((Sct,Tse)=>{(function(o,A,f){typeof Tse<"u"&&Tse.exports?Tse.exports=f():typeof define=="function"&&define.amd?define(f):A[o]=f()})("h337",Sct,function(){var o={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.25:"rgb(0,0,255)",.55:"rgb(0,255,0)",.85:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}},A=function(){var E=function(Q){this._coordinator={},this._data=[],this._radi=[],this._min=10,this._max=1,this._xField=Q.xField||Q.defaultXField,this._yField=Q.yField||Q.defaultYField,this._valueField=Q.valueField||Q.defaultValueField,Q.radius&&(this._cfgRadius=Q.radius)},I=o.defaultRadius;return E.prototype={_organiseData:function(w,Q){var M=w[this._xField],B=w[this._yField],T=this._radi,D=this._data,F=this._max,L=this._min,R=w[this._valueField]||1,k=w.radius||this._cfgRadius||I;D[M]||(D[M]=[],T[M]=[]),D[M][B]?D[M][B]+=R:(D[M][B]=R,T[M][B]=k);var U=D[M][B];return U>F?(Q?this.setDataMax(U):this._max=U,!1):U<L?(Q?this.setDataMin(U):this._min=U,!1):{x:M,y:B,value:R,radius:k,min:L,max:F}},_unOrganizeData:function(){var w=[],Q=this._data,M=this._radi;for(var B in Q)for(var T in Q[B])w.push({x:B,y:T,radius:M[B][T],value:Q[B][T]});return{min:this._min,max:this._max,data:w}},_onExtremaChange:function(){this._coordinator.emit("extremachange",{min:this._min,max:this._max})},addData:function(){if(arguments[0].length>0)for(var w=arguments[0],Q=w.length;Q--;)this.addData.call(this,w[Q]);else{var M=this._organiseData(arguments[0],!0);M&&(this._data.length===0&&(this._min=this._max=M.value),this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[M]}))}return this},setData:function(w){var Q=w.data,M=Q.length;this._data=[],this._radi=[];for(var B=0;B<M;B++)this._organiseData(Q[B],!1);return this._max=w.max,this._min=w.min||0,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},removeData:function(){},setDataMax:function(w){return this._max=w,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setDataMin:function(w){return this._min=w,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setCoordinator:function(w){this._coordinator=w},_getInternalData:function(){return{max:this._max,min:this._min,data:this._data,radi:this._radi}},getData:function(){return this._unOrganizeData()}},E}(),f=function(){var E=function(M){var B=M.gradient||M.defaultGradient,T=document.createElement("canvas"),D=T.getContext("2d");T.width=256,T.height=1;var F=D.createLinearGradient(0,0,256,1);for(var L in B)F.addColorStop(L,B[L]);return D.fillStyle=F,D.fillRect(0,0,256,1),D.getImageData(0,0,256,1).data},I=function(M,B){var T=document.createElement("canvas"),D=T.getContext("2d"),F=M,L=M;if(T.width=T.height=M*2,B==1)D.beginPath(),D.arc(F,L,M,0,2*Math.PI,!1),D.fillStyle="rgba(0,0,0,1)",D.fill();else{var R=D.createRadialGradient(F,L,M*B,F,L,M);R.addColorStop(0,"rgba(0,0,0,1)"),R.addColorStop(1,"rgba(0,0,0,0)"),D.fillStyle=R,D.fillRect(0,0,2*M,2*M)}return T},w=function(L){for(var B=[],T=L.min,D=L.max,F=L.radi,L=L.data,R=Object.keys(L),k=R.length;k--;)for(var U=R[k],V=Object.keys(L[U]),H=V.length;H--;){var q=V[H],ie=L[U][q],Z=F[U][q];B.push({x:U,y:q,value:ie,radius:Z})}return{min:T,max:D,data:B}};function Q(M){var B=M.container,T=this.shadowCanvas=document.createElement("canvas"),D=this.canvas=M.canvas||document.createElement("canvas"),F=this._renderBoundaries=[1e4,1e4,0,0],L=getComputedStyle(M.container)||{};D.className="heatmap-canvas",this._width=D.width=T.width=M.width||+L.width.replace(/px/,""),this._height=D.height=T.height=M.height||+L.height.replace(/px/,""),this.shadowCtx=T.getContext("2d"),this.ctx=D.getContext("2d"),D.style.cssText=T.style.cssText="position:absolute;left:0;top:0;",B.style.position="relative",B.appendChild(D),this._palette=E(M),this._templates={},this._setStyles(M)}return Q.prototype={renderPartial:function(M){M.data.length>0&&(this._drawAlpha(M),this._colorize())},renderAll:function(M){this._clear(),M.data.length>0&&(this._drawAlpha(w(M)),this._colorize())},_updateGradient:function(M){this._palette=E(M)},updateConfig:function(M){M.gradient&&this._updateGradient(M),this._setStyles(M)},setDimensions:function(M,B){this._width=M,this._height=B,this.canvas.width=this.shadowCanvas.width=M,this.canvas.height=this.shadowCanvas.height=B},_clear:function(){this.shadowCtx.clearRect(0,0,this._width,this._height),this.ctx.clearRect(0,0,this._width,this._height)},_setStyles:function(M){this._blur=M.blur==0?0:M.blur||M.defaultBlur,M.backgroundColor&&(this.canvas.style.backgroundColor=M.backgroundColor),this._width=this.canvas.width=this.shadowCanvas.width=M.width||this._width,this._height=this.canvas.height=this.shadowCanvas.height=M.height||this._height,this._opacity=(M.opacity||0)*255,this._maxOpacity=(M.maxOpacity||M.defaultMaxOpacity)*255,this._minOpacity=(M.minOpacity||M.defaultMinOpacity)*255,this._useGradientOpacity=!!M.useGradientOpacity},_drawAlpha:function(D){for(var B=this._min=D.min,T=this._max=D.max,D=D.data||[],F=D.length,L=1-this._blur;F--;){var R=D[F],k=R.x,U=R.y,V=R.radius,H=Math.min(R.value,T),q=k-V,ie=U-V,Z=this.shadowCtx,oe;this._templates[V]?oe=this._templates[V]:this._templates[V]=oe=I(V,L);var ne=(H-B)/(T-B);Z.globalAlpha=ne<.01?.01:ne,Z.drawImage(oe,q,ie),q<this._renderBoundaries[0]&&(this._renderBoundaries[0]=q),ie<this._renderBoundaries[1]&&(this._renderBoundaries[1]=ie),q+2*V>this._renderBoundaries[2]&&(this._renderBoundaries[2]=q+2*V),ie+2*V>this._renderBoundaries[3]&&(this._renderBoundaries[3]=ie+2*V)}},_colorize:function(){var M=this._renderBoundaries[0],B=this._renderBoundaries[1],T=this._renderBoundaries[2]-M,D=this._renderBoundaries[3]-B,F=this._width,L=this._height,R=this._opacity,k=this._maxOpacity,U=this._minOpacity,V=this._useGradientOpacity;M<0&&(M=0),B<0&&(B=0),M+T>F&&(T=F-M),B+D>L&&(D=L-B);for(var H=this.shadowCtx.getImageData(M,B,T,D),q=H.data,ie=q.length,Z=this._palette,oe=3;oe<ie;oe+=4){var ne=q[oe],se=ne*4;if(!!se){var ce;R>0?ce=R:ne<k?ne<U?ce=U:ce=ne:ce=k,q[oe-3]=Z[se],q[oe-2]=Z[se+1],q[oe-1]=Z[se+2],q[oe]=V?Z[se+3]:ce}}H.data=q,this.ctx.putImageData(H,M,B),this._renderBoundaries=[1e3,1e3,0,0]},getValueAt:function(M){var B,T=this.shadowCtx,D=T.getImageData(M.x,M.y,1,1),F=D.data[3],L=this._max,R=this._min;return B=Math.abs(L-R)*(F/255)>>0,B},getDataURL:function(){return this.canvas.toDataURL()}},Q}(),m=function(){var E=!1;return o.defaultRenderer==="canvas2d"&&(E=f),E}(),C={merge:function(){for(var v={},E=arguments.length,I=0;I<E;I++){var w=arguments[I];for(var Q in w)v[Q]=w[Q]}return v}},y=function(){var E=function(){function M(){this.cStore={}}return M.prototype={on:function(B,T,D){var F=this.cStore;F[B]||(F[B]=[]),F[B].push(function(L){return T.call(D,L)})},emit:function(B,T){var D=this.cStore;if(D[B])for(var F=D[B].length,L=0;L<F;L++){var R=D[B][L];R(T)}}},M}(),I=function(Q){var M=Q._renderer,B=Q._coordinator,T=Q._store;B.on("renderpartial",M.renderPartial,M),B.on("renderall",M.renderAll,M),B.on("extremachange",function(D){Q._config.onExtremaChange&&Q._config.onExtremaChange({min:D.min,max:D.max,gradient:Q._config.gradient||Q._config.defaultGradient})}),T.setCoordinator(B)};function w(){var Q=this._config=C.merge(o,arguments[0]||{});if(this._coordinator=new E,Q.plugin){var M=Q.plugin;if(o.plugins[M]){var B=o.plugins[M];this._renderer=new B.renderer(Q),this._store=new B.store(Q)}else throw new Error("Plugin '"+M+"' not found. Maybe it was not registered.")}else this._renderer=new m(Q),this._store=new A(Q);I(this)}return w.prototype={addData:function(){return this._store.addData.apply(this._store,arguments),this},removeData:function(){return this._store.removeData&&this._store.removeData.apply(this._store,arguments),this},setData:function(){return this._store.setData.apply(this._store,arguments),this},setDataMax:function(){return this._store.setDataMax.apply(this._store,arguments),this},setDataMin:function(){return this._store.setDataMin.apply(this._store,arguments),this},configure:function(Q){return this._config=C.merge(this._config,Q),this._renderer.updateConfig(this._config),this._coordinator.emit("renderall",this._store._getInternalData()),this},repaint:function(){return this._coordinator.emit("renderall",this._store._getInternalData()),this},getData:function(){return this._store.getData()},getDataURL:function(){return this._renderer.getDataURL()},getValueAt:function(Q){return this._store.getValueAt?this._store.getValueAt(Q):this._renderer.getValueAt?this._renderer.getValueAt(Q):null}},w}(),x={create:function(v){return new y(v)},register:function(v,E){o.plugins[v]=E}};return x})});var Vki={};lde(Vki,{Analysis:()=>Nle,BaseObject:()=>c0,Billboard:()=>Rse,Box:()=>Yse,BwMode:()=>gse,Camera:()=>jae,Cesium:()=>K2e,ClusterLayer:()=>Xut,ColorAdjustment:()=>fse,Core:()=>act,Cylinder:()=>Wse,Degrees:()=>Zut,DoubleClickObjectTool:()=>nse,DoubleScreen:()=>tct,DynamicEyeOffset:()=>aPi,EarthCtrl:()=>t0t,Edit:()=>Ele,EditTool:()=>cse,ElevationTool:()=>ict,Ellipse:()=>ele,Ellipsoid:()=>qse,Environment:()=>mse,EventHandler:()=>DN,Explosion:()=>Qse,FeatureLayer:()=>cle,Fire:()=>_se,Fireworks:()=>Dse,FisheyeVideoProjection:()=>vse,Fog:()=>Ase,Hawkeye:()=>gle,HorizontalDistanceTool:()=>$ae,HoverObjectTool:()=>rse,ImageryLayer:()=>nle,Label:()=>kse,LineOfSightTool:()=>r0t,Measure:()=>sse,MeasureAreaTool:()=>OH,MeasureHeightTool:()=>Xae,MeasureLineLengthTool:()=>qae,MeasurePathLengthTool:()=>TW,MeasureSlopeTool:()=>Zae,MeasureSurfaceAreaTool:()=>ese,MilitaryPlotting:()=>oue,Model:()=>Fse,ModelClipping:()=>Tle,ModelEdit:()=>LH,ModelLayer:()=>lle,NightMode:()=>pse,Node:()=>GO,ObjectFactory:()=>T2,PerspectiveVideoProjection:()=>xse,PickObjectTool:()=>tse,PickPositionTool:()=>ise,Point:()=>zse,Polygon:()=>Hse,Polyline:()=>Use,PolylineVolume:()=>ile,Profile:()=>wle,RClickObjectTool:()=>ose,RadarScan:()=>Mse,Rain:()=>hse,Rectangle:()=>Zse,RestrictHeight:()=>Dle,SampleRenderedDataFlags:()=>oPi,Scene:()=>vle,SceneManager:()=>i0t,SelectSet:()=>yse,Skyline:()=>Qle,Smoke:()=>wse,Snow:()=>dse,SpatialObject:()=>Qc,SpatialTransform:()=>zae,SpotLight:()=>mle,Submergence:()=>Ble,TerrainExcavation:()=>Lle,TerrainLayer:()=>ale,TerrainModifier:()=>Mle,Tool:()=>ja,ToolManager:()=>Wae,VERSIONINFO:()=>_5e,VideoProjection:()=>n0t,ViewShed:()=>Ile,Volumetric:()=>_le,WFSTool:()=>qut,Waters:()=>fle,WorkChart:()=>hle,ZBiasGeometryInstanceAttribute:()=>nPi,czmlPathAnimation:()=>ITe,loadArrayBuffer:()=>dPi,loadBlob:()=>hPi,loadImage:()=>fPi,loadJson:()=>APi,loadLayui:()=>_Te,loadText:()=>cPi,sampleRenderedData:()=>sPi,sampleRenderedMesh:()=>lPi,sampleRenderedTerrain:()=>uPi,viewerNavigationCubeMixin:()=>l0t});var v5e="WebSDK v3.2.4-12",E5e="Cesium v1.99",I5e="2023.12.1",tBt="SmartEarth",iBt={VERSION:v5e,CesiumVERSION:E5e,CompileTime:I5e},rBt=typeof window<"u"?window:typeof self<"u"?self:{};rBt.logSmartEarth=()=>{let o=`
%c${tBt}
%c
\u7248 \u672C \u53F7\uFF1A${v5e}    ${E5e}
@@ -16835,7 +16835,7 @@
gl_FragColor = mix(gl_FragColor, u_floodColor, 0.3);
}
}
`}Object.defineProperties(fAt.prototype,{parameter:{get:function(){return this._parameter}},show:{get:function(){return this._pps!==null},set:function(o){o?ILi(this):_Li(this)}},maxHeight:{get:function(){return this._maxHeight},set:function(o){this._maxHeight=o}},minHeight:{get:function(){return this._minHeight},set:function(o){this._minHeight=o}}});var KO=fAt;function xy(o,A){this._earthCtrl=o,this._coreMap=o.coreMap,this._minHeight=Ae(A.minHeight,0),this._maxHeight=Ae(A.maxHeight,0),this._extrudedHeight=Ae(A.extrudedHeight,0),this.shapeTool=void 0,this._speed=Ae(A.speed,1),this._baseWaterColor=Ae(A.baseWaterColor,new At(.2,.3,.6,.5)),this._waterFrequency=Ae(A.waterFrequency,1e3),this._animationSpeed=Ae(A.animationSpeed,.01),this._amplitude=Ae(A.amplitude,10),this._isPolygon=Ae(A.isPolygon,!0),this.eventHelper=new Px,this._nowHeight=null,this._height=Ae(A.height,void 0),this._type=Ae(A.type,"up")}xy.prototype.drawPolygon=function(o){let A=this;this.shapeTool=A._earthCtrl.shapeTool.createDrawShapeTool(function(f){A.setPolygon({positions:f.result}),o&&o(A)})};xy.prototype.setPolygon=function(o){this.positions=o.positions;let A=this,f=A.computePolygonHeightRange(this.positions);A._minHeight=f.minHeight,A._maxHeight=f.maxHeight,A._extrudedHeight=A._minHeight};xy.prototype.computePolygonHeightRange=function(o){let A=[],f=this._earthCtrl.coreMap;for(let D=0;D<o.length;D++)A.push(o[D].clone());let m,C,y,x,v,E,I,w=0,Q=9999,M=Math.PI/Math.pow(2,11)/64,B=new rh.fromPositions({positions:A,vertexFormat:za.FLAT_VERTEX_FORMAT,granularity:M}),T=new rh.createGeometry(B);for(let D=0;D<T.indices.length;D+=3)m=T.indices[D],C=T.indices[D+1],y=T.indices[D+2],I=new ee(T.attributes.position.values[3*m],T.attributes.position.values[3*m+1],T.attributes.position.values[3*m+2]),(x=f.scene.globe.getHeight(Kt.fromCartesian(I)))<Q&&(Q=x),w<x&&(w=x),I=new ee(T.attributes.position.values[3*C],T.attributes.position.values[3*C+1],T.attributes.position.values[3*C+2]),(v=f.scene.globe.getHeight(Kt.fromCartesian(I)))<Q&&(Q=v),w<v&&(w=v),I=new ee(T.attributes.position.values[3*y],T.attributes.position.values[3*y+1],T.attributes.position.values[3*y+2]),(E=f.scene.globe.getHeight(Kt.fromCartesian(I)))<Q&&(Q=E),w<E&&(w=E);return{maxHeight:w,minHeight:Q}};xy.prototype.removeFromMap=function(){this._isPolygon?O(this.primitive)&&(this.removePrimitive(),this._extrudedHeight=this.minHeight,this.primitive=null):O(this.flood)&&(this.flood.show=!1),this.eventHelper&&this.eventHelper.removeAll(),this.shapeTool&&this.shapeTool.removeFromMap()};xy.prototype._onTick=function(){let o=this;o._type==="up"?o._extrudedHeight>=o._maxHeight?(o._extrudedHeight=o._maxHeight,o._nowHeight=o._extrudedHeight,o.eventHelper.removeAll()):(o._isPolygon?o.removePrimitive():O(o.flood)||(o.flood=new KO(o._earthCtrl,{minHeight:o.minHeight,maxHeight:o._extrudedHeight,positions:o.positions}),o.flood.show=!0),o._extrudedHeight+=o._speed,o._isPolygon?o.addPrimitive():o.flood.maxHeight=o._extrudedHeight):o._type==="down"&&(o._extrudedHeight<=o._minHeight?(o._extrudedHeight=o._minHeight,o._nowHeight=o._extrudedHeight,o.eventHelper.removeAll()):(o._isPolygon?o.removePrimitive():O(o.flood)||(o.flood=new KO(o._earthCtrl,{minHeight:o.minHeight,maxHeight:o._extrudedHeight,positions:o.positions}),o.flood.show=!0),o._extrudedHeight-=o._speed,o._isPolygon?o.addPrimitive():o.flood.maxHeight=o._extrudedHeight))};xy.prototype._onTickNext=function(){let o=this;o._nowHeight?o._type==="up"?o._extrudedHeight>=o._nowHeight+o._height?(o._extrudedHeight=o._nowHeight+o._height,o._nowHeight=o._extrudedHeight,o.eventHelper.removeAll()):(o._isPolygon?o.removePrimitive():O(o.flood)||(o.flood=new KO(o._earthCtrl,{minHeight:o.minHeight,maxHeight:o._extrudedHeight,positions:o.positions}),o.flood.show=!0),o._extrudedHeight+=o._speed,o._isPolygon?o.addPrimitive():o.flood.maxHeight=o._extrudedHeight):o._type==="down"&&(o._extrudedHeight<=o._nowHeight-o._height?(o._extrudedHeight=o._nowHeight-o._height,o._nowHeight=o._extrudedHeight,o.eventHelper.removeAll()):(o._isPolygon?o.removePrimitive():O(o.flood)||(o.flood=new KO(o._earthCtrl,{minHeight:o.minHeight,maxHeight:o._extrudedHeight,positions:o.positions}),o.flood.show=!0),o._extrudedHeight-=o._speed,o._isPolygon?o.addPrimitive():o.flood.maxHeight=o._extrudedHeight)):o._type==="up"?o._extrudedHeight>=o._minHeight+o._height?(o._extrudedHeight=o._minHeight+o._height,o._nowHeight=o._extrudedHeight,o.eventHelper.removeAll()):(o._isPolygon?o.removePrimitive():O(o.flood)||(o.flood=new KO(o._earthCtrl,{minHeight:o.minHeight,maxHeight:o._extrudedHeight,positions:o.positions}),o.flood.show=!0),o._extrudedHeight+=o._speed,o._isPolygon?o.addPrimitive():o.flood.maxHeight=o._extrudedHeight):o._type==="down"&&(o._extrudedHeight<=o._maxHeight-o._height?(o._extrudedHeight=o._maxHeight-o._height,o._nowHeight=o._extrudedHeight,o.eventHelper.removeAll()):(o._isPolygon?o.removePrimitive():O(o.flood)||(o.flood=new KO(o._earthCtrl,{minHeight:o.minHeight,maxHeight:o._extrudedHeight,positions:o.positions}),o.flood.show=!0),o._extrudedHeight-=o._speed,o._isPolygon?o.addPrimitive():o.flood.maxHeight=o._extrudedHeight))};xy.prototype.removePrimitive=function(){O(this.primitive)&&this._earthCtrl.primitives.remove(this.primitive)};xy.prototype.polygonAnalysis=function(){let o=this;O(o.shapeTool)&&(o.shapeTool.removeFromMap(),o.shapeTool=void 0),o._height?o.eventHelper.add(o._earthCtrl.coreMap.clock.onTick,xy.prototype._onTickNext,this):o.eventHelper.add(o._earthCtrl.coreMap.clock.onTick,xy.prototype._onTick,this);let A={};A.normalMap=`${globalThis.GEOWORLD_BASE_URL}Assets/Images/waterNormals.jpg`,A.baseWaterColor=o.baseWaterColor,A.frequency=o.waterFrequency,A.animationSpeed=o.animationSpeed,A.amplitude=o.amplitude;let f=new ss({fabric:{type:"Water",uniforms:A}});f.update(o._earthCtrl.coreMap.scene.context),o.primitiveAppearance=new PY({material:f,fragmentShaderSource:RY})};xy.prototype.postAnalysis=function(){let o=this;O(o.shapeTool)&&(o.shapeTool.removeFromMap(),o.shapeTool=void 0),o._height?o.eventHelper.add(o._earthCtrl.coreMap.clock.onTick,xy.prototype._onTickNext,this):o.eventHelper.add(o._earthCtrl.coreMap.clock.onTick,xy.prototype._onTick,this)};xy.prototype.addPrimitive=function(){let o=this;o.primitive=o._earthCtrl.primitives.add(new $a({geometryInstances:new co({geometry:rh.fromPositions({positions:o.positions,extrudedHeight:o._extrudedHeight})}),asynchronous:!1,appearance:o.primitiveAppearance}))};xy.prototype.startAnalysis=function(){let o=this;setTimeout(()=>{o._isPolygon?o.polygonAnalysis():o.postAnalysis()},100)};Object.defineProperties(xy.prototype,{isPolygon:{get:function(){return this._isPolygon}},minHeight:{set:function(o){this._minHeight=o},get:function(){return this._minHeight}},maxHeight:{set:function(o){this._maxHeight=o},get:function(){return this._maxHeight}},speed:{set:function(o){this._speed=o},get:function(){return this._speed}},baseWaterColor:{set:function(o){this._baseWaterColor=o},get:function(){return this._baseWaterColor}},waterFrequency:{set:function(o){this._waterFrequency=o},get:function(){return this._waterFrequency}},animationSpeed:{set:function(o){this._animationSpeed=o},get:function(){return this._animationSpeed}},amplitude:{set:function(o){this._amplitude=o},get:function(){return this._amplitude}},height:{set:function(o){this._height=o,this.postAnalysis()},get:function(){return this._height}},type:{set:function(o){this._type=o},get:function(){return this._type}}});var Ble=xy;function YO(o,A){this._earthCtrl=o,this._coreMap=o.coreMap,this.shapeTool=void 0,this.positions=void 0,this.echarts=void 0,this.mCallback=Ae(A.callback,void 0),this.defaultChart=Ae(A.defaultChart,!0),this.step=Ae(A.step,20),this.image=A.image,this.echarstView=A.echartsView,this.echartsParentView=A.echartsParentView,this.billboard=void 0,this.minHeight=0,this.maxHeight=0,this.profile={arrHB:[],arrPoint:[],arrLX:[],points:[],distance:0}}YO.prototype.drawPolyLine=function(){let o=this;this.shapeTool=o._earthCtrl.shapeTool.createDrawShapeTool(function(A){o.setPolyline({positions:A.result})},"polyline")};YO.prototype.setPolyline=function(o){this.positions=o.positions};YO.prototype.startAnalysis=function(){if(!this.positions)return console.info("\u8BF7\u5148\u7ED8\u5236\u5256\u9762\u7EBF\uFF01");if(this.positions.length>1){this.profile.arrLX.push(0);for(let A=0;A<this.positions.length-1;A++){let f=this.positions[A],m=this.positions[A+1];this.profile2PointAnalysis(f,m)}this.processHeight();let o=this.profile;this.defaultChart&&bLi(this,o),O(this.mCallback)&&this.mCallback(o),this.positions=void 0}};YO.prototype.processHeight=function(){let o=this;if(!(o.profile.arrHB.length<=0)){o.minHeight=o.maxHeight=o.profile.arrHB[0];for(let A=1;A<o.profile.arrHB.length;A++){let f=o.profile.arrHB[A];f>o.maxHeight?o.maxHeight=f:f<o.minHeight&&(o.minHeight=f)}o.minHeight=parseInt(o.minHeight/100)*100;for(let A=0;A<o.profile.arrHB.length;A++){let f=o.profile.arrHB[A];o.profile.arrHB[A]=f-o.minHeight}}};var wLi=new ee;YO.prototype.profile2PointAnalysis=function(o,A){let f=this,m=ee.distance(o,A),C=parseInt(m/f.step),y=Kt.fromCartesian(o),x=Kt.fromCartesian(A);f.positions.length>2&&f.profile.arrLX.length>1&&f.profile.arrLX.push(f.profile.arrLX[f.profile.arrLX.length-1]+sMe(f.profile.points[f.profile.points.length-1],y)),f.profile.points.push(y),f.profile.arrPoint.push(aMe(o)),f.profile.arrHB.push(y.height);let v=f.profile.arrLX.length-1;console.info(v);for(let E=1;E<C;E++){let I=ee.lerp(o,A,E/C,wLi),w=Kt.fromCartesian(I),Q=f._coreMap.scene.globe.getHeight(w);w.height=Q;let M=sMe(f.profile.points[v+E-1],w);f.profile.distance=f.profile.distance+M,f.profile.points.push(w),f.profile.arrLX.push(f.profile.arrLX[v+E-1]+M),f.profile.arrPoint.push(aMe(I)),f.profile.arrHB.push(Q)}return f.profile.points.push(x),f.profile.arrLX.push(f.profile.arrLX[f.profile.arrLX.length-1]+sMe(f.profile.points[f.profile.points.length-1],x)),f.profile.arrPoint.push(aMe(A)),f.profile.arrHB.push(x.height),f.profile};function CAt(o,A){let f=document.getElementById(o);f.style.display=A?"block":"none"}var gAt;function bLi(o,A){if(A!==null&&A.arrPoint!==null){CAt(o.echartsParentView,!0),O(o.echarts)||(o.echarts=kb.init(document.getElementById(o.echarstView),"dark"));let f=A.arrPoint,m={grid:{left:10,right:10,bottom:10,containLabel:!0},dataZoom:[{type:"inside",throttle:50}],tooltip:{trigger:"axis",formatter:function(C){let y="";if(C.length===0)return y;let x=f[C[0].dataIndex],v=C[0].value+o.minHeight;return gAt=new ee.fromDegrees(x.x,x.y,v),O(o.billboard)||(o.billboard=o._earthCtrl.entities.add({name:"profile_billboard",position:new Bn(function(){return gAt},!1),billboard:{verticalOrigin:bn.BOTTOM,image:o.image,iconWidth:8,iconHeight:8,scale:.5}})),o.billboard.show||(o.billboard.show=!0),y+=`\u6240\u5728\u4F4D\u7F6E&nbsp;${mAt(x.x)},${mAt(x.y)}<br />\u8DDD\u8D77\u70B9&nbsp;<label>${pAt(C[0].axisValue)}</label><br />${C[0].seriesName}&nbsp;<label style='color:${C[0].color};'>${pAt(v)}</label><br />`}},xAxis:[{name:"\u884C\u7A0B",type:"category",boundaryGap:!1,axisLine:{show:!1},axisLabel:{show:!1},data:A.arrLX}],yAxis:[{type:"value",axisLabel:{formatter:function(C){return`${C+o.minHeight}\u7C73`}}}],series:[{name:"\u9AD8\u7A0B\u503C",type:"line",smooth:!0,symbol:"none",sampling:"average",itemStyle:{normal:{color:"rgb(255, 70, 131)"}},areaStyle:{normal:{color:new kb.graphic.LinearGradient(0,0,0,1,[{offset:0,color:"rgb(255, 158, 68)"},{offset:1,color:"rgb(255, 70, 131)"}])}},data:A.arrHB}]};o.echarts.setOption(m)}}function pAt(o,A){if(o===null)return"";o=Number(o),(A===null||A==="auto")&&(o<1e3?A="m":A="km");let f="";switch(A){default:case"m":f=`${o.toFixed(2)}\u7C73`;break;case"km":f=`${(o*.001).toFixed(2)}\u516C\u91CC`;break;case"mile":f=`${(o*54e-5).toFixed(2)}\u6D77\u91CC`;break;case"zhang":f=`${(o*.3).toFixed(2)}\u4E08`;break}return f}function mAt(o){let A=o.toString();return A.slice(0,A.indexOf(".")+3)}function aMe(o){let A=Kt.fromCartesian(o),f=je.toDegrees(A.longitude),m=je.toDegrees(A.latitude),C=A.height;return{x:f,y:m,z:C}}function sMe(o,A){let f=new l0;f.setEndPoints(o,A);let m=f.surfaceDistance;return m=Math.sqrt(Math.pow(m,2)+Math.pow(A.height-o.height,2)),m}YO.prototype.removeFromMap=function(){let o=this;O(o.shapeTool)&&(o.shapeTool.removeFromMap(),o.shapeTool=void 0),O(o.billboard)&&(o._earthCtrl.entities.remove(o.billboard),o.billboard=void 0),CAt(o.echartsParentView,!1)};var wle=YO;function ble(o,A){this._earthCtrl=o,this._coreMap=o.coreMap,this._skylineColor=Ae(A.color,At.RED.withAlpha(1)),this._postProccessStage=null,this._postProcessStages=this._coreMap.scene.postProcessStages,this._width=Ae(A.width,1),this._edgeDetection=Qv.createEdgeDetectionStage({width:this._width||1}),this.addToMap()}ble.prototype.addToMap=function(){this.removeFromMap();let o=new va({name:"czm_skylinetemp",fragmentShader:"uniform sampler2D colorTexture;uniform sampler2D depthTexture;varying vec2 v_textureCoordinates;void main(void){float depth = czm_readDepth(depthTexture, v_textureCoordinates);vec4 color = texture2D(colorTexture, v_textureCoordinates);if(depth<1.0 - 0.000001){gl_FragColor = color;}else{gl_FragColor = vec4(1.0,0.0,0.0,1.0);}}"}),A=new va({name:"czm_skylinetemp1",fragmentShader:"uniform sampler2D colorTexture;uniform sampler2D redTexture;uniform sampler2D silhouetteTexture;uniform vec4 skylineColor;varying vec2 v_textureCoordinates;void main(void){vec4 redcolor=texture2D(redTexture, v_textureCoordinates);vec4 silhouetteColor = texture2D(silhouetteTexture, v_textureCoordinates);vec4 color = texture2D(colorTexture, v_textureCoordinates);if(redcolor.r == 1.0){gl_FragColor = mix(color, skylineColor, silhouetteColor.a);}else{gl_FragColor = color;}}",uniforms:{redTexture:o.name,silhouetteTexture:this._edgeDetection.name,skylineColor:this._skylineColor}});this._postProccessStage=new CC({name:"czm_skyline",stages:[this._edgeDetection,o,A],inputPreviousStageTexture:!1,uniforms:this._edgeDetection.uniforms}),this._postProcessStages.add(this._postProccessStage)};ble.prototype.removeFromMap=function(){this._postProccessStage&&(this._earthCtrl.coreMap.scene.postProcessStages.remove(this._postProccessStage),this._postProccessStage=null)};Object.defineProperties(ble.prototype,{});var Qle=ble;function Sle(o,A){this._earthCtrl=o,this._coreMap=o.coreMap,this.leftIndex=void 0,this.rightIndex=void 0,this.addToMap(A.leftIndex,A.rightIndex)}var JO={dragStartX:0,_scene:void 0};Sle.prototype.addToMap=function(o,A){document.getElementById("slider")&&this.clear();let m=this._coreMap.imageryLayers,C=this._coreMap.scene;JO._scene=C;let y=this._coreMap.container,x=document.createElement("div");x.id="slider",x.style.position="absolute",x.style.cursor="e-resize",x.style.top=0,x.style.backgroundColor="#D3D3D3",x.style.width="8px",x.style.height="100%",x.style.zIndex="1000",y.appendChild(x);let v=m.get(o),E=m.get(A);this.leftIndex=o,this.rightIndex=A,v.splitDirection=cI.LEFT,E.splitDirection=cI.RIGHT;let I=document.getElementById("slider");C.splitPosition=I.offsetLeft/I.parentElement.offsetWidth,I.addEventListener("mousedown",xAt,!1),window.addEventListener("mouseup",yAt,!1),I.style.left="50%",JO._scene.splitPosition=.5};function yAt(){window.removeEventListener("mousemove",lMe,!1)}function xAt(o){let A=document.getElementById("slider");JO.dragStartX=o.clientX-A.offsetLeft,window.addEventListener("mousemove",lMe,!1)}function lMe(o){let A=document.getElementById("slider"),f=(o.clientX-JO.dragStartX)/A.parentElement.offsetWidth;A.style.left=`${100*f}%`,JO._scene.splitPosition=f}Sle.prototype.removeFromMap=function(){let o=document.getElementById("slider");if(o){JO._scene.splitPosition="0%",o.removeEventListener("mousedown",xAt,!1),window.removeEventListener("mouseup",yAt,!1),window.removeEventListener("mousemove",lMe,!1),o.remove();let A=this._coreMap.imageryLayers,f=A.get(this.leftIndex),m=A.get(this.rightIndex);f.splitDirection=cI.NONE,m.splitDirection=cI.NONE,JO._scene=void 0}};Object.defineProperties(Sle.prototype,{});var vAt=Sle;function OW(o,A){this._earthCtrl=o,this._coreMap=o.coreMap,this.color=Ae(A.color,At.RED.withAlpha(.5)),this.positions=A.positions,this.baseHeight=Ae(A.baseHeight,0),this._height=Ae(A.height,0),this.extrudedHeight=Ae(A.extrudedHeight,1e4),this.limitHeightPrimitive=null,this.addToMap()}OW.prototype.addToMap=function(){if(this.removeFromMap(),!this.positions)return;let o=ee.fromDegreesArray(this.positions),A=new co({geometry:new rh({polygonHierarchy:new Un(o),height:this.baseHeight,extrudedHeight:this.baseHeight+this.extrudedHeight}),attributes:{color:Yo.fromColor(this.color)}});this.limitHeightPrimitive=this._coreMap.scene.primitives.add(new l6({geometryInstances:A,releaseGeometryInstances:!1,classificationType:Gu.CESIUM_3D_TILE}))};OW.prototype.changeHeight=function(o){!this.limitHeightPrimitive||(console.log("?!?!?!",this.limitHeightPrimitive),this.limitHeightPrimitive.readyPromise.then(A=>{let f=Kt.fromCartesian(this.limitHeightPrimitive._primitive._boundingSpheres[0].center);console.log("???",f);let m=ee.fromRadians(f.longitude,f.latitude,this.baseHeight),C=ee.fromRadians(f.longitude,f.latitude,this.baseHeight+o),y=ee.subtract(C,m,new ee);console.log("!!!!",this.limitHeightPrimitive._primitive.modelMatrix),this.limitHeightPrimitive._primitive.modelMatrix=Xe.setTranslation(Xe.IDENTITY,y,new Xe),this.baseHeight=this.baseHeight+o}))};OW.prototype.removeFromMap=function(){this.limitHeightPrimitive&&(this._coreMap.scene.primitives.remove(this.limitHeightPrimitive),this.limitHeightPrimitive=void 0)};Object.defineProperties(OW.prototype,{});var Dle=OW;function EAt(o){this._earthCtrl=o}EAt.prototype.toDegrees=function(o){let A=Kt.fromCartesian(o);return{lon:je.toDegrees(A.longitude),lat:je.toDegrees(A.latitude),height:A.height}};var IAt=EAt;function WO(o){this._viewer=o.coreMap,this._trans=new IAt}WO.prototype.addClipping=function(o,A={}){if(this.remove(),A.type==="polygon"){let f=A.positions,m=[];f.forEach(v=>{m.push(this._trans.toDegrees(v))}),m.push(m[0]);let C;A.isInner?C=this.isClockWise(m):C=!this.isClockWise(m),C&&m.reverse();let y=[],x=this.getInverseTransform(o);for(let v=0;v<m.length-1;v++){let E=this.createPlane(m[v],m[v+1],x);y.push(E)}o.clippingPlanes=new nB({planes:y,unionClippingRegions:!A.isInner})}return this.item=o,this};WO.prototype.getInverseTransform=function(o){let A,f=o.root.transform;return f&&f.equals(Xe.IDENTITY)||!f?A=Vn.eastNorthUpToFixedFrame(o.boundingSphere.center):A=Xe.fromArray(o.root.transform),Xe.inverseTransformation(A,new Xe)};WO.prototype.getOriginCoordinateSystemPoint=function(o,A){let f=ee.fromDegrees(o.lon,o.lat);return Xe.multiplyByPoint(A,f,new ee(0,0,0))};WO.prototype.createPlane=function(o,A,f){let m=this.getOriginCoordinateSystemPoint(o,f),C=this.getOriginCoordinateSystemPoint(A,f),y=new ee(0,0,1),x=ee.subtract(C,m,new ee),v=ee.cross(x,y,new ee);v=ee.normalize(v,v);let E=Wa.fromPointNormal(m,v);return OM.fromPlane(E)};WO.prototype.isClockWise=function(o){if(o.length<3)return null;o[0]===o[o.length-1]&&(o=o.slice(0,o.length-1));let A={i:-1,val:90};for(let E=0;E<o.length;E++){let{lat:I}=o[E];I<A.val&&(A.val=I,A.i=E)}let f=(A.i+o.length-1)%o.length,m=A.i,C=(A.i+1)%o.length,y={lat:o[m].lat-o[f].lat,lon:o[m].lon-o[f].lon},x={lat:o[C].lat-o[m].lat,lon:o[C].lon-o[m].lon},v=x.lon*y.lat-y.lon*x.lat;return v===0?o[C].lon<o[f].lon:v>0};WO.prototype.remove=function(){this.item&&this.item.clippingPlanes&&this.item.clippingPlanes.removeAll(),this.item&&(this.item.clippingPlanes=void 0)};var Tle=WO;var uMe;function cMe(o,A){this._viewer=o.coreMap,uMe=o.coreMap,this.createTerrainModifier(A.name,A.polygon,A.altitude)}cMe.prototype.findDirectParent=function(o){try{let A=[];if(o.width===Math.PI)return null;for(let f=0;f<uMe.scene.globe._surface._tilesToRender.length;f++){let m=uMe.scene.globe._surface._tilesToRender[f],C=m._rectangle;Si.intersection(C,o)&&A.push(m)}return A}catch(A){console.log(A)}return null};cMe.prototype.createTerrainModifier=function(o,A,f){let m=A.length,C=new Array(m);C.fill(f);let y=Vu(),x=Date.now(),v=Si.fromCartesianArray(A),E=this.findDirectParent(v);this._viewer.terrainProvider&&this._viewer.terrainProvider._modifyTerrainObjects===void 0&&(this._viewer.terrainProvider._modifyTerrainObjects=[]);let I=this._viewer,w={id:y,name:o,show:!0,rectangle:v,vertices:A,heights:C,timeStamp:x,remove:function(){if(I.terrainProvider&&I.terrainProvider._modifyTerrainObjects)for(let Q=I.terrainProvider._modifyTerrainObjects.length-1;Q>=0;Q--)I.terrainProvider._modifyTerrainObjects[Q].id===y&&I.terrainProvider._modifyTerrainObjects.splice(Q,1);if(E)try{for(let Q=0;Q<E.length;Q++)try{E[Q]._parent.freeResources()}catch(M){console.log(M)}}catch(Q){console.log(Q)}}};if(this._viewer.terrainProvider._modifyTerrainObjects.push(w),E)try{for(let Q=0;Q<E.length;Q++)try{E[Q]._parent.freeResources()}catch(M){console.log(M)}}catch(Q){console.log(Q)}return w};var Mle=cMe;var JH;function AMe(o){this._earthCtrl=o,this.Viewer=o.coreMap,JH=o.coreMap}AMe.prototype.CreateTooltip=function(o={},A,f){let m,C,y,x,v;typeof o=="object"&&(m=o),m&&m.origin?(m.origin==="center"&&(C=15,y=-12),m.origin==="top"&&(C=15,y=-44),m.origin==="bottom"&&(C=15,y=20)):(C=15,y=20),m&&m.color?(m.color==="white"&&(x="background: rgba(255, 255, 255, 0.8);color: black;"),m.color==="black"&&(x="background: rgba(0, 0, 0, 0.5);color: white;"),m.color==="yellow"&&(x="color: black;background-color: #ffcc33;border: 1px solid white;")):x="background: rgba(0, 0, 0, 0.5);color: white;",m&&m.id?v=`toolTip${m.id}`:v="toolTip";let E=document.getElementById(v);if(!E){let I=document.createElement("div");nA(".map-widget",I);let w=`<div id="${v}" style="display: none;pointer-events: none;position: absolute;z-index: 1000;opacity: 0.8;border-radius: 4px;padding: 4px 8px;white-space: nowrap;font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px;${x}"></div>`;nA(".map-widget",w),E=document.getElementById(v)}return f?(E.innerHTML=o,E.style.left=`${A.x+C}px`,E.style.top=`${A.y+y}px`,E.style.display="block"):E.style.display="none",{tooltip:E,style:m,showAt:function(I,w){this.tooltip.innerHTML=w,this.style&&this.style.origin?(this.style.origin==="center"&&(C=15,y=-this.tooltip.offsetHeight/2),this.style.origin==="top"&&(C=15,y=-this.tooltip.offsetHeight-20),this.style.origin==="bottom"&&(C=15,y=20)):(C=15,y=-this.tooltip.offsetHeight/2),this.tooltip.style.left=`${I.x+C}px`,this.tooltip.style.top=`${I.y+y}px`,this.tooltip.style.display="block"},show:function(I){I?this.tooltip.style.display="block":this.tooltip.style.display="none"}}};AMe.prototype.CreateResultTooltip=function(o={}){let A,f,m,C=o.id?`resultToolTip${o.id}`:"resultToolTip",y=document.getElementById(C);if(o.color?(o.color==="white"&&(m="background: rgba(255, 255, 255, 0.8);color: black;"),o.color==="black"&&(m="background: rgba(0, 0, 0, 0.5);color: white;"),o.color==="blue"&&(m="background: rgba(48, 119, 221);color: white;"),o.color==="yellow"&&(m="color: black;background-color: #ffcc33;border: 1px solid white;")):m="color: black;background-color: #ffcc33;border: 1px solid white;",!y){let Q=`<div id="${C}" class="resultToolTip" style="display: none;pointer-events: none;position: absolute;z-index: 1000;opacity: 0.8;border-radius: 4px;padding: 4px 8px;white-space: nowrap;font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px;${m}"></div>`;nA(".map-widget",Q),y=document.getElementById(C)}let x=o.addX||0,v=o.addY||0,E,I=this;function w(){if(E){if(o.far!==void 0||o.near!==void 0){let M=I.getPointToCameraDistance(JH,E);if(M>o.far){y.style.display="none";return}else if(M<o.near){y.style.display="none";return}y.style.display="block"}let Q=JH.scene.cartesianToCanvasCoordinates(E);if(!Q)return;A=-y.offsetWidth/2+x,f=-y.offsetHeight+v,y.style.left=`${Q.x+A}px`,y.style.top=`${Q.y+f}px`}}return JH.clock.onTick.addEventListener(w),{tooltip:y,position:E,showAt:function(Q,M){if(this.tooltip.innerHTML=M,this.tooltip.style.display="block",this.position=Q,E=Q,E){let B=JH.scene.cartesianToCanvasCoordinates(E);if(!B)return;A=-this.tooltip.offsetWidth/2+x,f=-this.tooltip.offsetHeight+v,this.tooltip.style.left=`${B.x+A}px`,this.tooltip.style.top=`${B.y+f}px`}},show:function(Q){Q?(this.tooltip.style.display="block",E=this.position):(this.tooltip.style.display="none",E=void 0)},destroy(){JH.clock.onTick.removeEventListener(w),y.remove()}}};var pw=AMe;var hMe=class{constructor(){this.minHeight=Number.MAX_VALUE,this.maxHeight=Number.MIN_VALUE,this.cutVolume=0,this.fillVolume=0,this.baseArea=0}},dMe=class{constructor(){this.minHeight=Number.MAX_VALUE,this.maxHeight=Number.MIN_VALUE,this.avgHeight=0,this.baseArea=0}};function Ple(o,A){this._earthCtrl=o,this._viewer=o.coreMap,this.baseHeight=Ae(A.baseHeight,0),this.options=A}Ple.prototype.start=function(){let o=this.options.positions,A=this.options.countBase,f=this.options.basePositions,m=this.options.baseHeight,C=new hMe,y=[];o.forEach(Q=>{let M=Kt.fromCartesian(Q);this.baseHeight=Math.min(M.height,Ae(m,this.baseHeight)),y.push(Ss.wgs84ToWindowCoordinates(this._viewer.scene,Q))});let x=QLi(y),v=Zl.randomPoint(100,{bbox:[x[0],x[1],x[2],x[3]]}),E=SLi(y);Zl.voronoi(v,{bbox:[x[0],x[1],x[2],x[3]]}).features.forEach(Q=>{let M=DLi(E,Q.geometry);if(M.length>0){let B=this.computeCubeInfo(M);this.baseHeight>B.avgHeight?C.fillVolume+=(this.baseHeight-B.avgHeight)*C.baseArea:C.cutVolume+=(B.avgHeight-this.baseHeight)*C.baseArea,C.maxHeight=Math.max(C.maxHeight,B.maxHeight),C.minHeight=Math.min(C.minHeight,B.minHeight),C.baseArea+=B.baseArea}});let w=this.countBaseVolume(A,f,m);return w!==0&&(C.cutVolume+=w,C.fillVolume+=w),C};Ple.prototype.countBaseVolume=function(o,A,f){let m=this;if(o){let C=[],y=[];for(let Q=0;Q<A.length;Q=Q+3){y.push(A[Q+2]);let M=ee.fromDegrees(A[Q],A[Q+1],f),B=Kt.fromCartesian(M);C.push(B)}C.push(C[0]);let x=_At(C);y.sort(function(Q,M){return Q-M});let v=y[0],E=y[y.length-1];return Number(E-v)*x/2}return 0};Ple.prototype.computeCubeInfo=function(o){let A=this,f=[],m=Number.MAX_VALUE,C=Number.MIN_VALUE,y=0;o.forEach(function(E){let I=A._earthCtrl.coreMap.scene.camera.getPickRay(E),w=A._earthCtrl.coreMap.scene.globe.pick(I,A._earthCtrl.coreMap.scene),Q=Kt.fromCartesian(w);f.push(Q),m=Math.min(m,Q.height),C=Math.max(C,Q.height),y+=Q.height});let x=y/o.length,v=new dMe;return v.minHeight=m,v.maxHeight=C,v.avgHeight=x,v.baseArea=_At(f),v};function _At(o){let A=[0],f=[0],m=new l0,C=Math.PI/180;for(let x=0;x<o.length-1;x++){let v=o[x],E=o[x+1];m.setEndPoints(v,E);let I=Math.sqrt(Math.pow(m.surfaceDistance,2)),w=E.latitude*C,Q=E.longitude*C,M=v.latitude*C,B=v.longitude*C,T=-Math.atan2(Math.sin(Q-B)*Math.cos(M),Math.cos(w)*Math.sin(M)-Math.sin(w)*Math.cos(M)*Math.cos(Q-B));T<0&&(T+=Math.PI*2),f.push(Math.sin(T)*I+f[x]),A.push(Math.cos(T)*I+A[x])}let y=0;for(let x=0;x<A.length-1;x++)y+=A[x]*f[x+1]-A[x+1]*f[x];return Math.abs(y+A[A.length-1]*f[0]-A[0]*f[f.length-1])/2}function QLi(o){let A=[],f=Number.MAX_VALUE,m=Number.MIN_VALUE,C=Number.MAX_VALUE,y=Number.MIN_VALUE;return o.forEach(x=>{f=Math.min(f,x.x),m=Math.max(m,x.x),C=Math.min(C,x.y),y=Math.max(y,x.y)}),A.push(f),A.push(C),A.push(m),A.push(y),A}function SLi(o){let A=[[]];return o.forEach(m=>{A[0].push([m.x,m.y])}),A[0].push([o[0].x,o[0].y]),Zl.polygon(A).geometry}function DLi(o,A){let f=Zl.intersect(o,A);return f?.geometry!==void 0?TLi(f?.geometry):[]}function TLi(o){let A=[];return o.coordinates.forEach(function(f){f.forEach(function(m){A.push(new It(m[0],m[1]))})}),A.push(new It(o.coordinates[0][0][0],o.coordinates[0][0][1])),A}var Rle=Ple;function Hx(o,A){this._earthCtrl=o,this._viewer=o.coreMap,this._cesium=_r,this._scene=o.coreMap.scene,this._Tooltip=new pw(o),this.loadingImg=`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`,this.tooltip=this._Tooltip.CreateTooltip(),this.FlattenIsDraw=!1,this.wallArr=[],this.hierarchy=[],this.tophierarchy=[],this.heightsort=[],this.FlattenPolygon=[],this.deepth=100,this.polygon=null,this.editPoint=[],this.nowPoint=null,this.editPosition=[],this.topPositions=null,this._volumeLabel=void 0,this._volumeLabel1=void 0,this._option=Ae(A.option,{}),this._irregularCut=Ae(A.irregularCut,!1),this.terrainFlatten=new _N(o.coreMap.scene),this.CreatePolygon(A.height,A.option,A.callback)}Hx.prototype.CreatePolygon=function(o,A,f){if(this.FlattenIsDraw)return;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=null),this.removeLabel(),this.addLoading(),this.FlattenIsDraw=!0;let m=this._viewer,C=this._cesium;this.deepth=o||this.deepth,this.removeFromMap(),!A&&(A={});let y=[],x=this.hierarchy,v=this.polygon,E,I=null,w=0,Q=this.heightsort,M=this.deepth,B=this.wallArr,T=this;this.drawHandler=new C.ScreenSpaceEventHandler(m.scene.canvas),m.scene.globe.depthTestAgainstTerrain=!0;let D=this.tooltip,F;this._viewer.container.style.cursor=`url(${window.SmartEarthRootUrl} 'Workers/image/cursor/draw.cur')`,this.drawHandler.setInputAction(function(V){E=R(V.position);let H=C.Cartographic.fromCartesian(E),q=C.Math.toDegrees(H.longitude),ie=C.Math.toDegrees(H.latitude),Z=H.height;y.push(E),x.push(q,ie,H.height),T.tophierarchy.push(q,ie,Z),w===0?(y.push(E),x.push(q,ie,H.height),F=m.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new C.CallbackProperty(()=>y,!1),clampToGround:!0,material:new C.ColorMaterialProperty(C.Color.YELLOW.withAlpha(.3)),width:3}})):w===1&&(F&&m.entities.remove(F),v=m.entities.add({name:null,id:T._earthCtrl.factory.createUUID(),polygon:{hierarchy:new C.PolygonHierarchy(C.Cartesian3.fromDegreesArrayHeights(x)),material:C.Color.YELLOW.withAlpha(.3)}}),v.polygon.hierarchy=new C.CallbackProperty(L,!1)),w++},C.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(function(V){if(w===0){D.showAt(V.endPosition,"\u5DE6\u952E\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u70B9");return}else w===1?D.showAt(V.endPosition,"\u70B9\u51FB\u6DFB\u52A0\u7B2C\u4E8C\u4E2A\u70B9"):D.showAt(V.endPosition,"\u53F3\u952E\u7ED3\u675F\u7ED8\u5236");E=R(V.endPosition);let H=C.Cartographic.fromCartesian(E),q=C.Math.toDegrees(H.longitude),ie=C.Math.toDegrees(H.latitude);x.splice(x.length-3,3),y.splice(y.length-1,1),y.push(E),x.push(q,ie,H.height)},C.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(function(V){this.end&&this.end()}.bind(this),C.ScreenSpaceEventType.RIGHT_CLICK),this.end=V=>{if(D.show(!1),T._viewer.container.style.cursor="default",T.drawHandler.destroy(),F&&m.entities.remove(F),v&&m.entities.remove(v),this.FlattenIsDraw=!1,this.end=void 0,V==="cancel"||y.length<3)return;if(w<2){w=0;return}w=0;for(let se=2;se<x.length;se=se+3)Q.push(x[se]);Q.sort(function(se,ce){return se-ce}),v=m.entities.add({name:null,id:T._earthCtrl.factory.createUUID(),polygon:{hierarchy:new C.CallbackProperty(function(){return new C.PolygonHierarchy(C.Cartesian3.fromDegreesArrayHeights(x))},!1),material:new C.ImageMaterialProperty({image:C.defaultValue(A.bottomImgUrl,`${window.SmartEarthRootUrl}Workers/image/bottomplane.jpg`),repeat:new C.Cartesian2(1,1)})}}),y.push(y[0]);let H,q,ie,Z,oe,ne;for(let se=0;se<y.length-1;se++){H=C.Cartographic.fromCartesian(y[se]),q=C.Cartographic.fromCartesian(y[se+1]),ie=C.Math.toDegrees(H.longitude),oe=C.Math.toDegrees(H.latitude),Z=C.Math.toDegrees(q.longitude),ne=C.Math.toDegrees(q.latitude),I?I=I>q.height?q.height:I:I=H.height>q.height?q.height:H.height;let ce=T.getPoint(ie,oe,Z,ne,H.height,q.height),j=[],de=[];T.getHeightsFromLonLat(ce.positions,function(me){if(me){j=me;for(let _e=0;_e<j.length;_e++)de.push(T.heightsort[0]-T.deepth);T.drawwall(ce.wallJwd,j,de)}})}v.polygon.height=Q[0]-M,this.FlattenPolygon.push(v),this.originHeight=Q[0],k(y),this.topPositions=y,typeof f=="function"&&f(y)};function L(){return new C.PolygonHierarchy(C.Cartesian3.fromDegreesArrayHeights(x))}function R(V){let H;if(m.scene.terrainProvider.constructor.name==="EllipsoidTerrainProvider")H=m.camera.pickEllipsoid(V,m.scene.globe.ellipsoid);else{let ie=m.scene.camera.getPickRay(V);H=m.scene.globe.pick(ie,m.scene)}if(m.scene.pick(V)){let ie=m.scene.pickPosition(V);if(ie){H=ie;let Z=C.Cartographic.fromCartesian(H),oe=m.scene.globe.getHeight(Z);Z.height=oe,H=C.Cartographic.toCartesian(Z)}}return H}function k(V){let H=m.scene.globe,q=V.concat();q.splice(q.length-1,1);for(let Z=0;Z<q.length-1;Z++)q[Z].x===q[Z+1].x&&q[Z].y===q[Z+1].y&&(q.splice(Z,1),Z--);let ie=q.length;if(U(q)&&q.reverse(),T.irregularCut){T.terrainFlatten.clearPolygon();let Z=[],oe=m.scene.globe.ellipsoid;for(let ne=0;ne<q.length;ne++){let se=oe.cartesianToCartographic(q[ne]),ce=C.Math.toDegrees(se.longitude),j=C.Math.toDegrees(se.latitude),de=se.height;Z.push(ce,j,de)}T.terrainFlatten.addPolygon(Z),T.terrainFlatten.update(),T.terrainFlatten.clipPlaneOfFlatten=!0}else{let Z=[];for(let oe=0;oe<ie;++oe){let ne=(oe+1)%ie,se=C.Cartesian3.add(q[oe],q[ne],new C.Cartesian3);se=C.Cartesian3.multiplyByScalar(se,.5,se);let ce=C.Cartesian3.normalize(se,new C.Cartesian3),j=C.Cartesian3.subtract(q[ne],se,new C.Cartesian3);j=C.Cartesian3.normalize(j,j);let de=C.Cartesian3.cross(j,ce,new C.Cartesian3);de=C.Cartesian3.normalize(de,de);let me=new C.Plane(de,0),_e=C.Plane.getPointDistance(me,se);Z.push(new C.ClippingPlane(de,_e))}H.clippingPlanes=new C.ClippingPlaneCollection({planes:Z})}}function U(V){if(V.length>=3)return!((V[1].x-V[0].x)*(V[2].y-V[1].y)-(V[1].y-V[0].y)*(V[2].x-V[1].x)>0)}return this};Hx.prototype.getPoint=function(o,A,f,m,C,y){let x=this,v=160,E=je.lerp(o,f,1/v)-o,I=je.lerp(A,m,1/v)-A,w=[],Q=[],M=[],B;w.push(o,A),B=ee.fromDegrees(o,A),Q.push(Kt.fromCartesian(B));for(let T=0;T<v;T++){let D=o+(T+1)*E,F=A+(T+1)*I;w.push(D,F),B=ee.fromDegrees(D,F),Q.push(Kt.fromCartesian(B))}return w.push(f,m),B=ee.fromDegrees(f,m),Q.push(Kt.fromCartesian(B)),{wallJwd:w,positions:Q}};Hx.prototype.getHeightsFromLonLat=function(o,A){let f=this._viewer,m=f.camera,C=[];if(this.isHaveTerrain(f))if(O(f.terrainProvider.availability)){let y=EQ(f.terrainProvider,o);Promise.resolve(y).then(function(x){x.forEach(function(v){C.push(v.height)}),typeof A=="function"&&A(C)})}else o.forEach(function(y){let x=f.scene.globe.getHeight(y);C.push(x)}),typeof A=="function"&&A(C);else o.forEach(function(y){C.push(f.scene.globe.getHeight(y))}),typeof A=="function"&&A(C)};Hx.prototype.isHaveTerrain=function(){return!!(this._viewer.scene&&this._viewer.scene.terrainProvider&&this._viewer.scene.terrainProvider._layers)};Hx.prototype.drawwall=function(o,A,f){let m=this,C=m._viewer.entities.add({wall:{positions:new Bn(function(){return ee.fromDegreesArray(o)},!1),maximumHeights:A,minimumHeights:f}}),y=C.wall;y.material=new z0({image:Ae(m._option.wallImgUrl,`${window.SmartEarthRootUrl}Workers/image/dzmc.jpg`),repeat:new It(1,1)}),m.wallArr.push(C)};Hx.prototype.setDeepth=function(o){this.FlattenPolygon[0]&&this.FlattenPolygon[0].polygon.height.setValue(this.originHeight-o),this.wallArr.forEach(A=>{let f=A.wall.minimumHeights.getValue();f=Array(f.length),f.fill(this.originHeight-o),A.wall.minimumHeights.setValue(f)})};Hx.prototype.edit=function(o){let A=this,f=A.editPoint,m=A.nowPoint;if(A._earthCtrl.coreMap.scene.globe.depthTestAgainstTerrain=!1,m){for(let x of A.editPoint)x&&(x.show=!0);A.update(m,f,o);return}for(let x=2;x<A.hierarchy.length;x=x+3)A.hierarchy[x]=A.originHeight-A.deepth;A.FlattenPolygon[0]&&A._viewer.entities.remove(A.FlattenPolygon[0]),A.FlattenPolygon=[];let C=this._viewer.entities.add({name:null,id:A._earthCtrl.factory.createUUID(),polygon:{hierarchy:new Un(ee.fromDegreesArrayHeights(A.hierarchy)),material:new z0({image:Ae(A._option.bottomImgUrl,`${window.SmartEarthRootUrl}Workers/image/bottomplane.jpg`),repeat:new It(1,1)}),perPositionHeight:!0}});A.FlattenPolygon.push(C);let y=A.FlattenPolygon[0].polygon.hierarchy.getValue();for(let x of y.positions){let v=this._viewer.entities.add({id:A._earthCtrl.factory.createUUID(),position:x,point:{color:At.WHITE,pixelSize:12,outlineColor:At.BLACK,outlineWidth:1}});f.push(v)}A._earthCtrl.measure.pickObject(null,function(x){let v=x.pickedObject.id;for(let E of f)if(v.id===E.id){A.nowPoint=E,A.update(E,f,o);return}})};Hx.prototype.endEdit=function(){let o=this;if(o._earthCtrl.coreMap.scene.globe.depthTestAgainstTerrain=!0,o.editPoint.length>0)for(let A of o.editPoint)A&&(A.show=!1)};Hx.prototype.excavationAndFill=function(){this.removeLabel();let o=this;this.endEdit(),o.topPositions&&(this.isLoading(!0),setTimeout(()=>{let A=null,f=null,m=!1;if(o.editPosition.length>0){let v=[];f=[];for(let E=0;E<o.editPosition.length-1;E++){let I=Kt.fromCartesian(o.editPosition[E]),w=je.toDegrees(I.longitude),Q=je.toDegrees(I.latitude),M=I.height;v.push(M),f.push(w,Q,M)}v.sort(function(E,I){return I-E}),A=v[0],m=!0}else A=o.heightsort[0]-o.deepth;let y=new Rle(o._earthCtrl,{positions:o.topPositions,baseHeight:A,basePositions:f,countBase:m}).start(),x=o.computeCentroidOfPolygon(o.topPositions);this._volumeLabel=this._viewer.entities.add({position:ee.fromRadians(x.longitude,x.latitude,o.heightsort[o.heightsort.length-1]),label:{text:`\u6316\u65B9\u4F53\u79EF\uFF1A${y.cutVolume}\u7ACB\u65B9\u7C73`,pixelOffset:{x:0,y:-30},font:"16px \u5B8B\u4F53",fillColor:At.GOLD,verticalOrigin:bn.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),this._volumeLabel1=this._viewer.entities.add({position:ee.fromRadians(x.longitude,x.latitude,o.heightsort[o.heightsort.length-1]),label:{text:`\u586B\u65B9\u4F53\u79EF\uFF1A${y.fillVolume}\u7ACB\u65B9\u7C73`,pixelOffset:{x:0,y:-70},font:"16px \u5B8B\u4F53",fillColor:At.GOLD,verticalOrigin:bn.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),this.isLoading(!1),console.log(y.result)},100))};Hx.prototype.computeCentroidOfPolygon=function(o){let A=[],f=[],m=0,C=0;for(let v=0;v<o.length;v++){let E=Kt.fromCartesian(o[v]);m+=E.longitude,C+=E.latitude,A.push(E.longitude),f.push(E.latitude)}let y=0,x=0;return y=m/o.length,x=C/o.length,new Kt(y,x)};Hx.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=this.loadingImg,o.appendChild(A),this.loading=o,this._viewer.container.appendChild(o)};Hx.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};Hx.prototype.update=function(o,A,f){let m=this,C=o.position.getValue(),x=m._scene.globe.ellipsoid.cartesianToCartographic(C),v=je.toDegrees(x.longitude),E=je.toDegrees(x.latitude),I=x.height;o.position.setValue(ee.fromDegrees(v,E,I+f)),m.editPoint=A,m.editPosition=[];let w=[];for(let M of A){let B=M.position.getValue();w.push(B),m.editPosition.push(B)}m.FlattenPolygon[0].polygon.hierarchy=new Bn(function(){return new Un(w)},!0);let Q=m.editPosition;Q.push(Q[0]);for(let M=0;M<Q.length-1;M++){let T=[];for(let D=0;D<=160;D++){let F=ee.lerp(Q[M],Q[M+1],D/160,new ee),L=Kt.fromCartesian(F);T.push(L.height)}m.wallArr[M].wall.minimumHeights.setValue(T)}};Hx.prototype.removeFromMap=function(){this.endEdit(),this._earthCtrl.tools.clearTool(),this.editPoint=[],this.nowPoint=null;let o=this._viewer;if(this.wallArr.length>0){for(let A=0;A<this.wallArr.length;A++)o.entities.remove(this.wallArr[A]);this.wallArr=[]}o.scene.globe.clippingPlanes&&o.scene.globe.clippingPlanes.removeAll(),this.FlattenPolygon&&this.FlattenPolygon.length>0&&(this.FlattenPolygon.forEach(function(A){o.entities.remove(A)}),this.FlattenPolygon=[]),this.FlattenIsDraw=!1,this.removeLabel(),this.terrainFlatten&&this.terrainFlatten.clearPolygon()};Hx.prototype.removeLabel=function(){this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0)};var Lle=Hx;function _C(o,A={}){this._earthCtrl=o,this._viewer=o.coreMap,this._scene=o.coreMap.scene,this.options=Ae(A,{}),this._Tooltip=new pw(o),this._tooltip=this._Tooltip.CreateTooltip(),this._drawColor={point:Ae(this.options.drawColor?.point,At.BLUE),polyline:Ae(this.options.drawColor?.polyline,At.YELLOW),polygon:Ae(this.options.drawColor?.point,At.YELLOW.withAlpha(.5))},this.selectDatum=!0,this.onlyTerrain=!0,this.tin=!1,this._volumeTin=[],this.loadingImg=`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`,this.unit=Ae(A.unit,"km\xB3")}_C.prototype.removeFromMap=function(){this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._prevEntity1!==void 0&&(this._viewer.entities.remove(this._prevEntity1),this._prevEntity1=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._volumeTin.forEach(o=>{this._viewer.entities.remove(o)}),this._volumeTin=[],this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=void 0),this.Triangulation=[],this.tinData=void 0,this._tooltip.show(!1)};_C.prototype.deleteObject=_C.prototype.removeFromMap;_C.prototype.startDrawing=function(o={},A="auto",f){let m=this._scene,C=this._tooltip,y=3,x=[],v=[],E=[],I;this._positions=v,this._degreesArr=E,this._drawColor.point=o.point||this._drawColor.point,this._drawColor.polyline=o.polyline||this._drawColor.polyline,this._drawColor.polygon=o.polygon||this._drawColor.polygon,this.loadingImg=o.loading||this.loadingImg,this.tin=Ae(o.tin,!0),this.onlyTerrain=Ae(o.onlyTerrain,!1),this.selectDatum=Ae(o.selectDatum,!0);let w=this;this._mouseHandler&&this._mouseHandler.destroy(),this.loading||this.addLoading();let Q=new Ur(m.canvas);this._mouseHandler=Q,this.removeFromMap(),this._viewer.container.style.cursor=`url(${globalThis.GEOWORLD_BASE_URL} 'Workers/image/cursor/draw.cur')`;let M;Q.setInputAction(function(T){if(T.position!==null){let D=m.camera.getPickRay(T.position),F=m.globe.pick(D,m);if(this._viewer.scene.pick(T.position)){let R=this._viewer.scene.pickPosition(T.position);R&&(F=R)}if(F){let R=Kt.fromCartesian(F),k=je.toDegrees(R.longitude),U=je.toDegrees(R.latitude);if(x.length===0&&(x.push(k,U),E.push([k,U]),v.push(F),I=F),v.length>=4){let V=Ss.wgs84ToWindowCoordinates(this._viewer.scene,I);if(V!==void 0){let H=V.x-T.position.x,q=V.y-T.position.y;if(H*H+q*q<16){x.splice(x.length-2,2),v.pop(),this.stopDrawing(f);return}}}x.push(k,U),E.push([k,U]),v.push(F),v.length===2&&!M&&(M=this._viewer.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new Bn(function(){return v},!1),clampToGround:!0,material:w._drawColor.polygon,width:3}})),v.length===y&&(M&&this._viewer.entities.remove(M),this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:new Un(ee.fromDegreesArray(x)),material:w._drawColor.polygon,fill:!0}}),this._prevEntity.polygon.hierarchy=new Bn(B,!1))}}}.bind(this),Ki.LEFT_CLICK),Q.setInputAction(function(T){let D=T.endPosition;if(D!==null)if(v.length===0)C.showAt(D,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7B2C\u4E00\u4E2A\u70B9");else{let F=m.camera.getPickRay(D),L=m.globe.pick(F,m),R=this._viewer.scene.pick(D),k=!1;if(R){let U=this._viewer.scene.pickPosition(D);U&&(L=U),k=!0}if(L){let U=Kt.fromCartesian(L),V=je.toDegrees(U.longitude),H=je.toDegrees(U.latitude);if(x.splice(x.length-2,2),E.pop(),v.pop(),x.push(V,H),E.push([V,H]),v.push(L),C.showAt(D,"\u53F3\u952E\u7ED3\u675F\u7ED8\u5236"),v.length>=3&&v.length>=4){let q=Ss.wgs84ToWindowCoordinates(this._viewer.scene,I);if(q!==void 0){let ie=q.x-D.x,Z=q.y-D.y;ie*ie+Z*Z<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}}.bind(this),Ki.MOUSE_MOVE),Q.setInputAction(function(T){this.end&&this.end()}.bind(this),Ki.RIGHT_CLICK);function B(){return new Un(ee.fromDegreesArray(x))}return this.end=T=>{if(this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),w._viewer.container.style.cursor="default",this._tooltip.show(!1),M&&this._viewer.entities.remove(M),this.end=void 0,!(v.length<y)){if(this._prevEntity&&(this._prevEntity.polygon.hierarchy=ee.fromDegreesArray(x)),T==="cancel"){this._prevEntity&&this._viewer.entities.remove(this._prevEntity);return}this.stopDrawing(A,f)}},this};_C.prototype.stopDrawing=function(o,A){this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._volumeTin.forEach(f=>{this._viewer.entities.remove(f)}),this._volumeTin=[],this.isLoading(!0),setTimeout(()=>{let f=this.computeCutVolume(o,this.onlyTerrain),m=C=>{let y=C.maxHeight,x=C.minHeight;this._prevEntity.polygon.height=C.minHeight,this._prevEntity.polygon.heightReference=0;let v={id:this._earthCtrl.factory.createUUID(),polygon:{hierarchy:{positions:this._positions},height:x,extrudedHeight:y,closeTop:!1,closeBottom:!1,material:At.CYAN.withAlpha(.2),outline:!0,outlineColor:At.RED,outlineWidth:2}};if(this._prevEntity1=this._viewer.entities.add(v),typeof A=="function"&&A(C),this.selectDatum){let E=()=>{this.addPoint(I=>{this.setDatum(I,w=>{typeof A=="function"&&A({...C,...w}),E()})})};E()}};this.onlyTerrain?f.then(C=>{m(C)}):m(f)},100)};_C.prototype.computeCentroidOfPolygon=function(o){let A=[],f=[],m=0,C=0;for(let v=0;v<o.length;v++){let E=Kt.fromCartesian(o[v]);m+=E.longitude,C+=E.latitude,A.push(E.longitude),f.push(E.latitude)}let y=0,x=0;return y=m/o.length,x=C/o.length,new Kt(y,x)};_C.prototype.computeCutVolume=function(o,A){let f=this,m=15e3,C=-15e3;if(o==="auto"){let E=wi.fromPoints(this._positions);console.log("BoundingSphere.radius",E.radius),o=E.radius/20}let y=this.getPointsInPolygon(this._degreesArr,o,!0),x=Zl.polygon([this._degreesArr]),v=()=>{let{tin:E}=this.tinFromPoints(y,{getArea:!0,polygon:x});this.tinData=E;let I={fill:0,dig:0},w,Q,M,B,T;this.Triangulation=[],E.features.forEach(L=>{if(L.positions){if(this.tin){let k=this._viewer.entities.add({polygon:{hierarchy:new Un(L.positions),material:this._drawColor.polygon,perPositionHeight:!0,outline:!0,outlineColor:At.YELLOW}});this._volumeTin.push(k)}let R=L.geometry.coordinates[0];w=R[0][2],Q=R[1][2],M=R[2][2],T=L.area,this.Triangulation.push({bottomArea:T,height:[w,Q,M]}),B=(w-m+Q-m+M-m)/3,B>0?I.dig=I.dig+T*B:I.fill=I.fill-T*B}});let D=this.computeCentroidOfPolygon(this._positions);this.unit!=="m\xB3"&&(I.dig=I.dig/1e9,I.fill=I.fill/1e9);let F=this.unit==="m\xB3"?"\u7ACB\u65B9\u7C73":"\u7ACB\u65B9\u5343\u7C73";return this._volumeLabel=this._viewer.entities.add({position:ee.fromRadians(D.longitude,D.latitude,C),label:{text:`\u6316\u65B9\u4F53\u79EF\uFF1A${I.dig.toFixed(4)}${F}`,pixelOffset:{x:0,y:-30},font:"16px \u5B8B\u4F53",fillColor:At.GOLD,verticalOrigin:bn.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),this._volumeLabel1=this._viewer.entities.add({position:ee.fromRadians(D.longitude,D.latitude,C),label:{text:`\u586B\u65B9\u4F53\u79EF\uFF1A${I.fill.toFixed(4)}${F}`,pixelOffset:{x:0,y:-70},font:"16px \u5B8B\u4F53",fillColor:At.GOLD,verticalOrigin:bn.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),this.isLoading(!1),{maxHeight:C,minHeight:m,volume:I,unit:this.unit,spacing:o}};if(A){let E=[];return y.features.forEach(w=>{let Q=w.geometry.coordinates;E.push(Kt.fromDegrees(Q[0],Q[1]))}),EQ(this._viewer.scene.globe.terrainProvider,E).then(w=>(y.features.forEach((Q,M)=>{let B=Q.geometry.coordinates;B[2]=w[M]&&w[M].height?w[M].height:0,C<B[2]&&(C=B[2]),m>B[2]&&(m=B[2])}),v()))}return y.features.forEach(E=>{let I=E.geometry.coordinates,w=new Kt(je.toRadians(I[0]),je.toRadians(I[1]));I[2]=this._viewer.scene.sampleHeight(w)||0,C<I[2]&&(C=I[2]),m>I[2]&&(m=I[2])}),v()};_C.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=this.loadingImg,o.appendChild(A),this.loading=o,this._viewer.container.appendChild(o)};_C.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};_C.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};_C.prototype.addPoint=function(o){this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=null),this._prevEntity1&&(this.addPointHandle=new Ur(this._viewer.scene.canvas),this.addPointHandle.setInputAction(function(A){let f=this._viewer.scene.pick(A.position);if(f&&f.id&&f.id.id===this._prevEntity1.id){let m=this._viewer.scene.pickPosition(A.position);if(m){let C=Kt.fromCartesian(m);this.addPointHandle.destroy(),this.addPointHandle=null,o&&typeof o=="function"&&o(C.height.toFixed(1))}}}.bind(this),Ki.LEFT_CLICK),this.addPointHandle.setInputAction(function(A){let f=this._viewer.scene.pick(A.endPosition);f&&f.id&&f.id.id===this._prevEntity1.id?this._tooltip.showAt(A.endPosition,"\u70B9\u51FB\u4FEE\u6539\u57FA\u51C6\u9762\u9AD8\u5EA6"):this._tooltip.show(!1)}.bind(this),Ki.MOUSE_MOVE))};_C.prototype.showTin=function(o){this.tin=o,this._volumeTin.forEach(A=>{this._viewer.entities.remove(A)}),this._volumeTin=[],o&&this.tinData&&this.tinData.features.forEach(A=>{if(A.positions){let f=this._viewer.entities.add({polygon:{hierarchy:new Un(A.positions),material:this._drawColor.polygon,perPositionHeight:!0,outline:!0,outlineColor:At.YELLOW}});this._volumeTin.push(f)}})};_C.prototype.setDatum=function(o,A){if(this.Triangulation&&this.Triangulation.length>0){let f,m,C,y={fill:0,dig:0};this.Triangulation.forEach(function(v){f=v.bottomArea,m=v.height,C=(m[0]-o+m[1]-o+m[2]-o)/3,C>0?y.dig=y.dig+f*C*scale.dig:y.fill=y.fill-f*C*scale.fill}),this.unit!=="m\xB3"&&(y.dig=y.dig/1e9,y.fill=y.fill/1e9);let x=this.unit==="m\xB3"?"\u7ACB\u65B9\u7C73":"\u7ACB\u65B9\u5343\u7C73";this._volumeLabel.label.text=`\u6316\u65B9\u4F53\u79EF\uFF1A${y.dig.toFixed(4)}${x}`,this._volumeLabel1.label.text=`\u586B\u65B9\u4F53\u79EF\uFF1A${y.fill.toFixed(4)}${x}`,this._prevEntity.polygon.height=o,A&&typeof A=="function"&&A({volume:y,unit:this.unit})}};_C.prototype.getPointsInPolygon=function(o,A=50,f=!0){if(o.length<3)return;o.push(o[0]);let m=Zl.lineString(o),C=Zl.bbox(m),y=Zl.pointGrid(C,A,{units:"meters"}),x=Zl.polygon([o]),v=Zl.pointsWithinPolygon(y,x);if(f)for(let E=0;E<o.length-1;E++){let I=Zl.lineString([o[E],o[E+1]]),w={units:"meters"},Q=Zl.length(I,w),M;for(let B=A;;B+=A)if(B<=Q)M=Zl.along(I,B,w),v.features.push(M);else{M=Zl.along(I,Q,w),v.features.push(M);break}}return v};_C.prototype.tinFromPoints=function(o,A={}){let{polygon:f,getArea:m}=A,C=Zl.tin(o),y=0;return C&&C.features&&C.features.forEach(x=>{let v=!0;if(f){let E=Zl.centerOfMass(x);v=Zl.booleanPointInPolygon(E,f)}if(v){let E=x.geometry.coordinates[0],I=[],w=[];for(let Q=0;Q<3;Q++)I.push([E[Q][0],E[Q][1]]),w.push(ee.fromDegrees(E[Q][0],E[Q][1],E[Q][2]));x.positions=w,m&&(x.area=this.getArea(I,w,!0),y+=x.area)}}),{tin:C,area:y}};_C.prototype.getArea=function(o,A,f){if(o.length<3)return;o.push(o[0]);let m=o,C=0,y=Zl.polygon([m]),x;m.length===4?x=[y]:x=Zl.tesselate(y).features;let v,E,I,w;return x.forEach(Q=>{v=Q.geometry.coordinates[0],E=m.findIndex(F=>F.toString()===v[0].toString()),I=m.findIndex(F=>F.toString()===v[1].toString()),w=m.findIndex(F=>F.toString()===v[2].toString());let M=this.getdistance(A[E],A[I]),B=this.getdistance(A[I],A[w]),T=this.getdistance(A[E],A[w]),D=(M+B+T)/2;C+=Math.sqrt(D*((D-M)*(D-B)*(D-T)))}),f||(C<1e6?C=`${C.toFixed(2)}\u5E73\u65B9\u7C73`:C=`${(C/1e6).toFixed(2)}\u5E73\u65B9\u5343\u7C73`),C};_C.prototype.getdistance=function(o,A){let f=Kt.fromCartesian(o),m=Kt.fromCartesian(A),C=Di.MOON2000,x=new l0(f,m,C).surfaceDistance;return x=Math.sqrt(Math.pow(x,2)+Math.pow(m.height-f.height,2)),x};var BAt=_C;function Fle(o){this.mEarthCtrl=o,this._polylines=[],this._resPolylines=[],this._points=[],this.entities=this.mEarthCtrl.entities,this.camera=this.mEarthCtrl.coreMap.camera,this.scene=this.mEarthCtrl.coreMap.scene}Fle.prototype.createLineOfSight=function(o){let A=[],f=this,m=[],C=[],y={polyline:[]};f.objectsToExclude=null;let x,v=function(){function M(B){this.options={polyline:{show:!0,positions:[],material:At.YELLOW,width:3,clampToGround:!1}},this.positionsp=B,this._init()}return M.prototype._init=function(){let B=this,T=function(){return B.positionsp};this.options.polyline.positions=new Bn(T,!1),this.polyline=f.entities.add(this.options),f.item=this.polyline,C.push(this.polyline)},M}(),E=new Ur(f.scene.canvas),I=[],w;if(this._points.length>0)for(let M=0;M<this._points.length;M++)this.entities.remove(this._points[M]);let Q=[];return E.setInputAction(function(M){let B,T=new ee(0,0,0);if(new ja(f.mEarthCtrl).pickVector(M.position,T)&&(B=T),!!B)if(I.length===0){I.push(B.clone(),B.clone());let F={leftX:M.position.x,leftY:M.position.y};Q.push(F),x=B.clone()}else{let F={rightX:M.position.x,rightY:M.position.y};Q.push(F);let L={postion:I,entity:C,cartesian:Q};m.push(L),Q=[],w=void 0,I=[],I.push(x.clone()),I.push(x.clone()),w=new v(I),A.push(w)}},Ki.LEFT_CLICK),E.setInputAction(function(M){let B,T=f.camera.getPickRay(M.endPosition);if(B=f.scene.globe.pick(T,f.scene),f.scene.pick(M.endPosition)){let F=f.scene.pickPosition(M.endPosition);F&&(B=F)}!B||I.length>=2&&(O(w)?B!==void 0&&(I.pop(),I.push(B)):(w=new v(I),A.push(w)))},Ki.MOUSE_MOVE),E.setInputAction(function(M){let B=f.entities.add(new UA);f.objectsToExclude=[B];let T=!0;for(let D=0;D<m.length;D++)D===0?T=f.tsjx(m[0].postion[0],m[0].postion[1]):T=f.tsjx(m[D].postion[0],m[D].postion[1]);I.pop(),f._polylines=y.polyline,E.destroy();for(let D=0;D<C.length;D++)f.entities.remove(C[D]);O(o)&&typeof o=="function"&&o(y)},Ki.RIGHT_CLICK),this};Fle.prototype.tsjx=function(o,A){let f=this,m=ee.normalize(ee.subtract(A,o,new ee),new ee),C=new ls(o,m),y=f.scene.globe.pick(C,f.scene);y!=null?(x(y,o,At.GREEN),x(y,A,At.RED)):x(o,A,At.GREEN);function x(v,E,I){let w=f.entities.add({polyline:{positions:[v,E],width:1,material:I,depthFailMaterial:I}});f._resPolylines.push(w)}return!1};Fle.prototype.deleteObject=function(){if(this._points.length>0){this.objectsToExclude=null;for(let o=0;o<this._points.length;o++)this.entities.remove(this._points[o])}if(this._resPolylines.length>0){for(let o=0;o<this._resPolylines.length;o++)this.entities.remove(this._resPolylines[o]);this._resPolylines=[]}};var wAt=Fle;function _h(o,A={}){this._earthCtrl=o,this._viewer=o.coreMap,this._scene=o.coreMap.scene,this.options=Ae(A,{}),this._Tooltip=new pw(o),this._tooltip=this._Tooltip.CreateTooltip(),this._drawColor={point:Ae(this.options.drawColor?.point,At.BLUE),polyline:Ae(this.options.drawColor?.polyline,At.YELLOW),polygon:Ae(this.options.drawColor?.polygon,At.YELLOW.withAlpha(.5))},this.selectDatum=!0,this.onlyTerrain=!0,this.tin=!1,this._volumeTin=[],this.loadingImg=`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`,this.wallArr=[],this.FlattenPolygon=[],this._Apositions=[],this._heightsort=null,this._deepth=100,this._positions=[],this._modelArr=Ae(A.modelArr,[]),this._isFlattening=Ae(A.isFlattening,!0),this.modelCuttingPolygon=null,this.wallImgUrl=Ae(A.wallImgUrl,null),this.bottomImgUrl=Ae(A.bottomImgUrl,null),this.calculate=Ae(A.calculate,!0),this._Loading=Ae(A.loading,!0),this.editPoint=[],this.nowPoint=null,this.hierarchy=[],this._originHeight=null}_h.prototype.removeMeasureFromMap=function(){this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._prevEntity1!==void 0&&(this._viewer.entities.remove(this._prevEntity1),this._prevEntity1=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._volumeTin.forEach(o=>{this._viewer.entities.remove(o)}),this._volumeTin=[],this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=void 0),this.Triangulation=[],this.tinData=void 0,this._tooltip.show(!1)};_h.prototype.removeFromMap=function(){if(this.endEdit(),this.removeMeasureFromMap(),this.wallArr.length>0){for(let o=0;o<this.wallArr.length;o++)this._viewer.entities.remove(this.wallArr[o]);this.wallArr=[]}if(this.FlattenPolygon&&this.FlattenPolygon.length>0){for(let o=0;o<this.FlattenPolygon.length;o++)this._viewer.entities.remove(this.FlattenPolygon[o]);this.FlattenPolygon=[]}this.removeModelCutting()};_h.prototype.deleteObject=_h.prototype.removeFromMap;_h.prototype.startDrawing=function(o={},A){let f=Ae(o.spacing,"auto"),m=this._scene,C=this._tooltip,y=3,x=[],v=[],E=[],I=[],w=[],Q;this._Apositions=o.positions,this._positions=v,this._hierarchy=E,this._heightsort=I,this._degreesArr=w,this._deepth=Ae(o.deepth,100),this._drawColor.point=o.point||this._drawColor.point,this._drawColor.polyline=o.polyline||this._drawColor.polyline,this._drawColor.polygon=o.polygon||this._drawColor.polygon,this.loadingImg=o.loading||this.loadingImg,this.tin=Ae(o.tin,!1),this.onlyTerrain=Ae(o.onlyTerrain,!1),this.selectDatum=Ae(o.selectDatum,!1);let M=this;if(this._mouseHandler&&this._mouseHandler.destroy(),this.loading||this.addLoading(),o.positions){let B=ee.fromDegreesArray(o.positions);for(let T of B)v.push(T);if(!(v.length<y)){for(let T=0;T<o.positions.length;T+=2)w.push([o.positions[T],o.positions[T+1]]);this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:ee.fromDegreesArray(o.positions),material:M._drawColor.polygon,fill:!0}});for(let T=0;T<o.positions.length;T+=2){let D=M._viewer.scene.sampleHeight(new Kt(je.toRadians(o.positions[T]),je.toRadians(o.positions[T+1])));I.push(D),E.push(o.positions[T],o.positions[T+1],D)}this.stopDrawing(f,T=>{A&&A(T)})}}else{let B=new Ur(m.canvas);this._mouseHandler=B,this.removeMeasureFromMap(),this._viewer.container.style.cursor=`url(${globalThis.GEOWORLD_BASE_URL} 'Workers/image/cursor/draw.cur')`;let T;B.setInputAction(function(F){if(F.position!==null){let L=m.camera.getPickRay(F.position),R=m.globe.pick(L,m);if(this._viewer.scene.pick(F.position)){let U=this._viewer.scene.pickPosition(F.position);U&&(R=U)}if(R){let U=Kt.fromCartesian(R),V=je.toDegrees(U.longitude),H=je.toDegrees(U.latitude);if(x.length===0&&(x.push(V,H),w.push([V,H]),v.push(R),Q=R),v.length>=4){let q=Ss.wgs84ToWindowCoordinates(this._viewer.scene,Q);if(q!==void 0){let ie=q.x-F.position.x,Z=q.y-F.position.y;if(ie*ie+Z*Z<16){x.splice(x.length-2,2),v.pop(),this.stopDrawing(A);return}}}x.push(V,H),w.push([V,H]),v.push(R),v.length===2&&!T&&(T=this._viewer.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new Bn(function(){return v},!1),clampToGround:!0,material:M._drawColor.polygon,width:3}})),v.length===y&&(T&&this._viewer.entities.remove(T),this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:new Un(ee.fromDegreesArray(x)),material:M._drawColor.polygon,fill:!0}}),this._prevEntity.polygon.hierarchy=new Bn(()=>new Un(ee.fromDegreesArray(x)),!1))}}}.bind(this),Ki.LEFT_CLICK),B.setInputAction(function(F){let L=F.endPosition;if(L!==null)if(v.length===0)C.showAt(L,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7B2C\u4E00\u4E2A\u70B9");else{let R=m.camera.getPickRay(L),k=m.globe.pick(R,m),U=this._viewer.scene.pick(L),V=!1;if(U){let H=this._viewer.scene.pickPosition(L);H&&(k=H),V=!0}if(k){let H=Kt.fromCartesian(k),q=je.toDegrees(H.longitude),ie=je.toDegrees(H.latitude);if(x.splice(x.length-2,2),w.pop(),v.pop(),x.push(q,ie),w.push([q,ie]),v.push(k),C.showAt(L,"\u53F3\u952E\u7ED3\u675F\u7ED8\u5236"),v.length>=3&&v.length>=4){let Z=Ss.wgs84ToWindowCoordinates(this._viewer.scene,Q);if(Z!==void 0){let oe=Z.x-L.x,ne=Z.y-L.y;oe*oe+ne*ne<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}}.bind(this),Ki.MOUSE_MOVE);let D=null;B.setInputAction(function(F){D=window.setTimeout(()=>{console.log("\u5355\u51FB"),this.end&&this.end()},200)}.bind(this),Ki.RIGHT_CLICK),B.setInputAction(function(F){console.log("\u53CC\u51FB......"),clearTimeout(D)},Ki.LEFT_DOUBLE_CLICK),this.end=F=>{if(this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),M._viewer.container.style.cursor="default",this._tooltip.show(!1),T&&this._viewer.entities.remove(T),this.end=void 0,console.log(w,"?????????"),!(v.length<y)){if(this._prevEntity&&(this._prevEntity.polygon.hierarchy=ee.fromDegreesArray(x)),F==="cancel"){this._prevEntity&&this._viewer.entities.remove(this._prevEntity);return}for(let L=0;L<x.length;L+=2){let R=M._viewer.scene.sampleHeight(new Kt(je.toRadians(x[L]),je.toRadians(x[L+1])));I.push(R),E.push(x[L],x[L+1],R)}this._Apositions=x,this.stopDrawing(f,A)}}}return this};_h.prototype.stopDrawing=function(o,A){let f=this;this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._volumeTin.forEach(m=>{this._viewer.entities.remove(m)}),this._volumeTin=[],this._Loading&&this.isLoading(!0),setTimeout(()=>{f._heightsort.sort(function(T,D){return T-D});let m=this._viewer.entities.add({name:null,id:f._earthCtrl.factory.createUUID(),polygon:{hierarchy:new Bn(function(){return new Un(ee.fromDegreesArrayHeights(f._hierarchy))},!1),material:new z0({image:Ae(f.bottomImgUrl,`${window.SmartEarthRootUrl}Workers/image/bottomplane.jpg`),repeat:new It(1,1)})}});f.FlattenPolygon.push(m),f.originHeight=f._heightsort[0];let C=ee.fromDegreesArrayHeights(f._hierarchy);C.push(C[0]),f._positionsB=C;let y=null,x,v,E,I,w,Q;for(let T=0;T<C.length-1;T++){x=Kt.fromCartesian(C[T]),v=Kt.fromCartesian(C[T+1]),E=je.toDegrees(x.longitude),w=je.toDegrees(x.latitude),I=je.toDegrees(v.longitude),Q=je.toDegrees(v.latitude),y?y=y>v.height?v.height:y:y=x.height>v.height?v.height:x.height;let D=f.getPoint(E,w,I,Q,x.height,v.height),F=[],L=[];f.getHeightsFromLonLat(D.positions,function(R){if(R){F=R;for(let k=0;k<F.length;k++)L.push(f._heightsort[0]-f._deepth);f.drawwall(D.wallJwd,F,L)}})}if(f._baseHeight=f._heightsort[0]-f._deepth,m.polygon.height=f._baseHeight,!this.calculate)return f._isFlattening&&f.modelCutting(),A&&A(!0),this.isLoading(!1);let M=this.computeCutVolume(o,this.onlyTerrain),B=T=>{let D=T.maxHeight,F=T.minHeight;if(this._prevEntity.polygon.height=T.minHeight,this._prevEntity.polygon.heightReference=0,this.selectDatum){let L=()=>{this.addPoint(R=>{this.setDatum(R,k=>{typeof A=="function"&&A({...T,...k}),L()})})};L()}};this.onlyTerrain?M.then(T=>{B(T)}):B(M),f.setDatum(f._baseHeight,T=>{f._isFlattening&&f.modelCutting(),A&&A(T),this._Loading&&this.isLoading(!1)})},100)};_h.prototype.modelCutting=function(){let o=this;if(o._modelCuttingPolygon=rh.fromPositions({positions:ee.fromDegreesArray(o._Apositions),height:o._baseHeight}),o._modelArr.length>0)for(let A of o._modelArr)A.addFlattenPolygon(o._modelCuttingPolygon),A.needUpdateFlatten=!0,A.clipPlaneOfFlatten=!0;else console.info("\u8BF7\u6DFB\u52A0\u6A21\u578B\uFF01")};_h.prototype.removeModelCutting=function(){let o=this;if(o._modelArr.length>0){for(let A of o._modelArr)A.removeFlattenPolygon(o._modelCuttingPolygon);o._modelCuttingPolygon=null,o._modelArr=[]}else console.info("\u8BF7\u6DFB\u52A0\u6A21\u578B\uFF01")};_h.prototype.computeCentroidOfPolygon=function(o){let A=[],f=[],m=0,C=0;for(let v=0;v<o.length;v++){let E=Kt.fromCartesian(o[v]);m+=E.longitude,C+=E.latitude,A.push(E.longitude),f.push(E.latitude)}let y=0,x=0;return y=m/o.length,x=C/o.length,new Kt(y,x)};_h.prototype.edit=function(o,A,f){let m=this,C=m.editPoint,y=m.nowPoint;if(m._earthCtrl.coreMap.scene.globe.depthTestAgainstTerrain=!1,y){for(let E of m.editPoint)E&&(E.show=!0);m.update(y,C,o);return}for(let E=2;E<m._hierarchy.length;E=E+3)m._hierarchy[E]=m.originHeight-m._deepth;m.FlattenPolygon[0]&&m._viewer.entities.remove(m.FlattenPolygon[0]),m.FlattenPolygon=[];let x=this._viewer.entities.add({name:null,id:m._earthCtrl.factory.createUUID(),polygon:{hierarchy:new Un(ee.fromDegreesArrayHeights(m._hierarchy)),material:new z0({image:Ae(m.bottomImgUrl,`${window.SmartEarthRootUrl}Workers/image/bottomplane.jpg`),repeat:new It(1,1)}),perPositionHeight:!0}});m.FlattenPolygon.push(x);let v=m.FlattenPolygon[0].polygon.hierarchy.getValue();for(let E of v.positions){let I=this._viewer.entities.add({id:m._earthCtrl.factory.createUUID(),position:E,point:{color:At.WHITE,pixelSize:12,outlineColor:At.BLACK,outlineWidth:1}});C.push(I)}if(o)if(A){for(let E of C)if(A===E.id){m.nowPoint=E,m.update(E,C,o);return}}else m._earthCtrl.measure.pickObject(null,function(E){let I=E.pickedObject.id;for(let w of C)if(I.id===w.id){m.nowPoint=w,m.update(w,C,o);return}});else f&&f(C)};_h.prototype.update=function(o,A,f){let m=this,C=o.position.getValue(),x=m._scene.globe.ellipsoid.cartesianToCartographic(C),v=je.toDegrees(x.longitude),E=je.toDegrees(x.latitude),I=x.height;o.position.setValue(ee.fromDegrees(v,E,I+f)),m.editPoint=A,m.editPosition=[];let w=[];for(let M of A){let B=M.position.getValue();w.push(B),m.editPosition.push(B)}m.FlattenPolygon[0].polygon.hierarchy=new Bn(function(){return new Un(w)},!0);let Q=m.editPosition;Q.push(Q[0]);for(let M=0;M<Q.length-1;M++){let T=[];for(let D=0;D<=160;D++){let F=ee.lerp(Q[M],Q[M+1],D/160,new ee),L=Kt.fromCartesian(F);T.push(L.height)}m.wallArr[M].wall.minimumHeights.setValue(T)}};_h.prototype.endEdit=function(){let o=this;if(o._earthCtrl.coreMap.scene.globe.depthTestAgainstTerrain=!0,o.editPoint.length>0)for(let A of o.editPoint)A&&(A.show=!1)};_h.prototype.computeCutVolume=function(o,A){let f=this,m=15e3,C=-15e3;o==="auto"&&(o=wi.fromPoints(this._positions).radius/20);let y=this.getPointsInPolygon(this._degreesArr,o,!0),x=Zl.polygon([this._degreesArr]),v=()=>{let{tin:E}=this.tinFromPoints(y,{getArea:!0,polygon:x});this.tinData=E;let I={fill:0,dig:0},w={fill:"\u7ACB\u65B9\u7C73",dig:"\u7ACB\u65B9\u7C73"},Q,M,B,T,D,F={fill:1,dig:1};this.Triangulation=[],E.features.forEach(R=>{if(R.positions){if(this.tin){let U=this._viewer.entities.add({polygon:{hierarchy:new Un(R.positions),material:this._drawColor.polygon,perPositionHeight:!0,outline:!0,outlineColor:At.YELLOW}});this._volumeTin.push(U)}let k=R.geometry.coordinates[0];Q=k[0][2],M=k[1][2],B=k[2][2],D=R.area,this.Triangulation.push({bottomArea:D,height:[Q,M,B]}),T=(Q-m+M-m+B-m)/3,T>0?I.dig=I.dig+D*T*F.dig:I.fill=I.fill-D*T*F.fill,I.dig>1e10&&w.dig==="\u7ACB\u65B9\u7C73"&&(I.dig=I.dig/1e9,w.dig="\u7ACB\u65B9\u5343\u7C73",F.dig=1e-9),I.fill>1e10&&w.fill==="\u7ACB\u65B9\u7C73"&&(I.fill=I.fill/1e9,w.fill="\u7ACB\u65B9\u5343\u7C73",F.fill=1e-9)}});let L=this.computeCentroidOfPolygon(this._positions);return this._volumeLabel=this._viewer.entities.add({position:ee.fromRadians(L.longitude,L.latitude,C),label:{text:`\u6316\u65B9\u4F53\u79EF\uFF1A${I.dig.toFixed(4)}${w.dig}`,pixelOffset:{x:0,y:-30},font:"16px \u5B8B\u4F53",fillColor:At.GOLD,verticalOrigin:bn.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),this._volumeLabel1=this._viewer.entities.add({position:ee.fromRadians(L.longitude,L.latitude,C),label:{text:`\u586B\u65B9\u4F53\u79EF\uFF1A${I.fill.toFixed(4)}${w.fill}`,pixelOffset:{x:0,y:-70},font:"16px \u5B8B\u4F53",fillColor:At.GOLD,verticalOrigin:bn.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),{maxHeight:C,minHeight:m,volume:I,unit:w,spacing:o}};if(A){let E=[];return y.features.forEach(w=>{let Q=w.geometry.coordinates;E.push(Kt.fromDegrees(Q[0],Q[1]))}),EQ(this._viewer.scene.globe.terrainProvider,E).then(w=>(y.features.forEach((Q,M)=>{let B=Q.geometry.coordinates;B[2]=w[M]&&w[M].height?w[M].height:0,C<B[2]&&(C=B[2]),m>B[2]&&(m=B[2])}),v()))}return y.features.forEach(E=>{let I=E.geometry.coordinates,w=new Kt(je.toRadians(I[0]),je.toRadians(I[1]));I[2]=this._viewer.scene.sampleHeight(w)||0,C<I[2]&&(C=I[2]),m>I[2]&&(m=I[2])}),v()};_h.prototype.getPoint=function(o,A,f,m,C,y){let x=this,v=160,E=je.lerp(o,f,1/v)-o,I=je.lerp(A,m,1/v)-A,w=[],Q=[],M=[],B;w.push(o,A),B=ee.fromDegrees(o,A),Q.push(Kt.fromCartesian(B));for(let T=0;T<v;T++){let D=o+(T+1)*E,F=A+(T+1)*I;w.push(D,F),B=ee.fromDegrees(D,F),Q.push(Kt.fromCartesian(B))}return w.push(f,m),B=ee.fromDegrees(f,m),Q.push(Kt.fromCartesian(B)),{wallJwd:w,positions:Q}};_h.prototype.getHeightsFromLonLat=function(o,A){let f=this._viewer,m=[];o.forEach(function(C){m.push(f.scene.sampleHeight(new Kt(C.longitude,C.latitude)))}),typeof A=="function"&&A(m)};_h.prototype.isHaveTerrain=function(){return!!(this._viewer.scene&&this._viewer.scene.terrainProvider&&this._viewer.scene.terrainProvider._layers)};_h.prototype.drawwall=function(o,A,f){let m=this,C=m._viewer.entities.add({wall:{positions:new Bn(function(){return ee.fromDegreesArray(o)},!1),maximumHeights:A,minimumHeights:f}}),y=C.wall;y.material=new z0({image:Ae(m.wallImgUrl,`${window.SmartEarthRootUrl}Workers/image/dzmc.jpg`),repeat:new It(1,1)}),m.wallArr.push(C)};_h.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=this.loadingImg,o.appendChild(A),this.loading=o,this._viewer.container.appendChild(o)};_h.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};_h.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};_h.prototype.addPoint=function(o){this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=null),this._prevEntity1&&(this.addPointHandle=new Ur(this._viewer.scene.canvas),this.addPointHandle.setInputAction(function(A){let f=this._viewer.scene.pick(A.position);if(f&&f.id&&f.id.id===this._prevEntity1.id){let m=this._viewer.scene.pickPosition(A.position);if(m){let C=Kt.fromCartesian(m);this.addPointHandle.destroy(),this.addPointHandle=null,o&&typeof o=="function"&&o(C.height.toFixed(1))}}}.bind(this),Ki.LEFT_CLICK),this.addPointHandle.setInputAction(function(A){let f=this._viewer.scene.pick(A.endPosition);f&&f.id&&f.id.id===this._prevEntity1.id?this._tooltip.showAt(A.endPosition,"\u70B9\u51FB\u4FEE\u6539\u57FA\u51C6\u9762\u9AD8\u5EA6"):this._tooltip.show(!1)}.bind(this),Ki.MOUSE_MOVE))};_h.prototype.showTin=function(o){this.tin=o,this._volumeTin.forEach(A=>{this._viewer.entities.remove(A)}),this._volumeTin=[],o&&this.tinData&&this.tinData.features.forEach(A=>{if(A.positions){let f=this._viewer.entities.add({polygon:{hierarchy:new Un(A.positions),material:this._drawColor.polygon,perPositionHeight:!0,outline:!0,outlineColor:At.YELLOW}});this._volumeTin.push(f)}})};_h.prototype.setDatum=function(o,A){if(this.Triangulation&&this.Triangulation.length>0){let f,m,C,y={fill:0,dig:0},x={fill:"\u7ACB\u65B9\u7C73",dig:"\u7ACB\u65B9\u7C73"},v={fill:1,dig:1};this.Triangulation.forEach(function(E){f=E.bottomArea,m=E.height,C=(m[0]-o+m[1]-o+m[2]-o)/3,C>0?y.dig=y.dig+f*C*v.dig:y.fill=y.fill-f*C*v.fill,y.dig>1e10&&x.dig==="\u7ACB\u65B9\u7C73"&&(y.dig=y.dig/1e9,x.dig="\u7ACB\u65B9\u5343\u7C73",v.dig=1e-9),y.fill>1e10&&x.fill==="\u7ACB\u65B9\u7C73"&&(y.fill=y.fill/1e9,x.fill="\u7ACB\u65B9\u5343\u7C73",v.fill=1e-9)}),this._volumeLabel.label.text=`\u6316\u65B9\u4F53\u79EF\uFF1A${y.dig.toFixed(4)}${x.dig}`,this._volumeLabel1.label.text=`\u586B\u65B9\u4F53\u79EF\uFF1A${y.fill.toFixed(4)}${x.fill}`,this._prevEntity.polygon.height=o,A&&typeof A=="function"&&A({volume:y,unit:x})}};_h.prototype.getPointsInPolygon=function(o,A=50,f=!0){if(o.length<3)return;o.push(o[0]);let m=Zl.lineString(o),C=Zl.bbox(m),y=Zl.pointGrid(C,A,{units:"meters"}),x=Zl.polygon([o]),v=Zl.pointsWithinPolygon(y,x);if(f)for(let E=0;E<o.length-1;E++){let I=Zl.lineString([o[E],o[E+1]]),w={units:"meters"},Q=Zl.length(I,w),M;for(let B=A;;B+=A)if(B<=Q)M=Zl.along(I,B,w),v.features.push(M);else{M=Zl.along(I,Q,w),v.features.push(M);break}}return v};_h.prototype.tinFromPoints=function(o,A={}){let{polygon:f,getArea:m}=A,C=Zl.tin(o),y=0;return C&&C.features&&C.features.forEach(x=>{let v=!0;if(f){let E=Zl.centerOfMass(x);v=Zl.booleanPointInPolygon(E,f)}if(v){let E=x.geometry.coordinates[0],I=[],w=[];for(let Q=0;Q<3;Q++)I.push([E[Q][0],E[Q][1]]),w.push(ee.fromDegrees(E[Q][0],E[Q][1],E[Q][2]));x.positions=w,m&&(x.area=this.getArea(I,w,!0),y+=x.area)}}),{tin:C,area:y}};_h.prototype.getArea=function(o,A,f){if(o.length<3)return;o.push(o[0]);let m=o,C=0,y=Zl.polygon([m]),x;m.length===4?x=[y]:x=Zl.tesselate(y).features;let v,E,I,w;return x.forEach(Q=>{v=Q.geometry.coordinates[0],E=m.findIndex(F=>F.toString()===v[0].toString()),I=m.findIndex(F=>F.toString()===v[1].toString()),w=m.findIndex(F=>F.toString()===v[2].toString());let M=this.getdistance(A[E],A[I]),B=this.getdistance(A[I],A[w]),T=this.getdistance(A[E],A[w]),D=(M+B+T)/2;C+=Math.sqrt(D*((D-M)*(D-B)*(D-T)))}),f||(C<1e6?C=`${C.toFixed(2)}\u5E73\u65B9\u7C73`:C=`${(C/1e6).toFixed(2)}\u5E73\u65B9\u5343\u7C73`),C};_h.prototype.getdistance=function(o,A){let f=Kt.fromCartesian(o),m=Kt.fromCartesian(A),C=new l0;C.setEndPoints(f,m);let y=C.surfaceDistance;return y=Math.sqrt(Math.pow(y,2)+Math.pow(m.height-f.height,2)),y};var bAt=_h;function M2(o,A={}){this._earthCtrl=o,this._viewer=o.coreMap,this._scene=o.coreMap.scene,this.options=Ae(A,{}),this._modelArr=[],this._Apositions=[],this.FlattenPolygon=[],this._Loading=Ae(A.loading,!1),this._bottom=Ae(A.bottom,!1),this.loadingImg=Ae(A.loadingImg,`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`),this._Tooltip=new pw(o),this._tooltip=this._Tooltip.CreateTooltip(),this._positions=[],this._deepth=100,this._drawColor={point:Ae(this.options.drawColor?.point,At.BLUE),polyline:Ae(this.options.drawColor?.polyline,At.YELLOW),polygon:Ae(this.options.drawColor?.polygon,At.YELLOW.withAlpha(.5))}}M2.prototype.removeMeasureFromMap=function(){this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=void 0),this.Triangulation=[],this.tinData=void 0,this._tooltip.show(!1)};M2.prototype.startDrawing=function(o={},A){let f=this._scene,m=this._tooltip,C=3,y,x=[],v=[],E=[],I=[],w=[];this._positions=v,this._hierarchy=E,this._heightsort=I,this._degreesArr=w,this._deepth=Ae(o.deepth,100),this._modelArr=Ae(o.modelArr,[]);let Q=this;if(this._mouseHandler&&this._mouseHandler.destroy(),this.loading||this.addLoading(),o.positions){let M=ee.fromDegreesArray(o.positions);for(let B of M)v.push(B);if(!(v.length<C)){for(let B=0;B<o.positions.length;B+=2)w.push([o.positions[B],o.positions[B+1]]);console.log(v,"\u4F4D\u7F6E\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A"),this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:ee.fromDegreesArray(o.positions),material:Q._drawColor.polygon,fill:!0}});for(let B=0;B<o.positions.length;B+=2){let T=Q._viewer.scene.sampleHeight(new Kt(je.toRadians(o.positions[B]),je.toRadians(o.positions[B+1])));I.push(T),E.push(o.positions[B],o.positions[B+1],T)}this._Apositions=o.positions,this.stopDrawing(B=>{A&&A(B)})}}else{let M=new Ur(f.canvas);this._mouseHandler=M,this.removeMeasureFromMap(),this._viewer.container.style.cursor=`url(${globalThis.GEOWORLD_BASE_URL} 'Workers/image/cursor/draw.cur')`;let B;M.setInputAction(function(T){if(T.position!==null){let D=f.camera.getPickRay(T.position),F=f.globe.pick(D,f);if(this._viewer.scene.pick(T.position)){let R=this._viewer.scene.pickPosition(T.position);R&&(F=R)}if(F){let R=Kt.fromCartesian(F),k=je.toDegrees(R.longitude),U=je.toDegrees(R.latitude);if(x.length===0&&(x.push(k,U),w.push([k,U]),v.push(F),y=F),v.length>=4){let V=Ss.wgs84ToWindowCoordinates(this._viewer.scene,y);if(V!==void 0){let H=V.x-T.position.x,q=V.y-T.position.y;if(H*H+q*q<16){x.splice(x.length-2,2),v.pop(),this.stopDrawing(A);return}}}x.push(k,U),w.push([k,U]),v.push(F),v.length===2&&!B&&(B=this._viewer.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new Bn(function(){return v},!1),clampToGround:!0,material:Q._drawColor.polygon,width:3}})),v.length===C&&(B&&this._viewer.entities.remove(B),this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:new Un(ee.fromDegreesArray(x)),material:Q._drawColor.polygon,fill:!0}}),this._prevEntity.polygon.hierarchy=new Bn(()=>new Un(ee.fromDegreesArray(x)),!1))}}}.bind(this),Ki.LEFT_CLICK),M.setInputAction(function(T){let D=T.endPosition;if(D!==null)if(v.length===0)m.showAt(D,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7B2C\u4E00\u4E2A\u70B9");else{let F=f.camera.getPickRay(D),L=f.globe.pick(F,f),R=this._viewer.scene.pick(D),k=!1;if(R){let U=this._viewer.scene.pickPosition(D);U&&(L=U),k=!0}if(L){let U=Kt.fromCartesian(L),V=je.toDegrees(U.longitude),H=je.toDegrees(U.latitude);if(x.splice(x.length-2,2),w.pop(),v.pop(),x.push(V,H),w.push([V,H]),v.push(L),m.showAt(D,"\u53F3\u952E\u7ED3\u675F\u7ED8\u5236"),v.length>=3&&v.length>=4){let q=Ss.wgs84ToWindowCoordinates(this._viewer.scene,y);if(q!==void 0){let ie=q.x-D.x,Z=q.y-D.y;ie*ie+Z*Z<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}}.bind(this),Ki.MOUSE_MOVE),M.setInputAction(function(T){this.end&&this.end()}.bind(this),Ki.RIGHT_CLICK),this.end=T=>{if(this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),Q._viewer.container.style.cursor="default",this._tooltip.show(!1),B&&this._viewer.entities.remove(B),this.end=void 0,console.log(w,"?????????"),!(v.length<C)){if(this._prevEntity&&(this._prevEntity.polygon.hierarchy=ee.fromDegreesArray(x)),T==="cancel"){this._prevEntity&&this._viewer.entities.remove(this._prevEntity);return}for(let D=0;D<x.length;D+=2){let F=Q._viewer.scene.sampleHeight(new Kt(je.toRadians(x[D]),je.toRadians(x[D+1])));I.push(F),E.push(x[D],x[D+1],F)}this._Apositions=x,this.stopDrawing(A)}}}};M2.prototype.stopDrawing=function(o){let A=this;this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._Loading&&this.isLoading(!0),setTimeout(()=>{A._heightsort.sort(function(m,C){return m-C});let f=null;A._bottom?(f=this._viewer.entities.add({name:null,id:A._earthCtrl.factory.createUUID(),polygon:{hierarchy:new Bn(function(){return new Un(ee.fromDegreesArrayHeights(A._hierarchy))},!1),material:new z0({image:Ae(A.bottomImgUrl,`${window.SmartEarthRootUrl}Workers/image/bottomplane.jpg`),repeat:new It(1,1)})}}),A._baseHeight=A._heightsort[0]-A._deepth,f.polygon.height=A._baseHeight):f=this._viewer.entities.add({name:null,id:A._earthCtrl.factory.createUUID(),polygon:{hierarchy:new Bn(function(){return new Un(ee.fromDegreesArrayHeights(A._hierarchy))},!1),material:At.YELLOW.withAlpha(0)}}),A.FlattenPolygon.push(f),A.modelCutting()})};M2.prototype.modelCutting=function(){let o=this;if(o._modelCuttingPolygon=rh.fromPositions({positions:ee.fromDegreesArray(o._Apositions),height:o._baseHeight}),o._modelArr.length>0)for(let A of o._modelArr)A.addFlattenPolygon(o._modelCuttingPolygon),A.needUpdateFlatten=!0,A.clipPlaneOfFlatten=!0;else console.info("\u8BF7\u6DFB\u52A0\u6A21\u578B\uFF01")};M2.prototype.removeModelCutting=function(){let o=this;if(o._modelArr.length>0){for(let A of o._modelArr)A.removeFlattenPolygon(o._modelCuttingPolygon);o._modelCuttingPolygon=null,o._modelArr=[]}};M2.prototype.removeFromMap=function(){if(this.removeMeasureFromMap(),this.FlattenPolygon&&this.FlattenPolygon.length>0){for(let o=0;o<this.FlattenPolygon.length;o++)this._viewer.entities.remove(this.FlattenPolygon[o]);this.FlattenPolygon=[]}this.removeModelCutting()};M2.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=this.loadingImg,o.appendChild(A),this.loading=o,this._viewer.container.appendChild(o)};M2.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};M2.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};var QAt=M2;function P2(o,A={}){this._earthCtrl=o,this._viewer=o.coreMap,this._scene=o.coreMap.scene,this.options=Ae(A,{}),this._Apositions=[],this.FlattenPolygon=[],this._terrainFlatten=new _N(o.coreMap.scene),this._Loading=Ae(A.loading,!1),this._bottom=Ae(A.bottom,!1),this.loadingImg=Ae(A.loadingImg,`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`),this._Tooltip=new pw(o),this._tooltip=this._Tooltip.CreateTooltip(),this._positions=[],this._deepth=10,this._drawColor={point:Ae(this.options.drawColor?.point,At.BLUE),polyline:Ae(this.options.drawColor?.polyline,At.YELLOW),polygon:Ae(this.options.drawColor?.polygon,At.YELLOW.withAlpha(.5))}}P2.prototype.removeMeasureFromMap=function(){this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=void 0),this.Triangulation=[],this.tinData=void 0,this._tooltip.show(!1)};P2.prototype.startDrawing=function(o={},A){let f=this._scene,m=this._tooltip,C=3,y,x=[],v=[],E=[],I=[],w=[];this._positions=v,this._hierarchy=E,this._heightsort=I,this._degreesArr=w,this._deepth=Ae(o.deepth,100);let Q=this;if(this._mouseHandler&&this._mouseHandler.destroy(),this.loading||this.addLoading(),o.positions){let M=ee.fromDegreesArray(o.positions);for(let B of M)v.push(B);if(!(v.length<C)){for(let B=0;B<o.positions.length;B+=2)w.push([o.positions[B],o.positions[B+1]]);this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:ee.fromDegreesArray(o.positions),material:Q._drawColor.polygon,fill:!0}});for(let B=0;B<o.positions.length;B+=2){let T=Q._viewer.scene.sampleHeight(new Kt(je.toRadians(o.positions[B]),je.toRadians(o.positions[B+1])));I.push(T),E.push(o.positions[B],o.positions[B+1],T)}this._Apositions=o.positions,this.stopDrawing(B=>{A&&A(B)})}}else{let M=new Ur(f.canvas);this._mouseHandler=M,this.removeMeasureFromMap(),this._viewer.container.style.cursor=`url(${globalThis.GEOWORLD_BASE_URL} 'Workers/image/cursor/draw.cur')`;let B;M.setInputAction(function(T){if(T.position!==null){let D=f.camera.getPickRay(T.position),F=f.globe.pick(D,f);if(this._viewer.scene.pick(T.position)){let R=this._viewer.scene.pickPosition(T.position);R&&(F=R)}if(F){let R=Kt.fromCartesian(F),k=je.toDegrees(R.longitude),U=je.toDegrees(R.latitude);if(x.length===0&&(x.push(k,U),w.push([k,U]),v.push(F),y=F),v.length>=4){let V=Ss.wgs84ToWindowCoordinates(this._viewer.scene,y);if(V!==void 0){let H=V.x-T.position.x,q=V.y-T.position.y;if(H*H+q*q<16){x.splice(x.length-2,2),v.pop(),this.stopDrawing(A);return}}}x.push(k,U),w.push([k,U]),v.push(F),v.length===2&&!B&&(B=this._viewer.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new Bn(function(){return v},!1),clampToGround:!0,material:Q._drawColor.polygon,width:3}})),v.length===C&&(B&&this._viewer.entities.remove(B),this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:new Un(ee.fromDegreesArray(x)),material:Q._drawColor.polygon,fill:!0}}),this._prevEntity.polygon.hierarchy=new Bn(()=>new Un(ee.fromDegreesArray(x)),!1))}}}.bind(this),Ki.LEFT_CLICK),M.setInputAction(function(T){let D=T.endPosition;if(D!==null)if(v.length===0)m.showAt(D,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7B2C\u4E00\u4E2A\u70B9");else{let F=f.camera.getPickRay(D),L=f.globe.pick(F,f),R=this._viewer.scene.pick(D),k=!1;if(R){let U=this._viewer.scene.pickPosition(D);U&&(L=U),k=!0}if(L){let U=Kt.fromCartesian(L),V=je.toDegrees(U.longitude),H=je.toDegrees(U.latitude);if(x.splice(x.length-2,2),w.pop(),v.pop(),x.push(V,H),w.push([V,H]),v.push(L),m.showAt(D,"\u53F3\u952E\u7ED3\u675F\u7ED8\u5236"),v.length>=3&&v.length>=4){let q=Ss.wgs84ToWindowCoordinates(this._viewer.scene,y);if(q!==void 0){let ie=q.x-D.x,Z=q.y-D.y;ie*ie+Z*Z<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}}.bind(this),Ki.MOUSE_MOVE),M.setInputAction(function(T){this.end&&this.end()}.bind(this),Ki.RIGHT_CLICK),this.end=T=>{if(this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),Q._viewer.container.style.cursor="default",this._tooltip.show(!1),B&&this._viewer.entities.remove(B),this.end=void 0,console.log(w,"?????????"),!(v.length<C)){if(this._prevEntity&&(this._prevEntity.polygon.hierarchy=ee.fromDegreesArray(x)),T==="cancel"){this._prevEntity&&this._viewer.entities.remove(this._prevEntity);return}for(let D=0;D<x.length;D+=2){let F=Q._viewer.scene.sampleHeight(new Kt(je.toRadians(x[D]),je.toRadians(x[D+1])));I.push(F),E.push(x[D],x[D+1],F)}this._Apositions=x,this.stopDrawing(A)}}}};P2.prototype.stopDrawing=function(o){let A=this;this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._Loading&&this.isLoading(!0),setTimeout(()=>{A._heightsort.sort(function(C,y){return C-y});let f=null;A._bottom?(f=this._viewer.entities.add({name:null,id:A._earthCtrl.factory.createUUID(),polygon:{hierarchy:new Bn(function(){return new Un(ee.fromDegreesArrayHeights(A._hierarchy))},!1),material:new z0({image:Ae(A.bottomImgUrl,`${window.SmartEarthRootUrl}Workers/image/bottomplane.jpg`),repeat:new It(1,1)})}}),A._baseHeight=A._heightsort[0]-A._deepth,f.polygon.height=A._baseHeight):f=this._viewer.entities.add({name:null,id:A._earthCtrl.factory.createUUID(),polygon:{hierarchy:new Bn(function(){return new Un(ee.fromDegreesArrayHeights(A._hierarchy))},!1),material:At.YELLOW.withAlpha(0)}}),A.FlattenPolygon.push(f);let m=[];A._baseHeight=A._heightsort[0]-A._deepth;for(let C=0;C<A._hierarchy.length;C+=3)m.push(A._hierarchy[C],A._hierarchy[C+1],A._baseHeight);console.log(m,"\u4F4D\u7F6E\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A"),A.terrainCutting(m)})};P2.prototype.terrainCutting=function(o){let A=this;A._terrainFlatten.addPolygon(o),A._terrainFlatten.update(),A._terrainFlatten.clipPlaneOfFlatten=!0};P2.prototype.removeTerrainCutting=function(){this._terrainFlatten.clearPolygon()};P2.prototype.removeFromMap=function(){if(this.removeMeasureFromMap(),this.FlattenPolygon&&this.FlattenPolygon.length>0){for(let o=0;o<this.FlattenPolygon.length;o++)this._viewer.entities.remove(this.FlattenPolygon[o]);this.FlattenPolygon=[]}this.removeTerrainCutting()};P2.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=this.loadingImg,o.appendChild(A),this.loading=o,this._viewer.container.appendChild(o)};P2.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};P2.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};var SAt=P2;function mw(o,A={}){this._earthCtrl=o,this._terrainFlatten=new _N(this._earthCtrl.coreMap.scene),this._viewer=o.coreMap,this._scene=o.coreMap.scene,this.options=Ae(A,{}),this._Tooltip=new pw(o),this._tooltip=this._Tooltip.CreateTooltip(),this._drawColor={point:Ae(this.options.drawColor?.point,At.BLUE),polyline:Ae(this.options.drawColor?.polyline,At.YELLOW),polygon:Ae(this.options.drawColor?.polygon,At.YELLOW.withAlpha(.5))},this.loadingImg=`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`,this.wallArr=[],this.FlattenPolygon=[],this._Apositions=[],this._heightsort=null,this._deepth=100,this._positions=[],this._modelArr=Ae(A.modelArr,[]),this._isFlattening=Ae(A.isFlattening,!0),this.modelCuttingPolygon=null,this.wallImgUrl=Ae(A.wallImgUrl,null),this.bottomImgUrl=Ae(A.bottomImgUrl,null),this._Loading=Ae(A.loading,!0)}mw.prototype.removeMeasureFromMap=function(){this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=void 0),this.Triangulation=[],this.tinData=void 0,this._tooltip.show(!1)};mw.prototype.removeFromMap=function(){if(this.removeMeasureFromMap(),this.wallArr.length>0){for(let o=0;o<this.wallArr.length;o++)this._viewer.entities.remove(this.wallArr[o]);this.wallArr=[]}if(this.FlattenPolygon&&this.FlattenPolygon.length>0){for(let o=0;o<this.FlattenPolygon.length;o++)this._viewer.entities.remove(this.FlattenPolygon[o]);this.FlattenPolygon=[]}this.removeModelCutting()};mw.prototype.deleteObject=mw.prototype.removeFromMap;mw.prototype.startDrawing=function(o={},A){let f=Ae(o.spacing,"auto"),m=this._scene,C=this._tooltip,y=3,x=this._positions,v=[],E;this._Apositions=o.positions,this._heightsort=v,this._deepth=Ae(o.deepth,100),this._sampleStep=Ae(o.sampleStep,100),this._maxSampleCount=Ae(o.maxSampleCount,200),this._drawColor.point=o.point||this._drawColor.point,this._drawColor.polyline=o.polyline||this._drawColor.polyline,this._drawColor.polygon=o.polygon||this._drawColor.polygon,this.loadingImg=o.loading||this.loadingImg;let I=this;if(this._mouseHandler&&this._mouseHandler.destroy(),this.loading||this.addLoading(),!o.positions){let w=new Ur(m.canvas);this._mouseHandler=w,this.removeMeasureFromMap(),this._viewer.container.style.cursor=`url(${globalThis.GEOWORLD_BASE_URL} 'Assets/image/cursor/draw.cur')`;let Q;w.setInputAction(function(B){if(B.position!==null){let T=this._viewer.scene.pickPosition(B.position);if(T){let D=Kt.fromCartesian(T);if(x.length===0&&(x.push(D),E=T),x.length>=4){let F=Ss.wgs84ToWindowCoordinates(this._viewer.scene,E);if(F!==void 0){let L=F.x-B.position.x,R=F.y-B.position.y;if(L*L+R*R<16){x.splice(x.length-2,2),this.stopDrawing(A);return}}}x.push(D),x.length===2&&!Q&&(Q=this._viewer.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new Bn(function(){let F=[];for(let L=0;L<x.length;L++){let R=x[L];F.push(R.longitude,R.latitude,R.height)}return ee.fromRadiansArrayHeights(F)},!1),clampToGround:!1,material:I._drawColor.polygon,width:3}})),x.length===y&&(Q&&this._viewer.entities.remove(Q),this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:new Bn(()=>{let F=[];for(let L=0;L<x.length;L++){let R=x[L];F.push(R.longitude,R.latitude,R.height)}return new Un(ee.fromRadiansArrayHeights(F))},!1),material:I._drawColor.polygon,fill:!0}}))}}}.bind(this),Ki.LEFT_CLICK),w.setInputAction(function(B){let T=B.endPosition;if(T!==null)if(x.length===0)C.showAt(T,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7B2C\u4E00\u4E2A\u70B9");else{let D=this._viewer.scene.pickPosition(T);if(D){let F=Kt.fromCartesian(D);if(x.splice(x.length-1,1),x.push(F),C.showAt(T,"\u53F3\u952E\u7ED3\u675F\u7ED8\u5236"),x.length>=3&&x.length>=4){let L=Ss.wgs84ToWindowCoordinates(this._viewer.scene,E);if(L!==void 0){let R=L.x-T.x,k=L.y-T.y;R*R+k*k<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}}.bind(this),Ki.MOUSE_MOVE);let M=null;w.setInputAction(function(B){M=window.setTimeout(()=>{console.log("\u5355\u51FB"),this.end&&this.end()},200)}.bind(this),Ki.RIGHT_CLICK),w.setInputAction(function(B){console.log("\u53CC\u51FB......"),clearTimeout(M)},Ki.LEFT_DOUBLE_CLICK),this.end=B=>{if(this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),I._viewer.container.style.cursor="default",this._tooltip.show(!1),Q&&this._viewer.entities.remove(Q),this.end=void 0,!(x.length<y)){if(this._prevEntity&&this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0,B==="cancel")return;for(let T=0;T<x.length;T+=2){let D=x[T].height;v.push(D)}this._Apositions=x,this.stopDrawing(f,A)}}}return this};function MLi(o,A,f){let m=je.lerp(o.longitude,A.longitude,1/f)-o.longitude,C=je.lerp(o.latitude,A.latitude,1/f)-o.latitude,y=[];y.push(o);for(let x=0;x<f;x++){let v=o.longitude+(x+1)*m,E=o.latitude+(x+1)*C;y.push(new Kt(v,E))}return y.push(A),y}function PLi(o,A,f,m,C){let y=[];A.forEach(function(x){let v=Kt.toCartesian(new Kt(x.longitude,x.latitude,m)),E=Kt.toCartesian(new Kt(x.longitude,x.latitude,f)),I=ee.normalize(ee.subtract(E,v,new ee),new ee),w=new ls(v,I),Q=null,M=[],B=o.scene.drillPickFromRay(w,1,M);o.scene.globe.show=!1,B.length>0&&!B[0].object&&B[0].position?(Q=o.scene.drillPickFromRay(w,100,M),Q.unshift(B[0])):Q=o.scene.drillPickFromRay(w,100,M),o.scene.globe.show=!0,y.push(Q)}),typeof C=="function"&&C(y)}function RLi(o,A,f){for(let y=0;y<o.length;y++){let x=o[y];for(let v=0;v<x.length;v++){let E=x[v].position,I=Kt.fromCartesian(E);if(I.height<A){x.splice(v,x.length-v);let w=ee.fromRadians(I.latitude,I.longitude,A);x.push({object:null,position:w});break}}{let v=x[x.length-1].position,E=Kt.fromCartesian(v);if(Math.abs(E.height-A)>.01){let I=ee.fromRadians(E.latitude,E.longitude,A);x.push({object:null,position:I})}}{let v=x[x.length-1].position,E=Kt.fromCartesian(v);console.log("di",E.height)}}for(let y=0;y<o.length;y++){let x=o[y],v=x[x.length-1];f.push(v.position)}let m=0;o.forEach(function(y){m=m<y.length?y.length:m}),o.forEach(function(y){if(m-y.length>0){let v=y.length;y.length=m,y.fill(null,v,y.length)}});let C=[];for(let y=0;y<m-1;y++){let x=[],v=[];for(let E=0;E<o.length;E++){let I=o[E][y],w=o[E][y+1];I&&w&&(x.push(I),v.push(w))}C.push({ups:x,bottoms:v})}return C}mw.prototype.stopDrawing=function(o,A){let f=this;this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._Loading&&this.isLoading(!0);let m=this._positions,C=this._viewer,y=this.wallArr,x=this._deepth,v=this._sampleStep,E=this._maxSampleCount;m.push(m[0]);let I=0;for(let w=0;w<m.length-1;w++){let Q=ee.fromRadians(m[w].longitude,m[w].latitude,m[w].height),M=ee.fromRadians(m[w+1].longitude,m[w+1].latitude,m[w+1].height),T=ee.distance(M,Q)/v;I=I<T?T:I}I=E<I?E:I,I=260,setTimeout(()=>{f._heightsort.sort(function(D,F){return D-F});let w=f._heightsort[0]+2e3,Q=f._heightsort[0]-2e3,M=[];for(let D=0;D<m.length-1;D++){let F=m[D],L=m[D+1],R=MLi(F,L,I);PLi(C,R,Q,w,function(k){let U=RLi(k,x,M);for(let V=0;V<U.length;V++){let H=U[V];y.push(LLi(C,H,V))}})}let B=[];for(let D=0;D<m.length;D++){let F=m[D];B.push(F.longitude,F.latitude,x)}let T=C.entities.add({polygon:{hierarchy:{positions:ee.fromRadiansArrayHeights(B)},perPositionHeight:!0,granularity:je.RADIANS_PER_DEGREE*100,material:new z0({image:`${globalThis.GEOWORLD_BASE_URL}Workers/image/bottomplane.jpg`,repeat:new It(1,1)}),fill:!0}});return y.push(T),f._isFlattening&&f.modelCutting(),A&&A(!0),this.isLoading(!1)},20)};mw.prototype.modelCutting=function(){let o=this,A=this._deepth,f=this._positions,m=[],C=[];for(let y=0;y<f.length;y++){let x=f[y];m.push(x.longitude,x.latitude,x.height-10),C.push(je.toDegrees(x.longitude),je.toDegrees(x.latitude),x.height-10)}if(o._modelCuttingPolygon=rh.fromPositions({positions:ee.fromRadiansArrayHeights(m),height:A-10}),o._terrainFlatten.addPolygon(C),o._terrainFlatten.update(),o._terrainFlatten.clipPlaneOfFlatten=!0,o._modelArr.length>0)for(let y of o._modelArr)y.addFlattenPolygon(o._modelCuttingPolygon),y.needUpdateFlatten=!0,y.clipPlaneOfFlatten=!0;else console.info("\u8BF7\u6DFB\u52A0\u6A21\u578B\uFF01")};mw.prototype.removeModelCutting=function(){let o=this;if(o._modelArr.length>0){for(let A of o._modelArr)A.removeFlattenPolygon(o._modelCuttingPolygon);o._modelCuttingPolygon=null,o._modelArr=[],o._terrainFlatten.clearPolygon(),o._terrainFlatten.clipPlaneOfFlatten=!1}else console.info("\u8BF7\u6DFB\u52A0\u6A21\u578B\uFF01")};function LLi(o,A,f){let m=[],C=[];for(let I=0;I<A.ups.length;I++){let w=A.ups[I];m.push(w.position);let Q=Kt.fromCartesian(w.position);C.push(Q.height)}let y=[];for(let I=0;I<A.bottoms.length;I++){let w=A.bottoms[I],Q=Kt.fromCartesian(w.position);y.push(Q.height)}let x=`${globalThis.GEOWORLD_BASE_URL}Workers/image/MTY0001.jpg`,v=`${globalThis.GEOWORLD_BASE_URL}Workers/image/MTY0002.jpg`,E=o.entities.add({wall:{positions:m,material:new z0({image:f%2?x:v,repeat:new It(.01,.01)}),maximumHeights:C,minimumHeights:y,granularity:je.RADIANS_PER_DEGREE*100}});return E.show=!0,E}mw.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=this.loadingImg,o.appendChild(A),this.loading=o,this._viewer.container.appendChild(o)};mw.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};mw.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};var DAt=mw;function id(o){this._earthCtrl=o,this._coreMap=o.coreMap,this.tools=[],this.vols=[],this.saveResult=!1}id.prototype.getDistanceSpace=function(o){this.saveResult===!1&&this.deleteObject(),this._tool=new kW(this._earthCtrl),this._tool.spaceDistance(o),this.tools.push(this._tool)};id.prototype.getDistanceHorizontal=function(o){this.saveResult===!1&&this.deleteObject(),this._tool=new kW(this._earthCtrl),this._tool.horizontalDistance(o),this.tools.push(this._tool)};id.prototype.deleteObject=function(){O(this._tool)&&this._tool.deleteObject(),this.saveResult===!1&&this.tools.pop()};id.prototype.deleteAll=function(){this.tools.forEach(function(o){o.deleteObject()}),this.vols.forEach(function(o){o.cleanUp()}),this._earthCtrl.measure.tools.forEach(function(o){o.clearResult()}),this.tools=[],this.vols=[],this._earthCtrl.measure.tools=[]};id.prototype.saveResults=function(o){this.saveResult=o};id.prototype.getPlaneArea=function(o){this.saveResult===!1&&this.deleteObject(),this._tool=new kW(this._earthCtrl),this._tool.getPlaneArea(o),this.tools.push(this._tool)};id.prototype.getSurfaceArea3d=function(o){this.saveResult===!1&&this.deleteObject(),this._tool=new kW(this._earthCtrl),this._tool.getSurfaceArea3d(o),this.tools.push(this._tool)};id.prototype.volumetric=function(o){this.saveResult===!1&&this.removeVolumetric(),this._vol=new _le(this._earthCtrl),this._vol.startDrawing(o),this.vols.push(this._vol)};id.prototype.removeVolumetric=function(o){O(this._vol)&&this.vols.forEach(function(A){A.cleanUp()})};id.prototype.lineOfSight=function(o){this._tool=new wAt(this._earthCtrl),this._tool.createLineOfSight(o),this.tools.push(this._tool)};id.prototype.createViewShed=function(o){return new Ile(this._earthCtrl,o)};id.prototype.createSubmergence=function(o){return new Ble(this._earthCtrl,o)};id.prototype.createProfile=function(o){return new wle(this._earthCtrl,o)};id.prototype.createBufferAnalysis=function(o){return new Jre(this._earthCtrl,o)};id.prototype.createSkyline=function(o){return new Qle(this._earthCtrl,o)};id.prototype.createCurtainContrast=function(o){return new vAt(this._earthCtrl,o)};id.prototype.createRestrictTheHeight=function(o){return new Dle(this._earthCtrl,o)};id.prototype.createModifyMesh=function(o,A){return new Tle(this._earthCtrl).addClipping(o,A)};id.prototype.createTerrainModifier=function(o){return new Mle(this._earthCtrl,o)};id.prototype.createTerrainExcavation=function(o){return new Lle(this._earthCtrl,o)};id.prototype.createExcavationAndFillAnalysis=function(o){return new Rle(this._earthCtrl,o)};id.prototype.createVolumetricMeasure=function(o){return new BAt(this._earthCtrl,o)};id.prototype.createModelVolumetric=function(o){return new bAt(this._earthCtrl,o)};id.prototype.createModelCutting=function(o){return new QAt(this._earthCtrl,o)};id.prototype.createTerrainCutting=function(o){return new SAt(this._earthCtrl,o)};id.prototype.createModelSection=function(o){return new DAt(this._earthCtrl,o)};var Nle=id;function kle(o,A){if(this._earthCtrl=o,!O(A.flagHtml))throw new Ui("flagDiv is required.");this._flagHtml=A.flagHtml,this._options=Ae(A,Ae.EMAIL),this._circleRadius=Ae(A.circleRadius,10),this._lon=Ae(A.lon,121),this._lat=Ae(A.lat,31),this._height=Ae(A.height,0),this._show=Ae(A.show,!0),this._flagScale=Ae(A.flagScale,4),this._circleColor=Ae(A.circleColor,At.RED),this._cylinderColor=Ae(A.cylinderColor,At.YELLOWGREEN),this._duration=Ae(A.duration,2e3),this._gradient=Ae(A.gradient,2),this._count=Ae(A.count,2),this._canvasZoom=Ae(A.canvasZoom,10),this._circleEntity=void 0,this._cylinderEntity=void 0,this._lineEntity=void 0,this._htmlPlaneEntity=void 0,this._linePlaneEntity=void 0,this._flagDiv=document.createElement("div"),this._flagDiv.style.opacity="0.7",this._flagDiv.style.margin="0",this._flagDiv.style.padding="0",this._flagDiv.id=Ae(A.id,Vu()),this._flagDiv.innerHTML=this._flagHtml,this._show&&this.addToMap()}kle.prototype.removeFromMap=function(){O(this._circleEntity)&&(this._earthCtrl.entities.remove(this._circleEntity),this._circleEntity=void 0),O(this._cylinderEntity)&&(this._earthCtrl.entities.remove(this._cylinderEntity),this._cylinderEntity=void 0),O(this._lineEntity)&&(this._earthCtrl.entities.remove(this._lineEntity),this._lineEntity=void 0),O(this._linePlaneEntity)&&(this._earthCtrl.entities.remove(this._linePlaneEntity),this._linePlaneEntity=void 0),O(this._htmlPlaneEntity)&&(this._earthCtrl.entities.remove(this._htmlPlaneEntity),this._htmlPlaneEntity=void 0)};kle.prototype.addToMap=function(){let o=this,A=0,f=2,m,C=ee.fromDegrees(o._lon,o._lat,o._height);if(O(o._circleEntity)||(o._circleEntity=o._earthCtrl.entities.add({position:C,ellipse:{height:o._height,semiMinorAxis:o._circleRadius,semiMajorAxis:o._circleRadius,material:new $8({duration:o._duration,gradient:o._gradient,color:o._circleColor,count:o._count})}})),!O(o._cylinderEntity)){let v=o._circleRadius*2/5,E=o._circleRadius*3/4;m=fQ.changeCartesian3Height(C,E/2),o._cylinderEntity=o._earthCtrl.entities.add({position:m,cylinder:{length:E,topRadius:v,bottomRadius:v,fill:!0,outline:!1,material:o._cylinderColor}})}if(O(o._lineEntity)||(A=o._circleRadius*o._flagScale+o._height,o._lineEntity=o._earthCtrl.entities.add({polyline:{width:f,positions:ee.fromDegreesArrayHeights([o._lon,o._lat,o._height,o._lon,o._lat,A]),material:o._cylinderColor}})),!O(o._htmlPlaneEntity)){A=o._circleRadius*o._flagScale;let v=A/5,E=v*3,I=A-v/2,w=4*f,Q=new ee(w/2,0,I),M=fQ.changeCartesian3ByScalar(C,Q);this._linePlaneEntity=o._earthCtrl.entities.add({position:M,plane:{plane:new Wa(ee.UNIT_Y,0),dimensions:new It(w,v),material:o._cylinderColor}});let B=new ee(E/2+w,0,I);m=fQ.changeCartesian3ByScalar(C,B);let T=o._flagDiv,D=o._canvasZoom,F=document.createElement("canvas");F.width=10*v/E*D,F.height=10*D,uH.drawDocument(T,F,{zoom:D}).then(function(L){o._htmlPlaneEntity=o._earthCtrl.entities.add({position:new Bn(y,!1),plane:{plane:new Bn(x,!0),dimensions:new It(E,v),material:new z0({image:L.image,transparent:!0})}})},function(L){console.info(L)})}function y(){return m}function x(){let v=new ee;return v=ee.negate(ee.UNIT_Y,v),new Wa(v,0)}};Object.defineProperties(kle.prototype,{});var TAt=kle;function Ole(o,A){this._earthCtrl=o,this._scene=o.coreMap.scene,this._options=O(A,Ae.EMPTY_OBJECT),this._color=Ae(A.color,At.RED),this._lon=Ae(A.lon,121),this._lat=Ae(A.lat,31),this._height=Ae(A.height,0),this._statistics=Ae(A.statisticData,1e3),this._radius=Ae(A.radius,100),this._duration=Ae(A.duration,2e3),this._gradient=Ae(A.gradient,2),this._count=Ae(A.count,2),this._scale=Ae(A.dataScale,1),this._show=Ae(A.show,!0),this._billboardWidthRatio=Ae(A.billboardWidthRatio,1.2),this._billboardHeightRatio=Ae(A.billboardHeightRatio,2.4),this._prefix=Ae(A.prefix,""),this._scaleByDistance=Ae(A.scaleByDistance,new To(1500,3,15e3,.1)),this._topFillColor=Ae(A.topFillColor,At.fromCssColorString("#323232")),this._circleEntity=void 0,this._cylinderEntity=void 0,this._billboardEntity=void 0,this._position=ee.fromDegrees(this._lon,this._lat,this._height),this._show&&this.addToMap()}var LN=new ee;Ole.prototype.addToMap=function(){let o=this;if(O(o._circleEntity)||(o._circleEntity=o._earthCtrl.entities.add({position:o._position,ellipse:{height:o._height,semiMinorAxis:o._radius,semiMajorAxis:o._radius,material:new $8({duration:o._duration,gradient:o._gradient,color:o._color,count:o._count})}})),!O(o._cylinderEntity)){LN=ee.clone(o._position,LN);let A=o._statistics*o._scale,f=Vn.eastNorthUpToFixedFrame(LN),m=new ee(0,0,A/2);Xe.multiplyByPoint(f,m,LN),o._cylinderEntity=o._earthCtrl.entities.add({position:LN,cylinder:{length:A,topRadius:o._radius/10,bottomRadius:o._radius/10,fill:!0,outline:!1,material:o._color}})}if(!O(o._billboardEntity)){LN=ee.clone(o._position,LN);let A=o._cylinderEntity.cylinder.length._value,f=Kt.fromCartesian(LN),m=ee.fromRadians(f.longitude,f.latitude,f.height+A);o._billboardEntity=o._earthCtrl.entities.add({position:m,billboard:{scaleByDistance:o._scaleByDistance,verticalOrigin:bn.BOTTOM,width:o._radius/o._billboardWidthRatio,height:o._radius/o._billboardHeightRatio,image:kLi(o._color,o._topFillColor,o._prefix+o._statistics,o._radius).toDataURL()}})}};Ole.prototype.removeFromMap=function(){O(this._cylinderEntity)&&(this._earthCtrl.entities.remove(this._cylinderEntity),this._cylinderEntity=void 0),O(this._circleEntity)&&(this._earthCtrl.entities.remove(this._circleEntity),this._circleEntity=void 0),O(this._billboardEntity)&&(this._earthCtrl.entities.remove(this._billboardEntity),this._billboardEntity=void 0)};function FLi(o,A,f,m){o.save(),o.strokeStyle="rgba(0,0,0,0)",o.scale(m/150,m/100),o.save(),o.fillStyle=A.toCssColorString(),o.lineWidth=4,o.beginPath(),o.moveTo(77.8,82.1),o.lineTo(64.6,69),o.lineTo(23.8,69),o.bezierCurveTo(20.8,69,18.3,66.5,18.3,63.5),o.lineTo(18.3,22.5),o.bezierCurveTo(18.3,19.5,20.8,17,23.8,17),o.lineTo(131.8,17),o.bezierCurveTo(134.8,17,137.3,19.5,137.3,22.5),o.lineTo(137.3,63.5),o.bezierCurveTo(137.3,66.5,134.8,69,131.8,69),o.lineTo(90.9,69),o.lineTo(77.8,82.1),o.closePath(),o.moveTo(23.8,18),o.bezierCurveTo(21.3,18,19.3,20,19.3,22.5),o.lineTo(19.3,63.5),o.bezierCurveTo(19.3,66,21.3,68,23.8,68),o.lineTo(65,68),o.lineTo(77.7,80.7),o.lineTo(90.5,68),o.lineTo(131.8,68),o.bezierCurveTo(134.3,68,136.3,66,136.3,63.5),o.lineTo(136.3,22.5),o.bezierCurveTo(136.3,20,134.3,18,131.8,18),o.lineTo(23.8,18),o.closePath(),o.fill(),o.stroke(),o.restore(),o.save(),o.fillStyle=f.toCssColorString(),o.beginPath(),o.moveTo(131.8,18),o.lineTo(23.80000000000001,18),o.bezierCurveTo(21.30000000000001,18,19.30000000000001,20,19.30000000000001,22.5),o.lineTo(19.30000000000001,63.5),o.bezierCurveTo(19.30000000000001,66,21.30000000000001,68,23.80000000000001,68),o.lineTo(65,68),o.lineTo(77.7,80.7),o.lineTo(90.5,68),o.lineTo(131.8,68),o.bezierCurveTo(134.3,68,136.3,66,136.3,63.5),o.lineTo(136.3,22.5),o.bezierCurveTo(136.3,20,134.2,18,131.8,18),o.closePath(),o.fill(),o.stroke(),o.restore(),o.restore()}function NLi(o,A,f){let m=f/1.4,C=m,y=m;A.width>A.height?y=m*(A.height/A.width):A.width<A.height&&(C=m*(A.width/A.height));let x=f/150*8,v=Math.round((f-C+x)/2),E=Math.round((5/6*f-y)/2);o.drawImage(A,v,E,C,y)}function kLi(o,A,f,m){let C=document.createElement("canvas");C.width=m,C.height=m;let y=C.getContext("2d");FLi(y,o,A,m);let x=m,v=k5(f,{font:`bold ${x}pt Microsoft YaHei`,fillColor:o});return NLi(y,v,x),C}Object.defineProperties(Ole.prototype,{billboard:{get:function(){return this._billboardEntity}},cylinder:{get:function(){return this._cylinderEntity}},circle:{get:function(){return this._circleEntity}},show:{get:function(){return this._show},set:function(o){O(this._billboardEntity)&&(this._billboardEntity.show=o),O(this._cylinderEntity)&&(this._cylinderEntity.show=o),O(this._circleEntity)&&(this._circleEntity.show=o)}}});var MAt=Ole;function fMe(o,A){if(this._earthCtrl=o,this._scene=o.coreMap.scene,this._options=Ae(A,Ae.EMPTY_OBJECT),this._color=Ae(A.color,At.RED),this._lon=Ae(A.lon,121),this._lat=Ae(A.lat,31),this._height=Ae(A.height,0),this._show=Ae(A.show,!0),this._containerWidth=Ae(A.containerWidth,200),this._containerHeight=Ae(A.containerHeight,200),this._containerColor=Ae(A.cylinderColor,At.YELLOWGREEN),this._canvasZoom=Ae(A.canvasZoom,10),this._scaleByDistance=Ae(A.scaleByDistance,new To(1500,3,15e3,.1)),this._tipsHtml=A.tipsHtml,this._tipsEntity=void 0,this._tipsDiv=document.createElement("div"),this._tipsDiv.style.opacity="0.7",this._tipsDiv.style.margin="0",this._tipsDiv.style.padding="0",this._tipsDiv.id=Ae(A.id,Vu()),this._tipsDiv.innerHTML=this._tipsHtml,!O(A.tipsHtml))throw new Ui("tipsHtml is required.");this.addToMap()}fMe.prototype.removeFromMap=function(){O(this._tipsEntity)&&(this._earthCtrl.entities.remove(this._tipsEntity),this._tipsEntity=void 0),O(this._tipsDiv)&&(this._earthCtrl.entities.remove(this._tipsDiv),this._tipsDiv=void 0)};fMe.prototype.addToMap=function(){let o=this,A=ee.fromDegrees(o._lon,o._lat,o._height);if(!O(o._tipsEntity)){let m=o._containerHeight,C=o._containerWidth,y=o._canvasZoom,x=o._tipsDiv,v=document.createElement("canvas");v.width=C,v.height=m,uH.drawDocument(x,v,{zoom:y}).then(function(E){o._tipsEntity=o._earthCtrl.entities.add({position:new Bn(f,!1),billboard:{scaleByDistance:o._scaleByDistance,verticalOrigin:bn.BOTTOM,width:C,height:m,image:E.image.src}})},function(E){console.info(E)})}function f(){return A}};var PAt=fMe;function jO(o,A){this._earthCtrl=o,this._scene=o.coreMap.scene,this._options=Ae(A,Ae.EMPTY_OBJECT),this.element=document.createElement("div"),this._html=Ae(A.html,""),this._lon=Ae(A.lon,121),this._lat=Ae(A.lat,31),this._height=Ae(A.height,10),this._show=Ae(A.show,!0),this._removeHandler=void 0,this._pos=void 0,this._position=void 0,this._c=void 0,this._changedC=void 0,this._point=void 0,this._parameter=A,this._rtti="GwScreenDialog",this.isInit=!1,this.isInit===!1&&this.addToMap()}jO.prototype.setHtml=function(o){this.element.innerHTML=o};jO.prototype.setShow=function(o){if(!this.isInit)return 0;this.element.style.display=o?"block":"none"};jO.prototype.showAt=function(){if(!this.isInit)return 0;this._position&&(this._pos=Ss.wgs84ToWindowCoordinates(this._scene,this._position),this._pos&&(this.element.style.left=`${this._pos.x}px`,this.element.style.top=`${this._pos.y}px`))};jO.prototype.removeFromMap=function(){this.element.remove(),this.isInit=!1};jO.prototype.addToMap=function(){if(this.isInit)return 0;nA(".map-widget",this.element),this.element.innerHTML=this._html,this.element.style.position="absolute",this.isInit=!0,this._position=ee.fromDegrees(this._lon,this._lat,this._height),this.showAt(),this._c=new It(this._pos.x,this._pos.y);let o=this;this._scene.camera.moveStart.addEventListener(function(){o._removeHandler=o._scene.postRender.addEventListener(function(){if(o._c){let A=new F5(Di.WGS84,o._earthCtrl.camera._camera.position);A&&o._position&&(A.isPointVisible(o._position)===!1?o.setShow(!1):(o._show===!0&&o.setShow(!0),o._changedC=Ss.wgs84ToWindowCoordinates(o._scene,o._position),o._changedC?(o._c=o._changedC,o.showAt()):o.setShow(!1)))}})}),this._scene.camera.moveEnd.addEventListener(function(){o._removeHandler&&o._removeHandler.call()})};Object.defineProperties(jO.prototype,{show:{get:function(){return this._show},set:function(o){this._show!==o&&(this._show=o,this.setShow(o))}},html:{get:function(){return this._html},set:function(o){this._html!==o&&(this._html=o,this.setHtml(o))}},lon:{get:function(){return this._lon},set:function(o){this._lon!==o&&(this._lon=o,this._position=ee.fromDegrees(this._lon,this._lat,this._height),this.showAt())}},lat:{get:function(){return this._lat},set:function(o){this._lat!==o&&(this._lat=o,this._position=ee.fromDegrees(this._lon,this._lat,this._height),this.showAt())}},height:{get:function(){return this._height},set:function(o){this._height!==o&&(this._height=o,this._position=ee.fromDegrees(this._lon,this._lat,this._height),this.showAt())}}});var RAt=jO;function UW(o){this._earthCtrl=o,this._coreMap=o.coreMap}UW.prototype.createStatisticFlag=function(o){return new TAt(this._earthCtrl,o)};UW.prototype.createStatisticCylinder=function(o){return new MAt(this._earthCtrl,o)};UW.prototype.createTipsContainer=function(o){return new PAt(this._earthCtrl,o)};UW.prototype.createScreenDialog=function(o){return new RAt(this._earthCtrl,o)};var LAt=UW;function Ule(){var o=["getKeyRecoveryParam","curveType","Input not Buffer","map","_ipad","b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef","setAutoPadding","rejected",'{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}',"dir","transform","ERR_UNKNOWN_ENCODING","mulf","Apr","_verify2","tmp","EncoderBuffer","password","raw","isBoxedPrimitive","onRuntimeInitialized","seqof","addn","sqlite3_bind_double","sum32_5","000000000000000000","bufferedRequest","non-byte EncoderBuffer value","set","ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","_countBits","assign","publicKey","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758","privateExponent","fired","root","isString","invalid sig","WeakMap","modulus must be greater than 1","_sqlite3_result_int64","-e4437ed6010e88286f547fa90abfe4c3","onend","modelDbModelIdList","The argument '","5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b","save","arrayBufferBlockCount","sum64_5_hi","notStrictEqual","sqlite3_column_blob","entry","c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","utf8","c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","readableListening","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865","/dev/stdin","clock","Password","codes","exitKey","a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","SetModelStoreyTransform","fromRed works only with numbers in reduction context","callbackify","e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","worldDirection","494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","byteLength","spread","kdeparams","canvas","7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","_final","not ","createDecipher","chdir","6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c","[object HTMLCollection]","_sqlite3_changes","dataStoreArrayBuffer","Trace","shim","isArgumentsObject","'name' must be a string","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58","isBuf","falling back to ArrayBuffer instantiation","Index out of range","call","[object Object]","emitter","tagged","rsa",'Failed to peek tag: "',"content","Attempt to access memory outside buffer bounds","eject","ERR_FR_TOO_MANY_REDIRECTS","exists","da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","pipe","String","boolean","Rand","_decodeTag","getHighWaterMark","3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","ERR_BUFFER_OUT_OF_BOUNDS","getCiphers","callee","2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06","serialNumber","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc","tinv","ineg","bool","0x8000000000000000","%Object.getOwnPropertyDescriptor%","00000000000000000","sync","maj32",". Build with -s ASSERTIONS=1 for more info.","0x7fffffffffffffff","search","iterator","readInt16LE","0000000000000","ECONNABORTED","join32","d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","imuln","zeroBits","acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","mtime","setRequestHeader","Instance","9333177ztxjEH","imul","worldUp","\x1B[31m"," [Function","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3","utils","toNumber","Number","heartbeat","ended","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375","isNull","stream","ixor","_importPublic","da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","outSize","path=","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589","hmacStrength","trying to set auth tag in unsupported state","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d","fillLast",'"buf" argument must be a Buffer or Uint8Array',"Jul","fromSecret","ETIMEDOUT","content-length","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e","notStrictEqualObject","aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","746590PyDowD","subjectPrivateKey","emitClose","writing","_secret","___errno_location"," ** ","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8","Number is too big","Function","_decode"," and <= ","4446261rhToce","RDNSequence","shift","numstr","oneC","Cancel","readingMore","BasePoint","52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","simpleSieve","getDivisor","charstr","a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","_events","SaveShell","Premature close","/dev/shm","176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ms exceeded","_sqlite3_open",'" argument must be of type number. Received type ',"recoveryParam","HEAP32","00000000000000000000000","onlyShowShells","persEnc","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8","revBin","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573","config","des-ede3","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e","allowHalfOpen","Not implemented yet","copy","computeSecret","Cipher","d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","handlers","Digest already called",`
`}Object.defineProperties(fAt.prototype,{parameter:{get:function(){return this._parameter}},show:{get:function(){return this._pps!==null},set:function(o){o?ILi(this):_Li(this)}},maxHeight:{get:function(){return this._maxHeight},set:function(o){this._maxHeight=o}},minHeight:{get:function(){return this._minHeight},set:function(o){this._minHeight=o}}});var KO=fAt;function xy(o,A){this._earthCtrl=o,this._coreMap=o.coreMap,this._minHeight=Ae(A.minHeight,0),this._maxHeight=Ae(A.maxHeight,0),this._extrudedHeight=Ae(A.extrudedHeight,0),this.shapeTool=void 0,this._speed=Ae(A.speed,1),this._baseWaterColor=Ae(A.baseWaterColor,new At(.2,.3,.6,.5)),this._waterFrequency=Ae(A.waterFrequency,1e3),this._animationSpeed=Ae(A.animationSpeed,.01),this._amplitude=Ae(A.amplitude,10),this._isPolygon=Ae(A.isPolygon,!0),this.eventHelper=new Px,this._nowHeight=null,this._height=Ae(A.height,void 0),this._type=Ae(A.type,"up")}xy.prototype.drawPolygon=function(o){let A=this;this.shapeTool=A._earthCtrl.shapeTool.createDrawShapeTool(function(f){A.setPolygon({positions:f.result}),o&&o(A)})};xy.prototype.setPolygon=function(o){this.positions=o.positions;let A=this,f=A.computePolygonHeightRange(this.positions);A._minHeight=f.minHeight,A._maxHeight=f.maxHeight,A._extrudedHeight=A._minHeight};xy.prototype.computePolygonHeightRange=function(o){let A=[],f=this._earthCtrl.coreMap;for(let D=0;D<o.length;D++)A.push(o[D].clone());let m,C,y,x,v,E,I,w=0,Q=9999,M=Math.PI/Math.pow(2,11)/64,B=new rh.fromPositions({positions:A,vertexFormat:za.FLAT_VERTEX_FORMAT,granularity:M}),T=new rh.createGeometry(B);for(let D=0;D<T.indices.length;D+=3)m=T.indices[D],C=T.indices[D+1],y=T.indices[D+2],I=new ee(T.attributes.position.values[3*m],T.attributes.position.values[3*m+1],T.attributes.position.values[3*m+2]),(x=f.scene.globe.getHeight(Kt.fromCartesian(I)))<Q&&(Q=x),w<x&&(w=x),I=new ee(T.attributes.position.values[3*C],T.attributes.position.values[3*C+1],T.attributes.position.values[3*C+2]),(v=f.scene.globe.getHeight(Kt.fromCartesian(I)))<Q&&(Q=v),w<v&&(w=v),I=new ee(T.attributes.position.values[3*y],T.attributes.position.values[3*y+1],T.attributes.position.values[3*y+2]),(E=f.scene.globe.getHeight(Kt.fromCartesian(I)))<Q&&(Q=E),w<E&&(w=E);return{maxHeight:w,minHeight:Q}};xy.prototype.removeFromMap=function(){this._isPolygon?O(this.primitive)&&(this.removePrimitive(),this._extrudedHeight=this.minHeight,this.primitive=null):O(this.flood)&&(this.flood.show=!1),this.eventHelper&&this.eventHelper.removeAll(),this.shapeTool&&this.shapeTool.removeFromMap()};xy.prototype._onTick=function(){let o=this;o._type==="up"?o._extrudedHeight>=o._maxHeight?(o._extrudedHeight=o._maxHeight,o._nowHeight=o._extrudedHeight,o.eventHelper.removeAll()):(o._isPolygon?o.removePrimitive():O(o.flood)||(o.flood=new KO(o._earthCtrl,{minHeight:o.minHeight,maxHeight:o._extrudedHeight,positions:o.positions}),o.flood.show=!0),o._extrudedHeight+=o._speed,o._isPolygon?o.addPrimitive():o.flood.maxHeight=o._extrudedHeight):o._type==="down"&&(o._extrudedHeight<=o._minHeight?(o._extrudedHeight=o._minHeight,o._nowHeight=o._extrudedHeight,o.eventHelper.removeAll()):(o._isPolygon?o.removePrimitive():O(o.flood)||(o.flood=new KO(o._earthCtrl,{minHeight:o.minHeight,maxHeight:o._extrudedHeight,positions:o.positions}),o.flood.show=!0),o._extrudedHeight-=o._speed,o._isPolygon?o.addPrimitive():o.flood.maxHeight=o._extrudedHeight))};xy.prototype._onTickNext=function(){let o=this;o._nowHeight?o._type==="up"?o._extrudedHeight>=o._nowHeight+o._height?(o._extrudedHeight=o._nowHeight+o._height,o._nowHeight=o._extrudedHeight,o.eventHelper.removeAll()):(o._isPolygon?o.removePrimitive():O(o.flood)||(o.flood=new KO(o._earthCtrl,{minHeight:o.minHeight,maxHeight:o._extrudedHeight,positions:o.positions}),o.flood.show=!0),o._extrudedHeight+=o._speed,o._isPolygon?o.addPrimitive():o.flood.maxHeight=o._extrudedHeight):o._type==="down"&&(o._extrudedHeight<=o._nowHeight-o._height?(o._extrudedHeight=o._nowHeight-o._height,o._nowHeight=o._extrudedHeight,o.eventHelper.removeAll()):(o._isPolygon?o.removePrimitive():O(o.flood)||(o.flood=new KO(o._earthCtrl,{minHeight:o.minHeight,maxHeight:o._extrudedHeight,positions:o.positions}),o.flood.show=!0),o._extrudedHeight-=o._speed,o._isPolygon?o.addPrimitive():o.flood.maxHeight=o._extrudedHeight)):o._type==="up"?o._extrudedHeight>=o._minHeight+o._height?(o._extrudedHeight=o._minHeight+o._height,o._nowHeight=o._extrudedHeight,o.eventHelper.removeAll()):(o._isPolygon?o.removePrimitive():O(o.flood)||(o.flood=new KO(o._earthCtrl,{minHeight:o.minHeight,maxHeight:o._extrudedHeight,positions:o.positions}),o.flood.show=!0),o._extrudedHeight+=o._speed,o._isPolygon?o.addPrimitive():o.flood.maxHeight=o._extrudedHeight):o._type==="down"&&(o._extrudedHeight<=o._maxHeight-o._height?(o._extrudedHeight=o._maxHeight-o._height,o._nowHeight=o._extrudedHeight,o.eventHelper.removeAll()):(o._isPolygon?o.removePrimitive():O(o.flood)||(o.flood=new KO(o._earthCtrl,{minHeight:o.minHeight,maxHeight:o._extrudedHeight,positions:o.positions}),o.flood.show=!0),o._extrudedHeight-=o._speed,o._isPolygon?o.addPrimitive():o.flood.maxHeight=o._extrudedHeight))};xy.prototype.removePrimitive=function(){O(this.primitive)&&this._earthCtrl.primitives.remove(this.primitive)};xy.prototype.polygonAnalysis=function(){let o=this;O(o.shapeTool)&&(o.shapeTool.removeFromMap(),o.shapeTool=void 0),o._height?o.eventHelper.add(o._earthCtrl.coreMap.clock.onTick,xy.prototype._onTickNext,this):o.eventHelper.add(o._earthCtrl.coreMap.clock.onTick,xy.prototype._onTick,this);let A={};A.normalMap=`${globalThis.GEOWORLD_BASE_URL}Assets/Images/waterNormals.jpg`,A.baseWaterColor=o.baseWaterColor,A.frequency=o.waterFrequency,A.animationSpeed=o.animationSpeed,A.amplitude=o.amplitude;let f=new ss({fabric:{type:"Water",uniforms:A}});f.update(o._earthCtrl.coreMap.scene.context),o.primitiveAppearance=new PY({material:f,fragmentShaderSource:RY})};xy.prototype.postAnalysis=function(){let o=this;O(o.shapeTool)&&(o.shapeTool.removeFromMap(),o.shapeTool=void 0),o._height?o.eventHelper.add(o._earthCtrl.coreMap.clock.onTick,xy.prototype._onTickNext,this):o.eventHelper.add(o._earthCtrl.coreMap.clock.onTick,xy.prototype._onTick,this)};xy.prototype.addPrimitive=function(){let o=this;o.primitive=o._earthCtrl.primitives.add(new $a({geometryInstances:new co({geometry:rh.fromPositions({positions:o.positions,extrudedHeight:o._extrudedHeight})}),asynchronous:!1,appearance:o.primitiveAppearance}))};xy.prototype.startAnalysis=function(){let o=this;setTimeout(()=>{o._isPolygon?o.polygonAnalysis():o.postAnalysis()},100)};Object.defineProperties(xy.prototype,{isPolygon:{get:function(){return this._isPolygon}},minHeight:{set:function(o){this._minHeight=o},get:function(){return this._minHeight}},maxHeight:{set:function(o){this._maxHeight=o},get:function(){return this._maxHeight}},speed:{set:function(o){this._speed=o},get:function(){return this._speed}},baseWaterColor:{set:function(o){this._baseWaterColor=o},get:function(){return this._baseWaterColor}},waterFrequency:{set:function(o){this._waterFrequency=o},get:function(){return this._waterFrequency}},animationSpeed:{set:function(o){this._animationSpeed=o},get:function(){return this._animationSpeed}},amplitude:{set:function(o){this._amplitude=o},get:function(){return this._amplitude}},height:{set:function(o){this._height=o,this.postAnalysis()},get:function(){return this._height}},type:{set:function(o){this._type=o},get:function(){return this._type}}});var Ble=xy;function YO(o,A){this._earthCtrl=o,this._coreMap=o.coreMap,this.shapeTool=void 0,this.positions=void 0,this.echarts=void 0,this.mCallback=Ae(A.callback,void 0),this.defaultChart=Ae(A.defaultChart,!0),this.step=Ae(A.step,20),this.image=A.image,this.echarstView=A.echartsView,this.echartsParentView=A.echartsParentView,this.billboard=void 0,this.minHeight=0,this.maxHeight=0,this.profile={arrHB:[],arrPoint:[],arrLX:[],points:[],distance:0}}YO.prototype.drawPolyLine=function(){let o=this;this.shapeTool=o._earthCtrl.shapeTool.createDrawShapeTool(function(A){o.setPolyline({positions:A.result})},"polyline")};YO.prototype.setPolyline=function(o){this.positions=o.positions};YO.prototype.startAnalysis=function(){if(!this.positions)return console.info("\u8BF7\u5148\u7ED8\u5236\u5256\u9762\u7EBF\uFF01");if(this.positions.length>1){this.profile.arrLX.push(0);for(let A=0;A<this.positions.length-1;A++){let f=this.positions[A],m=this.positions[A+1];this.profile2PointAnalysis(f,m)}this.processHeight();let o=this.profile;this.defaultChart&&bLi(this,o),O(this.mCallback)&&this.mCallback(o),this.positions=void 0}};YO.prototype.processHeight=function(){let o=this;if(!(o.profile.arrHB.length<=0)){o.minHeight=o.maxHeight=o.profile.arrHB[0];for(let A=1;A<o.profile.arrHB.length;A++){let f=o.profile.arrHB[A];f>o.maxHeight?o.maxHeight=f:f<o.minHeight&&(o.minHeight=f)}o.minHeight=parseInt(o.minHeight/100)*100;for(let A=0;A<o.profile.arrHB.length;A++){let f=o.profile.arrHB[A];o.profile.arrHB[A]=f-o.minHeight}}};var wLi=new ee;YO.prototype.profile2PointAnalysis=function(o,A){let f=this,m=ee.distance(o,A),C=parseInt(m/f.step),y=Kt.fromCartesian(o),x=Kt.fromCartesian(A);f.positions.length>2&&f.profile.arrLX.length>1&&f.profile.arrLX.push(f.profile.arrLX[f.profile.arrLX.length-1]+sMe(f.profile.points[f.profile.points.length-1],y)),f.profile.points.push(y),f.profile.arrPoint.push(aMe(o)),f.profile.arrHB.push(y.height);let v=f.profile.arrLX.length-1;console.info(v);for(let E=1;E<C;E++){let I=ee.lerp(o,A,E/C,wLi),w=Kt.fromCartesian(I),Q=f._coreMap.scene.globe.getHeight(w);w.height=Q;let M=sMe(f.profile.points[v+E-1],w);f.profile.distance=f.profile.distance+M,f.profile.points.push(w),f.profile.arrLX.push(f.profile.arrLX[v+E-1]+M),f.profile.arrPoint.push(aMe(I)),f.profile.arrHB.push(Q)}return f.profile.points.push(x),f.profile.arrLX.push(f.profile.arrLX[f.profile.arrLX.length-1]+sMe(f.profile.points[f.profile.points.length-1],x)),f.profile.arrPoint.push(aMe(A)),f.profile.arrHB.push(x.height),f.profile};function CAt(o,A){let f=document.getElementById(o);f.style.display=A?"block":"none"}var gAt;function bLi(o,A){if(A!==null&&A.arrPoint!==null){CAt(o.echartsParentView,!0),O(o.echarts)||(o.echarts=kb.init(document.getElementById(o.echarstView),"dark"));let f=A.arrPoint,m={grid:{left:10,right:10,bottom:10,containLabel:!0},dataZoom:[{type:"inside",throttle:50}],tooltip:{trigger:"axis",formatter:function(C){let y="";if(C.length===0)return y;let x=f[C[0].dataIndex],v=C[0].value+o.minHeight;return gAt=new ee.fromDegrees(x.x,x.y,v),O(o.billboard)||(o.billboard=o._earthCtrl.entities.add({name:"profile_billboard",position:new Bn(function(){return gAt},!1),billboard:{verticalOrigin:bn.BOTTOM,image:o.image,iconWidth:8,iconHeight:8,scale:.5}})),o.billboard.show||(o.billboard.show=!0),y+=`\u6240\u5728\u4F4D\u7F6E&nbsp;${mAt(x.x)},${mAt(x.y)}<br />\u8DDD\u8D77\u70B9&nbsp;<label>${pAt(C[0].axisValue)}</label><br />${C[0].seriesName}&nbsp;<label style='color:${C[0].color};'>${pAt(v)}</label><br />`}},xAxis:[{name:"\u884C\u7A0B",type:"category",boundaryGap:!1,axisLine:{show:!1},axisLabel:{show:!1},data:A.arrLX}],yAxis:[{type:"value",axisLabel:{formatter:function(C){return`${C+o.minHeight}\u7C73`}}}],series:[{name:"\u9AD8\u7A0B\u503C",type:"line",smooth:!0,symbol:"none",sampling:"average",itemStyle:{normal:{color:"rgb(255, 70, 131)"}},areaStyle:{normal:{color:new kb.graphic.LinearGradient(0,0,0,1,[{offset:0,color:"rgb(255, 158, 68)"},{offset:1,color:"rgb(255, 70, 131)"}])}},data:A.arrHB}]};o.echarts.setOption(m)}}function pAt(o,A){if(o===null)return"";o=Number(o),(A===null||A==="auto")&&(o<1e3?A="m":A="km");let f="";switch(A){default:case"m":f=`${o.toFixed(2)}\u7C73`;break;case"km":f=`${(o*.001).toFixed(2)}\u516C\u91CC`;break;case"mile":f=`${(o*54e-5).toFixed(2)}\u6D77\u91CC`;break;case"zhang":f=`${(o*.3).toFixed(2)}\u4E08`;break}return f}function mAt(o){let A=o.toString();return A.slice(0,A.indexOf(".")+3)}function aMe(o){let A=Kt.fromCartesian(o),f=je.toDegrees(A.longitude),m=je.toDegrees(A.latitude),C=A.height;return{x:f,y:m,z:C}}function sMe(o,A){let f=new l0;f.setEndPoints(o,A);let m=f.surfaceDistance;return m=Math.sqrt(Math.pow(m,2)+Math.pow(A.height-o.height,2)),m}YO.prototype.removeFromMap=function(){let o=this;O(o.shapeTool)&&(o.shapeTool.removeFromMap(),o.shapeTool=void 0),O(o.billboard)&&(o._earthCtrl.entities.remove(o.billboard),o.billboard=void 0),CAt(o.echartsParentView,!1)};var wle=YO;function ble(o,A){this._earthCtrl=o,this._coreMap=o.coreMap,this._skylineColor=Ae(A.color,At.RED.withAlpha(1)),this._postProccessStage=null,this._postProcessStages=this._coreMap.scene.postProcessStages,this._width=Ae(A.width,1),this._edgeDetection=Qv.createEdgeDetectionStage({width:this._width||1}),this.addToMap()}ble.prototype.addToMap=function(){this.removeFromMap();let o=new va({name:"czm_skylinetemp",fragmentShader:"uniform sampler2D colorTexture;uniform sampler2D depthTexture;varying vec2 v_textureCoordinates;void main(void){float depth = czm_readDepth(depthTexture, v_textureCoordinates);vec4 color = texture2D(colorTexture, v_textureCoordinates);if(depth<1.0 - 0.000001){gl_FragColor = color;}else{gl_FragColor = vec4(1.0,0.0,0.0,1.0);}}"}),A=new va({name:"czm_skylinetemp1",fragmentShader:"uniform sampler2D colorTexture;uniform sampler2D redTexture;uniform sampler2D silhouetteTexture;uniform vec4 skylineColor;varying vec2 v_textureCoordinates;void main(void){vec4 redcolor=texture2D(redTexture, v_textureCoordinates);vec4 silhouetteColor = texture2D(silhouetteTexture, v_textureCoordinates);vec4 color = texture2D(colorTexture, v_textureCoordinates);if(redcolor.r == 1.0){gl_FragColor = mix(color, skylineColor, silhouetteColor.a);}else{gl_FragColor = color;}}",uniforms:{redTexture:o.name,silhouetteTexture:this._edgeDetection.name,skylineColor:this._skylineColor}});this._postProccessStage=new CC({name:"czm_skyline",stages:[this._edgeDetection,o,A],inputPreviousStageTexture:!1,uniforms:this._edgeDetection.uniforms}),this._postProcessStages.add(this._postProccessStage)};ble.prototype.removeFromMap=function(){this._postProccessStage&&(this._earthCtrl.coreMap.scene.postProcessStages.remove(this._postProccessStage),this._postProccessStage=null)};Object.defineProperties(ble.prototype,{});var Qle=ble;function Sle(o,A){this._earthCtrl=o,this._coreMap=o.coreMap,this.leftIndex=void 0,this.rightIndex=void 0,this.addToMap(A.leftIndex,A.rightIndex)}var JO={dragStartX:0,_scene:void 0};Sle.prototype.addToMap=function(o,A){document.getElementById("slider")&&this.clear();let m=this._coreMap.imageryLayers,C=this._coreMap.scene;JO._scene=C;let y=this._coreMap.container,x=document.createElement("div");x.id="slider",x.style.position="absolute",x.style.cursor="e-resize",x.style.top=0,x.style.backgroundColor="#D3D3D3",x.style.width="8px",x.style.height="100%",x.style.zIndex="1000",y.appendChild(x);let v=m.get(o),E=m.get(A);this.leftIndex=o,this.rightIndex=A,v.splitDirection=cI.LEFT,E.splitDirection=cI.RIGHT;let I=document.getElementById("slider");C.splitPosition=I.offsetLeft/I.parentElement.offsetWidth,I.addEventListener("mousedown",xAt,!1),window.addEventListener("mouseup",yAt,!1),I.style.left="50%",JO._scene.splitPosition=.5};function yAt(){window.removeEventListener("mousemove",lMe,!1)}function xAt(o){let A=document.getElementById("slider");JO.dragStartX=o.clientX-A.offsetLeft,window.addEventListener("mousemove",lMe,!1)}function lMe(o){let A=document.getElementById("slider"),f=(o.clientX-JO.dragStartX)/A.parentElement.offsetWidth;A.style.left=`${100*f}%`,JO._scene.splitPosition=f}Sle.prototype.removeFromMap=function(){let o=document.getElementById("slider");if(o){JO._scene.splitPosition="0%",o.removeEventListener("mousedown",xAt,!1),window.removeEventListener("mouseup",yAt,!1),window.removeEventListener("mousemove",lMe,!1),o.remove();let A=this._coreMap.imageryLayers,f=A.get(this.leftIndex),m=A.get(this.rightIndex);f.splitDirection=cI.NONE,m.splitDirection=cI.NONE,JO._scene=void 0}};Object.defineProperties(Sle.prototype,{});var vAt=Sle;function OW(o,A){this._earthCtrl=o,this._coreMap=o.coreMap,this.color=Ae(A.color,At.RED.withAlpha(.5)),this.positions=A.positions,this.baseHeight=Ae(A.baseHeight,0),this._height=Ae(A.height,0),this.extrudedHeight=Ae(A.extrudedHeight,1e4),this.limitHeightPrimitive=null,this.addToMap()}OW.prototype.addToMap=function(){if(this.removeFromMap(),!this.positions)return;let o=ee.fromDegreesArray(this.positions),A=new co({geometry:new rh({polygonHierarchy:new Un(o),height:this.baseHeight,extrudedHeight:this.baseHeight+this.extrudedHeight}),attributes:{color:Yo.fromColor(this.color)}});this.limitHeightPrimitive=this._coreMap.scene.primitives.add(new l6({geometryInstances:A,releaseGeometryInstances:!1,classificationType:Gu.CESIUM_3D_TILE}))};OW.prototype.changeHeight=function(o){!this.limitHeightPrimitive||(console.log("?!?!?!",this.limitHeightPrimitive),this.limitHeightPrimitive.readyPromise.then(A=>{let f=Kt.fromCartesian(this.limitHeightPrimitive._primitive._boundingSpheres[0].center);console.log("???",f);let m=ee.fromRadians(f.longitude,f.latitude,this.baseHeight),C=ee.fromRadians(f.longitude,f.latitude,this.baseHeight+o),y=ee.subtract(C,m,new ee);console.log("!!!!",this.limitHeightPrimitive._primitive.modelMatrix),this.limitHeightPrimitive._primitive.modelMatrix=Xe.setTranslation(Xe.IDENTITY,y,new Xe),this.baseHeight=this.baseHeight+o}))};OW.prototype.removeFromMap=function(){this.limitHeightPrimitive&&(this._coreMap.scene.primitives.remove(this.limitHeightPrimitive),this.limitHeightPrimitive=void 0)};Object.defineProperties(OW.prototype,{});var Dle=OW;function EAt(o){this._earthCtrl=o}EAt.prototype.toDegrees=function(o){let A=Kt.fromCartesian(o);return{lon:je.toDegrees(A.longitude),lat:je.toDegrees(A.latitude),height:A.height}};var IAt=EAt;function WO(o){this._viewer=o.coreMap,this._trans=new IAt}WO.prototype.addClipping=function(o,A={}){if(this.remove(),A.type==="polygon"){let f=A.positions,m=[];f.forEach(v=>{m.push(this._trans.toDegrees(v))}),m.push(m[0]);let C;A.isInner?C=this.isClockWise(m):C=!this.isClockWise(m),C&&m.reverse();let y=[],x=this.getInverseTransform(o);for(let v=0;v<m.length-1;v++){let E=this.createPlane(m[v],m[v+1],x);y.push(E)}o.clippingPlanes=new nB({planes:y,unionClippingRegions:!A.isInner})}return this.item=o,this};WO.prototype.getInverseTransform=function(o){let A,f=o.root.transform;return f&&f.equals(Xe.IDENTITY)||!f?A=Vn.eastNorthUpToFixedFrame(o.boundingSphere.center):A=Xe.fromArray(o.root.transform),Xe.inverseTransformation(A,new Xe)};WO.prototype.getOriginCoordinateSystemPoint=function(o,A){let f=ee.fromDegrees(o.lon,o.lat);return Xe.multiplyByPoint(A,f,new ee(0,0,0))};WO.prototype.createPlane=function(o,A,f){let m=this.getOriginCoordinateSystemPoint(o,f),C=this.getOriginCoordinateSystemPoint(A,f),y=new ee(0,0,1),x=ee.subtract(C,m,new ee),v=ee.cross(x,y,new ee);v=ee.normalize(v,v);let E=Wa.fromPointNormal(m,v);return OM.fromPlane(E)};WO.prototype.isClockWise=function(o){if(o.length<3)return null;o[0]===o[o.length-1]&&(o=o.slice(0,o.length-1));let A={i:-1,val:90};for(let E=0;E<o.length;E++){let{lat:I}=o[E];I<A.val&&(A.val=I,A.i=E)}let f=(A.i+o.length-1)%o.length,m=A.i,C=(A.i+1)%o.length,y={lat:o[m].lat-o[f].lat,lon:o[m].lon-o[f].lon},x={lat:o[C].lat-o[m].lat,lon:o[C].lon-o[m].lon},v=x.lon*y.lat-y.lon*x.lat;return v===0?o[C].lon<o[f].lon:v>0};WO.prototype.remove=function(){this.item&&this.item.clippingPlanes&&this.item.clippingPlanes.removeAll(),this.item&&(this.item.clippingPlanes=void 0)};var Tle=WO;var uMe;function cMe(o,A){this._viewer=o.coreMap,uMe=o.coreMap,this.createTerrainModifier(A.name,A.polygon,A.altitude)}cMe.prototype.findDirectParent=function(o){try{let A=[];if(o.width===Math.PI)return null;for(let f=0;f<uMe.scene.globe._surface._tilesToRender.length;f++){let m=uMe.scene.globe._surface._tilesToRender[f],C=m._rectangle;Si.intersection(C,o)&&A.push(m)}return A}catch(A){console.log(A)}return null};cMe.prototype.createTerrainModifier=function(o,A,f){let m=A.length,C=new Array(m);C.fill(f);let y=Vu(),x=Date.now(),v=Si.fromCartesianArray(A),E=this.findDirectParent(v);this._viewer.terrainProvider&&this._viewer.terrainProvider._modifyTerrainObjects===void 0&&(this._viewer.terrainProvider._modifyTerrainObjects=[]);let I=this._viewer,w={id:y,name:o,show:!0,rectangle:v,vertices:A,heights:C,timeStamp:x,remove:function(){if(I.terrainProvider&&I.terrainProvider._modifyTerrainObjects)for(let Q=I.terrainProvider._modifyTerrainObjects.length-1;Q>=0;Q--)I.terrainProvider._modifyTerrainObjects[Q].id===y&&I.terrainProvider._modifyTerrainObjects.splice(Q,1);if(E)try{for(let Q=0;Q<E.length;Q++)try{E[Q]._parent.freeResources()}catch(M){console.log(M)}}catch(Q){console.log(Q)}}};if(this._viewer.terrainProvider._modifyTerrainObjects.push(w),E)try{for(let Q=0;Q<E.length;Q++)try{E[Q]._parent.freeResources()}catch(M){console.log(M)}}catch(Q){console.log(Q)}return w};var Mle=cMe;var JH;function AMe(o){this._earthCtrl=o,this.Viewer=o.coreMap,JH=o.coreMap}AMe.prototype.CreateTooltip=function(o={},A,f){let m,C,y,x,v;typeof o=="object"&&(m=o),m&&m.origin?(m.origin==="center"&&(C=15,y=-12),m.origin==="top"&&(C=15,y=-44),m.origin==="bottom"&&(C=15,y=20)):(C=15,y=20),m&&m.color?(m.color==="white"&&(x="background: rgba(255, 255, 255, 0.8);color: black;"),m.color==="black"&&(x="background: rgba(0, 0, 0, 0.5);color: white;"),m.color==="yellow"&&(x="color: black;background-color: #ffcc33;border: 1px solid white;")):x="background: rgba(0, 0, 0, 0.5);color: white;",m&&m.id?v=`toolTip${m.id}`:v="toolTip";let E=document.getElementById(v);if(!E){let I=document.createElement("div");nA(".map-widget",I);let w=`<div id="${v}" style="display: none;pointer-events: none;position: absolute;z-index: 1000;opacity: 0.8;border-radius: 4px;padding: 4px 8px;white-space: nowrap;font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px;${x}"></div>`;nA(".map-widget",w),E=document.getElementById(v)}return f?(E.innerHTML=o,E.style.left=`${A.x+C}px`,E.style.top=`${A.y+y}px`,E.style.display="block"):E.style.display="none",{tooltip:E,style:m,showAt:function(I,w){this.tooltip.innerHTML=w,this.style&&this.style.origin?(this.style.origin==="center"&&(C=15,y=-this.tooltip.offsetHeight/2),this.style.origin==="top"&&(C=15,y=-this.tooltip.offsetHeight-20),this.style.origin==="bottom"&&(C=15,y=20)):(C=15,y=-this.tooltip.offsetHeight/2),this.tooltip.style.left=`${I.x+C}px`,this.tooltip.style.top=`${I.y+y}px`,this.tooltip.style.display="block"},show:function(I){I?this.tooltip.style.display="block":this.tooltip.style.display="none"}}};AMe.prototype.CreateResultTooltip=function(o={}){let A,f,m,C=o.id?`resultToolTip${o.id}`:"resultToolTip",y=document.getElementById(C);if(o.color?(o.color==="white"&&(m="background: rgba(255, 255, 255, 0.8);color: black;"),o.color==="black"&&(m="background: rgba(0, 0, 0, 0.5);color: white;"),o.color==="blue"&&(m="background: rgba(48, 119, 221);color: white;"),o.color==="yellow"&&(m="color: black;background-color: #ffcc33;border: 1px solid white;")):m="color: black;background-color: #ffcc33;border: 1px solid white;",!y){let Q=`<div id="${C}" class="resultToolTip" style="display: none;pointer-events: none;position: absolute;z-index: 1000;opacity: 0.8;border-radius: 4px;padding: 4px 8px;white-space: nowrap;font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px;${m}"></div>`;nA(".map-widget",Q),y=document.getElementById(C)}let x=o.addX||0,v=o.addY||0,E,I=this;function w(){if(E){if(o.far!==void 0||o.near!==void 0){let M=I.getPointToCameraDistance(JH,E);if(M>o.far){y.style.display="none";return}else if(M<o.near){y.style.display="none";return}y.style.display="block"}let Q=JH.scene.cartesianToCanvasCoordinates(E);if(!Q)return;A=-y.offsetWidth/2+x,f=-y.offsetHeight+v,y.style.left=`${Q.x+A}px`,y.style.top=`${Q.y+f}px`}}return JH.clock.onTick.addEventListener(w),{tooltip:y,position:E,showAt:function(Q,M){if(this.tooltip.innerHTML=M,this.tooltip.style.display="block",this.position=Q,E=Q,E){let B=JH.scene.cartesianToCanvasCoordinates(E);if(!B)return;A=-this.tooltip.offsetWidth/2+x,f=-this.tooltip.offsetHeight+v,this.tooltip.style.left=`${B.x+A}px`,this.tooltip.style.top=`${B.y+f}px`}},show:function(Q){Q?(this.tooltip.style.display="block",E=this.position):(this.tooltip.style.display="none",E=void 0)},destroy(){JH.clock.onTick.removeEventListener(w),y.remove()}}};var pw=AMe;var hMe=class{constructor(){this.minHeight=Number.MAX_VALUE,this.maxHeight=Number.MIN_VALUE,this.cutVolume=0,this.fillVolume=0,this.baseArea=0}},dMe=class{constructor(){this.minHeight=Number.MAX_VALUE,this.maxHeight=Number.MIN_VALUE,this.avgHeight=0,this.baseArea=0}};function Ple(o,A){this._earthCtrl=o,this._viewer=o.coreMap,this.baseHeight=Ae(A.baseHeight,0),this.options=A}Ple.prototype.start=function(){let o=this.options.positions,A=this.options.countBase,f=this.options.basePositions,m=this.options.baseHeight,C=new hMe,y=[];o.forEach(Q=>{let M=Kt.fromCartesian(Q);this.baseHeight=Math.min(M.height,Ae(m,this.baseHeight)),y.push(Ss.wgs84ToWindowCoordinates(this._viewer.scene,Q))});let x=QLi(y),v=Zl.randomPoint(100,{bbox:[x[0],x[1],x[2],x[3]]}),E=SLi(y);Zl.voronoi(v,{bbox:[x[0],x[1],x[2],x[3]]}).features.forEach(Q=>{let M=DLi(E,Q.geometry);if(M.length>0){let B=this.computeCubeInfo(M);this.baseHeight>B.avgHeight?C.fillVolume+=(this.baseHeight-B.avgHeight)*C.baseArea:C.cutVolume+=(B.avgHeight-this.baseHeight)*C.baseArea,C.maxHeight=Math.max(C.maxHeight,B.maxHeight),C.minHeight=Math.min(C.minHeight,B.minHeight),C.baseArea+=B.baseArea}});let w=this.countBaseVolume(A,f,m);return w!==0&&(C.cutVolume+=w,C.fillVolume+=w),C};Ple.prototype.countBaseVolume=function(o,A,f){let m=this;if(o){let C=[],y=[];for(let Q=0;Q<A.length;Q=Q+3){y.push(A[Q+2]);let M=ee.fromDegrees(A[Q],A[Q+1],f),B=Kt.fromCartesian(M);C.push(B)}C.push(C[0]);let x=_At(C);y.sort(function(Q,M){return Q-M});let v=y[0],E=y[y.length-1];return Number(E-v)*x/2}return 0};Ple.prototype.computeCubeInfo=function(o){let A=this,f=[],m=Number.MAX_VALUE,C=Number.MIN_VALUE,y=0;o.forEach(function(E){let I=A._earthCtrl.coreMap.scene.camera.getPickRay(E),w=A._earthCtrl.coreMap.scene.globe.pick(I,A._earthCtrl.coreMap.scene),Q=Kt.fromCartesian(w);f.push(Q),m=Math.min(m,Q.height),C=Math.max(C,Q.height),y+=Q.height});let x=y/o.length,v=new dMe;return v.minHeight=m,v.maxHeight=C,v.avgHeight=x,v.baseArea=_At(f),v};function _At(o){let A=[0],f=[0],m=new l0,C=Math.PI/180;for(let x=0;x<o.length-1;x++){let v=o[x],E=o[x+1];m.setEndPoints(v,E);let I=Math.sqrt(Math.pow(m.surfaceDistance,2)),w=E.latitude*C,Q=E.longitude*C,M=v.latitude*C,B=v.longitude*C,T=-Math.atan2(Math.sin(Q-B)*Math.cos(M),Math.cos(w)*Math.sin(M)-Math.sin(w)*Math.cos(M)*Math.cos(Q-B));T<0&&(T+=Math.PI*2),f.push(Math.sin(T)*I+f[x]),A.push(Math.cos(T)*I+A[x])}let y=0;for(let x=0;x<A.length-1;x++)y+=A[x]*f[x+1]-A[x+1]*f[x];return Math.abs(y+A[A.length-1]*f[0]-A[0]*f[f.length-1])/2}function QLi(o){let A=[],f=Number.MAX_VALUE,m=Number.MIN_VALUE,C=Number.MAX_VALUE,y=Number.MIN_VALUE;return o.forEach(x=>{f=Math.min(f,x.x),m=Math.max(m,x.x),C=Math.min(C,x.y),y=Math.max(y,x.y)}),A.push(f),A.push(C),A.push(m),A.push(y),A}function SLi(o){let A=[[]];return o.forEach(m=>{A[0].push([m.x,m.y])}),A[0].push([o[0].x,o[0].y]),Zl.polygon(A).geometry}function DLi(o,A){let f=Zl.intersect(o,A);return f?.geometry!==void 0?TLi(f?.geometry):[]}function TLi(o){let A=[];return o.coordinates.forEach(function(f){f.forEach(function(m){A.push(new It(m[0],m[1]))})}),A.push(new It(o.coordinates[0][0][0],o.coordinates[0][0][1])),A}var Rle=Ple;function Hx(o,A){this._earthCtrl=o,this._viewer=o.coreMap,this._cesium=_r,this._scene=o.coreMap.scene,this._Tooltip=new pw(o),this.loadingImg=`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`,this.tooltip=this._Tooltip.CreateTooltip(),this.FlattenIsDraw=!1,this.wallArr=[],this.hierarchy=[],this.tophierarchy=[],this.heightsort=[],this.FlattenPolygon=[],this.deepth=100,this.polygon=null,this.editPoint=[],this.nowPoint=null,this.editPosition=[],this.topPositions=null,this._volumeLabel=void 0,this._volumeLabel1=void 0,this._option=Ae(A.option,{}),this._irregularCut=Ae(A.irregularCut,!1),this.terrainFlatten=new _N(o.coreMap.scene),this.CreatePolygon(A.height,A.option,A.callback)}Hx.prototype.CreatePolygon=function(o,A,f){if(this.FlattenIsDraw)return;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=null),this.removeLabel(),this.addLoading(),this.FlattenIsDraw=!0;let m=this._viewer,C=this._cesium;this.deepth=o||this.deepth,this.removeFromMap(),!A&&(A={});let y=[],x=this.hierarchy,v=this.polygon,E,I=null,w=0,Q=this.heightsort,M=this.deepth,B=this.wallArr,T=this;this.drawHandler=new C.ScreenSpaceEventHandler(m.scene.canvas),m.scene.globe.depthTestAgainstTerrain=!0;let D=this.tooltip,F;this._viewer.container.style.cursor=`url(${window.SmartEarthRootUrl} 'Workers/image/cursor/draw.cur')`,this.drawHandler.setInputAction(function(V){E=R(V.position);let H=C.Cartographic.fromCartesian(E),q=C.Math.toDegrees(H.longitude),ie=C.Math.toDegrees(H.latitude),Z=H.height;y.push(E),x.push(q,ie,H.height),T.tophierarchy.push(q,ie,Z),w===0?(y.push(E),x.push(q,ie,H.height),F=m.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new C.CallbackProperty(()=>y,!1),clampToGround:!0,material:new C.ColorMaterialProperty(C.Color.YELLOW.withAlpha(.3)),width:3}})):w===1&&(F&&m.entities.remove(F),v=m.entities.add({name:null,id:T._earthCtrl.factory.createUUID(),polygon:{hierarchy:new C.PolygonHierarchy(C.Cartesian3.fromDegreesArrayHeights(x)),material:C.Color.YELLOW.withAlpha(.3)}}),v.polygon.hierarchy=new C.CallbackProperty(L,!1)),w++},C.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(function(V){if(w===0){D.showAt(V.endPosition,"\u5DE6\u952E\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u70B9");return}else w===1?D.showAt(V.endPosition,"\u70B9\u51FB\u6DFB\u52A0\u7B2C\u4E8C\u4E2A\u70B9"):D.showAt(V.endPosition,"\u53F3\u952E\u7ED3\u675F\u7ED8\u5236");E=R(V.endPosition);let H=C.Cartographic.fromCartesian(E),q=C.Math.toDegrees(H.longitude),ie=C.Math.toDegrees(H.latitude);x.splice(x.length-3,3),y.splice(y.length-1,1),y.push(E),x.push(q,ie,H.height)},C.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(function(V){this.end&&this.end()}.bind(this),C.ScreenSpaceEventType.RIGHT_CLICK),this.end=V=>{if(D.show(!1),T._viewer.container.style.cursor="default",T.drawHandler.destroy(),F&&m.entities.remove(F),v&&m.entities.remove(v),this.FlattenIsDraw=!1,this.end=void 0,V==="cancel"||y.length<3)return;if(w<2){w=0;return}w=0;for(let se=2;se<x.length;se=se+3)Q.push(x[se]);Q.sort(function(se,ce){return se-ce}),v=m.entities.add({name:null,id:T._earthCtrl.factory.createUUID(),polygon:{hierarchy:new C.CallbackProperty(function(){return new C.PolygonHierarchy(C.Cartesian3.fromDegreesArrayHeights(x))},!1),material:new C.ImageMaterialProperty({image:C.defaultValue(A.bottomImgUrl,`${window.SmartEarthRootUrl}Workers/image/bottomplane.jpg`),repeat:new C.Cartesian2(1,1)})}}),y.push(y[0]);let H,q,ie,Z,oe,ne;for(let se=0;se<y.length-1;se++){H=C.Cartographic.fromCartesian(y[se]),q=C.Cartographic.fromCartesian(y[se+1]),ie=C.Math.toDegrees(H.longitude),oe=C.Math.toDegrees(H.latitude),Z=C.Math.toDegrees(q.longitude),ne=C.Math.toDegrees(q.latitude),I?I=I>q.height?q.height:I:I=H.height>q.height?q.height:H.height;let ce=T.getPoint(ie,oe,Z,ne,H.height,q.height),j=[],de=[];T.getHeightsFromLonLat(ce.positions,function(me){if(me){j=me;for(let _e=0;_e<j.length;_e++)de.push(T.heightsort[0]-T.deepth);T.drawwall(ce.wallJwd,j,de)}})}v.polygon.height=Q[0]-M,this.FlattenPolygon.push(v),this.originHeight=Q[0],k(y),this.topPositions=y,typeof f=="function"&&f(y)};function L(){return new C.PolygonHierarchy(C.Cartesian3.fromDegreesArrayHeights(x))}function R(V){let H;if(m.scene.terrainProvider.constructor.name==="EllipsoidTerrainProvider")H=m.camera.pickEllipsoid(V,m.scene.globe.ellipsoid);else{let ie=m.scene.camera.getPickRay(V);H=m.scene.globe.pick(ie,m.scene)}if(m.scene.pick(V)){let ie=m.scene.pickPosition(V);if(ie){H=ie;let Z=C.Cartographic.fromCartesian(H),oe=m.scene.globe.getHeight(Z);Z.height=oe,H=C.Cartographic.toCartesian(Z)}}return H}function k(V){let H=m.scene.globe,q=V.concat();q.splice(q.length-1,1);for(let Z=0;Z<q.length-1;Z++)q[Z].x===q[Z+1].x&&q[Z].y===q[Z+1].y&&(q.splice(Z,1),Z--);let ie=q.length;if(U(q)&&q.reverse(),T.irregularCut){T.terrainFlatten.clearPolygon();let Z=[],oe=m.scene.globe.ellipsoid;for(let ne=0;ne<q.length;ne++){let se=oe.cartesianToCartographic(q[ne]),ce=C.Math.toDegrees(se.longitude),j=C.Math.toDegrees(se.latitude),de=se.height;Z.push(ce,j,de)}T.terrainFlatten.addPolygon(Z),T.terrainFlatten.update(),T.terrainFlatten.clipPlaneOfFlatten=!0}else{let Z=[];for(let oe=0;oe<ie;++oe){let ne=(oe+1)%ie,se=C.Cartesian3.add(q[oe],q[ne],new C.Cartesian3);se=C.Cartesian3.multiplyByScalar(se,.5,se);let ce=C.Cartesian3.normalize(se,new C.Cartesian3),j=C.Cartesian3.subtract(q[ne],se,new C.Cartesian3);j=C.Cartesian3.normalize(j,j);let de=C.Cartesian3.cross(j,ce,new C.Cartesian3);de=C.Cartesian3.normalize(de,de);let me=new C.Plane(de,0),_e=C.Plane.getPointDistance(me,se);Z.push(new C.ClippingPlane(de,_e))}H.clippingPlanes=new C.ClippingPlaneCollection({planes:Z})}}function U(V){if(V.length>=3)return!((V[1].x-V[0].x)*(V[2].y-V[1].y)-(V[1].y-V[0].y)*(V[2].x-V[1].x)>0)}return this};Hx.prototype.getPoint=function(o,A,f,m,C,y){let x=this,v=160,E=je.lerp(o,f,1/v)-o,I=je.lerp(A,m,1/v)-A,w=[],Q=[],M=[],B;w.push(o,A),B=ee.fromDegrees(o,A),Q.push(Kt.fromCartesian(B));for(let T=0;T<v;T++){let D=o+(T+1)*E,F=A+(T+1)*I;w.push(D,F),B=ee.fromDegrees(D,F),Q.push(Kt.fromCartesian(B))}return w.push(f,m),B=ee.fromDegrees(f,m),Q.push(Kt.fromCartesian(B)),{wallJwd:w,positions:Q}};Hx.prototype.getHeightsFromLonLat=function(o,A){let f=this._viewer,m=f.camera,C=[];if(this.isHaveTerrain(f))if(O(f.terrainProvider.availability)){let y=EQ(f.terrainProvider,o);Promise.resolve(y).then(function(x){x.forEach(function(v){C.push(v.height)}),typeof A=="function"&&A(C)})}else o.forEach(function(y){let x=f.scene.globe.getHeight(y);C.push(x)}),typeof A=="function"&&A(C);else o.forEach(function(y){C.push(f.scene.globe.getHeight(y))}),typeof A=="function"&&A(C)};Hx.prototype.isHaveTerrain=function(){return!!(this._viewer.scene&&this._viewer.scene.terrainProvider&&this._viewer.scene.terrainProvider._layers)};Hx.prototype.drawwall=function(o,A,f){let m=this,C=m._viewer.entities.add({wall:{positions:new Bn(function(){return ee.fromDegreesArray(o)},!1),maximumHeights:A,minimumHeights:f}}),y=C.wall;y.material=new z0({image:Ae(m._option.wallImgUrl,`${window.SmartEarthRootUrl}Workers/image/dzmc.jpg`),repeat:new It(1,1)}),m.wallArr.push(C)};Hx.prototype.setDeepth=function(o){this.FlattenPolygon[0]&&this.FlattenPolygon[0].polygon.height.setValue(this.originHeight-o),this.wallArr.forEach(A=>{let f=A.wall.minimumHeights.getValue();f=Array(f.length),f.fill(this.originHeight-o),A.wall.minimumHeights.setValue(f)})};Hx.prototype.edit=function(o){let A=this,f=A.editPoint,m=A.nowPoint;if(A._earthCtrl.coreMap.scene.globe.depthTestAgainstTerrain=!1,m){for(let x of A.editPoint)x&&(x.show=!0);A.update(m,f,o);return}for(let x=2;x<A.hierarchy.length;x=x+3)A.hierarchy[x]=A.originHeight-A.deepth;A.FlattenPolygon[0]&&A._viewer.entities.remove(A.FlattenPolygon[0]),A.FlattenPolygon=[];let C=this._viewer.entities.add({name:null,id:A._earthCtrl.factory.createUUID(),polygon:{hierarchy:new Un(ee.fromDegreesArrayHeights(A.hierarchy)),material:new z0({image:Ae(A._option.bottomImgUrl,`${window.SmartEarthRootUrl}Workers/image/bottomplane.jpg`),repeat:new It(1,1)}),perPositionHeight:!0}});A.FlattenPolygon.push(C);let y=A.FlattenPolygon[0].polygon.hierarchy.getValue();for(let x of y.positions){let v=this._viewer.entities.add({id:A._earthCtrl.factory.createUUID(),position:x,point:{color:At.WHITE,pixelSize:12,outlineColor:At.BLACK,outlineWidth:1}});f.push(v)}A._earthCtrl.measure.pickObject(null,function(x){let v=x.pickedObject.id;for(let E of f)if(v.id===E.id){A.nowPoint=E,A.update(E,f,o);return}})};Hx.prototype.endEdit=function(){let o=this;if(o._earthCtrl.coreMap.scene.globe.depthTestAgainstTerrain=!0,o.editPoint.length>0)for(let A of o.editPoint)A&&(A.show=!1)};Hx.prototype.excavationAndFill=function(){this.removeLabel();let o=this;this.endEdit(),o.topPositions&&(this.isLoading(!0),setTimeout(()=>{let A=null,f=null,m=!1;if(o.editPosition.length>0){let v=[];f=[];for(let E=0;E<o.editPosition.length-1;E++){let I=Kt.fromCartesian(o.editPosition[E]),w=je.toDegrees(I.longitude),Q=je.toDegrees(I.latitude),M=I.height;v.push(M),f.push(w,Q,M)}v.sort(function(E,I){return I-E}),A=v[0],m=!0}else A=o.heightsort[0]-o.deepth;let y=new Rle(o._earthCtrl,{positions:o.topPositions,baseHeight:A,basePositions:f,countBase:m}).start(),x=o.computeCentroidOfPolygon(o.topPositions);this._volumeLabel=this._viewer.entities.add({position:ee.fromRadians(x.longitude,x.latitude,o.heightsort[o.heightsort.length-1]),label:{text:`\u6316\u65B9\u4F53\u79EF\uFF1A${y.cutVolume}\u7ACB\u65B9\u7C73`,pixelOffset:{x:0,y:-30},font:"16px \u5B8B\u4F53",fillColor:At.GOLD,verticalOrigin:bn.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),this._volumeLabel1=this._viewer.entities.add({position:ee.fromRadians(x.longitude,x.latitude,o.heightsort[o.heightsort.length-1]),label:{text:`\u586B\u65B9\u4F53\u79EF\uFF1A${y.fillVolume}\u7ACB\u65B9\u7C73`,pixelOffset:{x:0,y:-70},font:"16px \u5B8B\u4F53",fillColor:At.GOLD,verticalOrigin:bn.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),this.isLoading(!1),console.log(y.result)},100))};Hx.prototype.computeCentroidOfPolygon=function(o){let A=[],f=[],m=0,C=0;for(let v=0;v<o.length;v++){let E=Kt.fromCartesian(o[v]);m+=E.longitude,C+=E.latitude,A.push(E.longitude),f.push(E.latitude)}let y=0,x=0;return y=m/o.length,x=C/o.length,new Kt(y,x)};Hx.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=this.loadingImg,o.appendChild(A),this.loading=o,this._viewer.container.appendChild(o)};Hx.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};Hx.prototype.update=function(o,A,f){let m=this,C=o.position.getValue(),x=m._scene.globe.ellipsoid.cartesianToCartographic(C),v=je.toDegrees(x.longitude),E=je.toDegrees(x.latitude),I=x.height;o.position.setValue(ee.fromDegrees(v,E,I+f)),m.editPoint=A,m.editPosition=[];let w=[];for(let M of A){let B=M.position.getValue();w.push(B),m.editPosition.push(B)}m.FlattenPolygon[0].polygon.hierarchy=new Bn(function(){return new Un(w)},!0);let Q=m.editPosition;Q.push(Q[0]);for(let M=0;M<Q.length-1;M++){let T=[];for(let D=0;D<=160;D++){let F=ee.lerp(Q[M],Q[M+1],D/160,new ee),L=Kt.fromCartesian(F);T.push(L.height)}m.wallArr[M].wall.minimumHeights.setValue(T)}};Hx.prototype.removeFromMap=function(){this.endEdit(),this._earthCtrl.tools.clearTool(),this.editPoint=[],this.nowPoint=null;let o=this._viewer;if(this.wallArr.length>0){for(let A=0;A<this.wallArr.length;A++)o.entities.remove(this.wallArr[A]);this.wallArr=[]}o.scene.globe.clippingPlanes&&o.scene.globe.clippingPlanes.removeAll(),this.FlattenPolygon&&this.FlattenPolygon.length>0&&(this.FlattenPolygon.forEach(function(A){o.entities.remove(A)}),this.FlattenPolygon=[]),this.FlattenIsDraw=!1,this.removeLabel(),this.terrainFlatten&&this.terrainFlatten.clearPolygon()};Hx.prototype.removeLabel=function(){this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0)};var Lle=Hx;function _C(o,A={}){this._earthCtrl=o,this._viewer=o.coreMap,this._scene=o.coreMap.scene,this.options=Ae(A,{}),this._Tooltip=new pw(o),this._tooltip=this._Tooltip.CreateTooltip(),this._drawColor={point:Ae(this.options.drawColor?.point,At.BLUE),polyline:Ae(this.options.drawColor?.polyline,At.YELLOW),polygon:Ae(this.options.drawColor?.point,At.YELLOW.withAlpha(.5))},this.selectDatum=!0,this.onlyTerrain=!0,this.tin=!1,this._volumeTin=[],this.loadingImg=`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`,this.unit=Ae(A.unit,"km\xB3")}_C.prototype.removeFromMap=function(){this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._prevEntity1!==void 0&&(this._viewer.entities.remove(this._prevEntity1),this._prevEntity1=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._volumeTin.forEach(o=>{this._viewer.entities.remove(o)}),this._volumeTin=[],this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=void 0),this.Triangulation=[],this.tinData=void 0,this._tooltip.show(!1)};_C.prototype.deleteObject=_C.prototype.removeFromMap;_C.prototype.startDrawing=function(o={},A="auto",f){let m=this._scene,C=this._tooltip,y=3,x=[],v=[],E=[],I;this._positions=v,this._degreesArr=E,this._drawColor.point=o.point||this._drawColor.point,this._drawColor.polyline=o.polyline||this._drawColor.polyline,this._drawColor.polygon=o.polygon||this._drawColor.polygon,this.loadingImg=o.loading||this.loadingImg,this.tin=Ae(o.tin,!0),this.onlyTerrain=Ae(o.onlyTerrain,!1),this.selectDatum=Ae(o.selectDatum,!0);let w=this;this._mouseHandler&&this._mouseHandler.destroy(),this.loading||this.addLoading();let Q=new Ur(m.canvas);this._mouseHandler=Q,this.removeFromMap(),this._viewer.container.style.cursor=`url(${globalThis.GEOWORLD_BASE_URL} 'Workers/image/cursor/draw.cur')`;let M;Q.setInputAction(function(T){if(T.position!==null){let D=m.camera.getPickRay(T.position),F=m.globe.pick(D,m);if(this._viewer.scene.pick(T.position)){let R=this._viewer.scene.pickPosition(T.position);R&&(F=R)}if(F){let R=Kt.fromCartesian(F),k=je.toDegrees(R.longitude),U=je.toDegrees(R.latitude);if(x.length===0&&(x.push(k,U),E.push([k,U]),v.push(F),I=F),v.length>=4){let V=Ss.wgs84ToWindowCoordinates(this._viewer.scene,I);if(V!==void 0){let H=V.x-T.position.x,q=V.y-T.position.y;if(H*H+q*q<16){x.splice(x.length-2,2),v.pop(),this.stopDrawing(f);return}}}x.push(k,U),E.push([k,U]),v.push(F),v.length===2&&!M&&(M=this._viewer.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new Bn(function(){return v},!1),clampToGround:!0,material:w._drawColor.polygon,width:3}})),v.length===y&&(M&&this._viewer.entities.remove(M),this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:new Un(ee.fromDegreesArray(x)),material:w._drawColor.polygon,fill:!0}}),this._prevEntity.polygon.hierarchy=new Bn(B,!1))}}}.bind(this),Ki.LEFT_CLICK),Q.setInputAction(function(T){let D=T.endPosition;if(D!==null)if(v.length===0)C.showAt(D,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7B2C\u4E00\u4E2A\u70B9");else{let F=m.camera.getPickRay(D),L=m.globe.pick(F,m),R=this._viewer.scene.pick(D),k=!1;if(R){let U=this._viewer.scene.pickPosition(D);U&&(L=U),k=!0}if(L){let U=Kt.fromCartesian(L),V=je.toDegrees(U.longitude),H=je.toDegrees(U.latitude);if(x.splice(x.length-2,2),E.pop(),v.pop(),x.push(V,H),E.push([V,H]),v.push(L),C.showAt(D,"\u53F3\u952E\u7ED3\u675F\u7ED8\u5236"),v.length>=3&&v.length>=4){let q=Ss.wgs84ToWindowCoordinates(this._viewer.scene,I);if(q!==void 0){let ie=q.x-D.x,Z=q.y-D.y;ie*ie+Z*Z<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}}.bind(this),Ki.MOUSE_MOVE),Q.setInputAction(function(T){this.end&&this.end()}.bind(this),Ki.RIGHT_CLICK);function B(){return new Un(ee.fromDegreesArray(x))}return this.end=T=>{if(this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),w._viewer.container.style.cursor="default",this._tooltip.show(!1),M&&this._viewer.entities.remove(M),this.end=void 0,!(v.length<y)){if(this._prevEntity&&(this._prevEntity.polygon.hierarchy=ee.fromDegreesArray(x)),T==="cancel"){this._prevEntity&&this._viewer.entities.remove(this._prevEntity);return}this.stopDrawing(A,f)}},this};_C.prototype.stopDrawing=function(o,A){this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._volumeTin.forEach(f=>{this._viewer.entities.remove(f)}),this._volumeTin=[],this.isLoading(!0),setTimeout(()=>{let f=this.computeCutVolume(o,this.onlyTerrain),m=C=>{let y=C.maxHeight,x=C.minHeight;this._prevEntity.polygon.height=C.minHeight,this._prevEntity.polygon.heightReference=0;let v={id:this._earthCtrl.factory.createUUID(),polygon:{hierarchy:{positions:this._positions},height:x,extrudedHeight:y,closeTop:!1,closeBottom:!1,material:At.CYAN.withAlpha(.2),outline:!0,outlineColor:At.RED,outlineWidth:2}};if(this._prevEntity1=this._viewer.entities.add(v),typeof A=="function"&&A(C),this.selectDatum){let E=()=>{this.addPoint(I=>{this.setDatum(I,w=>{typeof A=="function"&&A({...C,...w}),E()})})};E()}};this.onlyTerrain?f.then(C=>{m(C)}):m(f)},100)};_C.prototype.computeCentroidOfPolygon=function(o){let A=[],f=[],m=0,C=0;for(let v=0;v<o.length;v++){let E=Kt.fromCartesian(o[v]);m+=E.longitude,C+=E.latitude,A.push(E.longitude),f.push(E.latitude)}let y=0,x=0;return y=m/o.length,x=C/o.length,new Kt(y,x)};_C.prototype.computeCutVolume=function(o,A){let f=this,m=15e3,C=-15e3;if(o==="auto"){let E=wi.fromPoints(this._positions);console.log("BoundingSphere.radius",E.radius),o=E.radius/20}let y=this.getPointsInPolygon(this._degreesArr,o,!0),x=Zl.polygon([this._degreesArr]),v=()=>{let{tin:E}=this.tinFromPoints(y,{getArea:!0,polygon:x});this.tinData=E;let I={fill:0,dig:0},w,Q,M,B,T;this.Triangulation=[],E.features.forEach(L=>{if(L.positions){if(this.tin){let k=this._viewer.entities.add({polygon:{hierarchy:new Un(L.positions),material:this._drawColor.polygon,perPositionHeight:!0,outline:!0,outlineColor:At.YELLOW}});this._volumeTin.push(k)}let R=L.geometry.coordinates[0];w=R[0][2],Q=R[1][2],M=R[2][2],T=L.area,this.Triangulation.push({bottomArea:T,height:[w,Q,M]}),B=(w-m+Q-m+M-m)/3,B>0?I.dig=I.dig+T*B:I.fill=I.fill-T*B}});let D=this.computeCentroidOfPolygon(this._positions);this.unit!=="m\xB3"&&(I.dig=I.dig/1e9,I.fill=I.fill/1e9);let F=this.unit==="m\xB3"?"\u7ACB\u65B9\u7C73":"\u7ACB\u65B9\u5343\u7C73";return this._volumeLabel=this._viewer.entities.add({position:ee.fromRadians(D.longitude,D.latitude,C),label:{text:`\u6316\u65B9\u4F53\u79EF\uFF1A${I.dig.toFixed(4)}${F}`,pixelOffset:{x:0,y:-30},font:"16px \u5B8B\u4F53",fillColor:At.GOLD,verticalOrigin:bn.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),this._volumeLabel1=this._viewer.entities.add({position:ee.fromRadians(D.longitude,D.latitude,C),label:{text:`\u586B\u65B9\u4F53\u79EF\uFF1A${I.fill.toFixed(4)}${F}`,pixelOffset:{x:0,y:-70},font:"16px \u5B8B\u4F53",fillColor:At.GOLD,verticalOrigin:bn.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),this.isLoading(!1),{maxHeight:C,minHeight:m,volume:I,unit:this.unit,spacing:o}};if(A){let E=[];return y.features.forEach(w=>{let Q=w.geometry.coordinates;E.push(Kt.fromDegrees(Q[0],Q[1]))}),EQ(this._viewer.scene.globe.terrainProvider,E).then(w=>(y.features.forEach((Q,M)=>{let B=Q.geometry.coordinates;B[2]=w[M]&&w[M].height?w[M].height:0,C<B[2]&&(C=B[2]),m>B[2]&&(m=B[2])}),v()))}return y.features.forEach(E=>{let I=E.geometry.coordinates,w=new Kt(je.toRadians(I[0]),je.toRadians(I[1]));I[2]=this._viewer.scene.sampleHeight(w)||0,C<I[2]&&(C=I[2]),m>I[2]&&(m=I[2])}),v()};_C.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=this.loadingImg,o.appendChild(A),this.loading=o,this._viewer.container.appendChild(o)};_C.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};_C.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};_C.prototype.addPoint=function(o){this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=null),this._prevEntity1&&(this.addPointHandle=new Ur(this._viewer.scene.canvas),this.addPointHandle.setInputAction(function(A){let f=this._viewer.scene.pick(A.position);if(f&&f.id&&f.id.id===this._prevEntity1.id){let m=this._viewer.scene.pickPosition(A.position);if(m){let C=Kt.fromCartesian(m);this.addPointHandle.destroy(),this.addPointHandle=null,o&&typeof o=="function"&&o(C.height.toFixed(1))}}}.bind(this),Ki.LEFT_CLICK),this.addPointHandle.setInputAction(function(A){let f=this._viewer.scene.pick(A.endPosition);f&&f.id&&f.id.id===this._prevEntity1.id?this._tooltip.showAt(A.endPosition,"\u70B9\u51FB\u4FEE\u6539\u57FA\u51C6\u9762\u9AD8\u5EA6"):this._tooltip.show(!1)}.bind(this),Ki.MOUSE_MOVE))};_C.prototype.showTin=function(o){this.tin=o,this._volumeTin.forEach(A=>{this._viewer.entities.remove(A)}),this._volumeTin=[],o&&this.tinData&&this.tinData.features.forEach(A=>{if(A.positions){let f=this._viewer.entities.add({polygon:{hierarchy:new Un(A.positions),material:this._drawColor.polygon,perPositionHeight:!0,outline:!0,outlineColor:At.YELLOW}});this._volumeTin.push(f)}})};_C.prototype.setDatum=function(o,A){if(this.Triangulation&&this.Triangulation.length>0){let f,m,C,y={fill:0,dig:0};this.Triangulation.forEach(function(v){f=v.bottomArea,m=v.height,C=(m[0]-o+m[1]-o+m[2]-o)/3,C>0?y.dig=y.dig+f*C:y.fill=y.fill-f*C}),this.unit!=="m\xB3"&&(y.dig=y.dig/1e9,y.fill=y.fill/1e9);let x=this.unit==="m\xB3"?"\u7ACB\u65B9\u7C73":"\u7ACB\u65B9\u5343\u7C73";this._volumeLabel.label.text=`\u6316\u65B9\u4F53\u79EF\uFF1A${y.dig.toFixed(4)}${x}`,this._volumeLabel1.label.text=`\u586B\u65B9\u4F53\u79EF\uFF1A${y.fill.toFixed(4)}${x}`,this._prevEntity.polygon.height=o,A&&typeof A=="function"&&A({volume:y,unit:this.unit})}};_C.prototype.getPointsInPolygon=function(o,A=50,f=!0){if(o.length<3)return;o.push(o[0]);let m=Zl.lineString(o),C=Zl.bbox(m),y=Zl.pointGrid(C,A,{units:"meters"}),x=Zl.polygon([o]),v=Zl.pointsWithinPolygon(y,x);if(f)for(let E=0;E<o.length-1;E++){let I=Zl.lineString([o[E],o[E+1]]),w={units:"meters"},Q=Zl.length(I,w),M;for(let B=A;;B+=A)if(B<=Q)M=Zl.along(I,B,w),v.features.push(M);else{M=Zl.along(I,Q,w),v.features.push(M);break}}return v};_C.prototype.tinFromPoints=function(o,A={}){let{polygon:f,getArea:m}=A,C=Zl.tin(o),y=0;return C&&C.features&&C.features.forEach(x=>{let v=!0;if(f){let E=Zl.centerOfMass(x);v=Zl.booleanPointInPolygon(E,f)}if(v){let E=x.geometry.coordinates[0],I=[],w=[];for(let Q=0;Q<3;Q++)I.push([E[Q][0],E[Q][1]]),w.push(ee.fromDegrees(E[Q][0],E[Q][1],E[Q][2]));x.positions=w,m&&(x.area=this.getArea(I,w,!0),y+=x.area)}}),{tin:C,area:y}};_C.prototype.getArea=function(o,A,f){if(o.length<3)return;o.push(o[0]);let m=o,C=0,y=Zl.polygon([m]),x;m.length===4?x=[y]:x=Zl.tesselate(y).features;let v,E,I,w;return x.forEach(Q=>{v=Q.geometry.coordinates[0],E=m.findIndex(F=>F.toString()===v[0].toString()),I=m.findIndex(F=>F.toString()===v[1].toString()),w=m.findIndex(F=>F.toString()===v[2].toString());let M=this.getdistance(A[E],A[I]),B=this.getdistance(A[I],A[w]),T=this.getdistance(A[E],A[w]),D=(M+B+T)/2;C+=Math.sqrt(D*((D-M)*(D-B)*(D-T)))}),f||(C<1e6?C=`${C.toFixed(2)}\u5E73\u65B9\u7C73`:C=`${(C/1e6).toFixed(2)}\u5E73\u65B9\u5343\u7C73`),C};_C.prototype.getdistance=function(o,A){let f=Kt.fromCartesian(o),m=Kt.fromCartesian(A),C=Di.MOON2000,x=new l0(f,m,C).surfaceDistance;return x=Math.sqrt(Math.pow(x,2)+Math.pow(m.height-f.height,2)),x};var BAt=_C;function Fle(o){this.mEarthCtrl=o,this._polylines=[],this._resPolylines=[],this._points=[],this.entities=this.mEarthCtrl.entities,this.camera=this.mEarthCtrl.coreMap.camera,this.scene=this.mEarthCtrl.coreMap.scene}Fle.prototype.createLineOfSight=function(o){let A=[],f=this,m=[],C=[],y={polyline:[]};f.objectsToExclude=null;let x,v=function(){function M(B){this.options={polyline:{show:!0,positions:[],material:At.YELLOW,width:3,clampToGround:!1}},this.positionsp=B,this._init()}return M.prototype._init=function(){let B=this,T=function(){return B.positionsp};this.options.polyline.positions=new Bn(T,!1),this.polyline=f.entities.add(this.options),f.item=this.polyline,C.push(this.polyline)},M}(),E=new Ur(f.scene.canvas),I=[],w;if(this._points.length>0)for(let M=0;M<this._points.length;M++)this.entities.remove(this._points[M]);let Q=[];return E.setInputAction(function(M){let B,T=new ee(0,0,0);if(new ja(f.mEarthCtrl).pickVector(M.position,T)&&(B=T),!!B)if(I.length===0){I.push(B.clone(),B.clone());let F={leftX:M.position.x,leftY:M.position.y};Q.push(F),x=B.clone()}else{let F={rightX:M.position.x,rightY:M.position.y};Q.push(F);let L={postion:I,entity:C,cartesian:Q};m.push(L),Q=[],w=void 0,I=[],I.push(x.clone()),I.push(x.clone()),w=new v(I),A.push(w)}},Ki.LEFT_CLICK),E.setInputAction(function(M){let B,T=f.camera.getPickRay(M.endPosition);if(B=f.scene.globe.pick(T,f.scene),f.scene.pick(M.endPosition)){let F=f.scene.pickPosition(M.endPosition);F&&(B=F)}!B||I.length>=2&&(O(w)?B!==void 0&&(I.pop(),I.push(B)):(w=new v(I),A.push(w)))},Ki.MOUSE_MOVE),E.setInputAction(function(M){let B=f.entities.add(new UA);f.objectsToExclude=[B];let T=!0;for(let D=0;D<m.length;D++)D===0?T=f.tsjx(m[0].postion[0],m[0].postion[1]):T=f.tsjx(m[D].postion[0],m[D].postion[1]);I.pop(),f._polylines=y.polyline,E.destroy();for(let D=0;D<C.length;D++)f.entities.remove(C[D]);O(o)&&typeof o=="function"&&o(y)},Ki.RIGHT_CLICK),this};Fle.prototype.tsjx=function(o,A){let f=this,m=ee.normalize(ee.subtract(A,o,new ee),new ee),C=new ls(o,m),y=f.scene.globe.pick(C,f.scene);y!=null?(x(y,o,At.GREEN),x(y,A,At.RED)):x(o,A,At.GREEN);function x(v,E,I){let w=f.entities.add({polyline:{positions:[v,E],width:1,material:I,depthFailMaterial:I}});f._resPolylines.push(w)}return!1};Fle.prototype.deleteObject=function(){if(this._points.length>0){this.objectsToExclude=null;for(let o=0;o<this._points.length;o++)this.entities.remove(this._points[o])}if(this._resPolylines.length>0){for(let o=0;o<this._resPolylines.length;o++)this.entities.remove(this._resPolylines[o]);this._resPolylines=[]}};var wAt=Fle;function _h(o,A={}){this._earthCtrl=o,this._viewer=o.coreMap,this._scene=o.coreMap.scene,this.options=Ae(A,{}),this._Tooltip=new pw(o),this._tooltip=this._Tooltip.CreateTooltip(),this._drawColor={point:Ae(this.options.drawColor?.point,At.BLUE),polyline:Ae(this.options.drawColor?.polyline,At.YELLOW),polygon:Ae(this.options.drawColor?.polygon,At.YELLOW.withAlpha(.5))},this.selectDatum=!0,this.onlyTerrain=!0,this.tin=!1,this._volumeTin=[],this.loadingImg=`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`,this.wallArr=[],this.FlattenPolygon=[],this._Apositions=[],this._heightsort=null,this._deepth=100,this._positions=[],this._modelArr=Ae(A.modelArr,[]),this._isFlattening=Ae(A.isFlattening,!0),this.modelCuttingPolygon=null,this.wallImgUrl=Ae(A.wallImgUrl,null),this.bottomImgUrl=Ae(A.bottomImgUrl,null),this.calculate=Ae(A.calculate,!0),this._Loading=Ae(A.loading,!0),this.editPoint=[],this.nowPoint=null,this.hierarchy=[],this._originHeight=null}_h.prototype.removeMeasureFromMap=function(){this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._prevEntity1!==void 0&&(this._viewer.entities.remove(this._prevEntity1),this._prevEntity1=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._volumeTin.forEach(o=>{this._viewer.entities.remove(o)}),this._volumeTin=[],this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=void 0),this.Triangulation=[],this.tinData=void 0,this._tooltip.show(!1)};_h.prototype.removeFromMap=function(){if(this.endEdit(),this.removeMeasureFromMap(),this.wallArr.length>0){for(let o=0;o<this.wallArr.length;o++)this._viewer.entities.remove(this.wallArr[o]);this.wallArr=[]}if(this.FlattenPolygon&&this.FlattenPolygon.length>0){for(let o=0;o<this.FlattenPolygon.length;o++)this._viewer.entities.remove(this.FlattenPolygon[o]);this.FlattenPolygon=[]}this.removeModelCutting()};_h.prototype.deleteObject=_h.prototype.removeFromMap;_h.prototype.startDrawing=function(o={},A){let f=Ae(o.spacing,"auto"),m=this._scene,C=this._tooltip,y=3,x=[],v=[],E=[],I=[],w=[],Q;this._Apositions=o.positions,this._positions=v,this._hierarchy=E,this._heightsort=I,this._degreesArr=w,this._deepth=Ae(o.deepth,100),this._drawColor.point=o.point||this._drawColor.point,this._drawColor.polyline=o.polyline||this._drawColor.polyline,this._drawColor.polygon=o.polygon||this._drawColor.polygon,this.loadingImg=o.loading||this.loadingImg,this.tin=Ae(o.tin,!1),this.onlyTerrain=Ae(o.onlyTerrain,!1),this.selectDatum=Ae(o.selectDatum,!1);let M=this;if(this._mouseHandler&&this._mouseHandler.destroy(),this.loading||this.addLoading(),o.positions){let B=ee.fromDegreesArray(o.positions);for(let T of B)v.push(T);if(!(v.length<y)){for(let T=0;T<o.positions.length;T+=2)w.push([o.positions[T],o.positions[T+1]]);this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:ee.fromDegreesArray(o.positions),material:M._drawColor.polygon,fill:!0}});for(let T=0;T<o.positions.length;T+=2){let D=M._viewer.scene.sampleHeight(new Kt(je.toRadians(o.positions[T]),je.toRadians(o.positions[T+1])));I.push(D),E.push(o.positions[T],o.positions[T+1],D)}this.stopDrawing(f,T=>{A&&A(T)})}}else{let B=new Ur(m.canvas);this._mouseHandler=B,this.removeMeasureFromMap(),this._viewer.container.style.cursor=`url(${globalThis.GEOWORLD_BASE_URL} 'Workers/image/cursor/draw.cur')`;let T;B.setInputAction(function(F){if(F.position!==null){let L=m.camera.getPickRay(F.position),R=m.globe.pick(L,m);if(this._viewer.scene.pick(F.position)){let U=this._viewer.scene.pickPosition(F.position);U&&(R=U)}if(R){let U=Kt.fromCartesian(R),V=je.toDegrees(U.longitude),H=je.toDegrees(U.latitude);if(x.length===0&&(x.push(V,H),w.push([V,H]),v.push(R),Q=R),v.length>=4){let q=Ss.wgs84ToWindowCoordinates(this._viewer.scene,Q);if(q!==void 0){let ie=q.x-F.position.x,Z=q.y-F.position.y;if(ie*ie+Z*Z<16){x.splice(x.length-2,2),v.pop(),this.stopDrawing(A);return}}}x.push(V,H),w.push([V,H]),v.push(R),v.length===2&&!T&&(T=this._viewer.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new Bn(function(){return v},!1),clampToGround:!0,material:M._drawColor.polygon,width:3}})),v.length===y&&(T&&this._viewer.entities.remove(T),this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:new Un(ee.fromDegreesArray(x)),material:M._drawColor.polygon,fill:!0}}),this._prevEntity.polygon.hierarchy=new Bn(()=>new Un(ee.fromDegreesArray(x)),!1))}}}.bind(this),Ki.LEFT_CLICK),B.setInputAction(function(F){let L=F.endPosition;if(L!==null)if(v.length===0)C.showAt(L,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7B2C\u4E00\u4E2A\u70B9");else{let R=m.camera.getPickRay(L),k=m.globe.pick(R,m),U=this._viewer.scene.pick(L),V=!1;if(U){let H=this._viewer.scene.pickPosition(L);H&&(k=H),V=!0}if(k){let H=Kt.fromCartesian(k),q=je.toDegrees(H.longitude),ie=je.toDegrees(H.latitude);if(x.splice(x.length-2,2),w.pop(),v.pop(),x.push(q,ie),w.push([q,ie]),v.push(k),C.showAt(L,"\u53F3\u952E\u7ED3\u675F\u7ED8\u5236"),v.length>=3&&v.length>=4){let Z=Ss.wgs84ToWindowCoordinates(this._viewer.scene,Q);if(Z!==void 0){let oe=Z.x-L.x,ne=Z.y-L.y;oe*oe+ne*ne<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}}.bind(this),Ki.MOUSE_MOVE);let D=null;B.setInputAction(function(F){D=window.setTimeout(()=>{console.log("\u5355\u51FB"),this.end&&this.end()},200)}.bind(this),Ki.RIGHT_CLICK),B.setInputAction(function(F){console.log("\u53CC\u51FB......"),clearTimeout(D)},Ki.LEFT_DOUBLE_CLICK),this.end=F=>{if(this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),M._viewer.container.style.cursor="default",this._tooltip.show(!1),T&&this._viewer.entities.remove(T),this.end=void 0,console.log(w,"?????????"),!(v.length<y)){if(this._prevEntity&&(this._prevEntity.polygon.hierarchy=ee.fromDegreesArray(x)),F==="cancel"){this._prevEntity&&this._viewer.entities.remove(this._prevEntity);return}for(let L=0;L<x.length;L+=2){let R=M._viewer.scene.sampleHeight(new Kt(je.toRadians(x[L]),je.toRadians(x[L+1])));I.push(R),E.push(x[L],x[L+1],R)}this._Apositions=x,this.stopDrawing(f,A)}}}return this};_h.prototype.stopDrawing=function(o,A){let f=this;this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._volumeTin.forEach(m=>{this._viewer.entities.remove(m)}),this._volumeTin=[],this._Loading&&this.isLoading(!0),setTimeout(()=>{f._heightsort.sort(function(T,D){return T-D});let m=this._viewer.entities.add({name:null,id:f._earthCtrl.factory.createUUID(),polygon:{hierarchy:new Bn(function(){return new Un(ee.fromDegreesArrayHeights(f._hierarchy))},!1),material:new z0({image:Ae(f.bottomImgUrl,`${window.SmartEarthRootUrl}Workers/image/bottomplane.jpg`),repeat:new It(1,1)})}});f.FlattenPolygon.push(m),f.originHeight=f._heightsort[0];let C=ee.fromDegreesArrayHeights(f._hierarchy);C.push(C[0]),f._positionsB=C;let y=null,x,v,E,I,w,Q;for(let T=0;T<C.length-1;T++){x=Kt.fromCartesian(C[T]),v=Kt.fromCartesian(C[T+1]),E=je.toDegrees(x.longitude),w=je.toDegrees(x.latitude),I=je.toDegrees(v.longitude),Q=je.toDegrees(v.latitude),y?y=y>v.height?v.height:y:y=x.height>v.height?v.height:x.height;let D=f.getPoint(E,w,I,Q,x.height,v.height),F=[],L=[];f.getHeightsFromLonLat(D.positions,function(R){if(R){F=R;for(let k=0;k<F.length;k++)L.push(f._heightsort[0]-f._deepth);f.drawwall(D.wallJwd,F,L)}})}if(f._baseHeight=f._heightsort[0]-f._deepth,m.polygon.height=f._baseHeight,!this.calculate)return f._isFlattening&&f.modelCutting(),A&&A(!0),this.isLoading(!1);let M=this.computeCutVolume(o,this.onlyTerrain),B=T=>{let D=T.maxHeight,F=T.minHeight;if(this._prevEntity.polygon.height=T.minHeight,this._prevEntity.polygon.heightReference=0,this.selectDatum){let L=()=>{this.addPoint(R=>{this.setDatum(R,k=>{typeof A=="function"&&A({...T,...k}),L()})})};L()}};this.onlyTerrain?M.then(T=>{B(T)}):B(M),f.setDatum(f._baseHeight,T=>{f._isFlattening&&f.modelCutting(),A&&A(T),this._Loading&&this.isLoading(!1)})},100)};_h.prototype.modelCutting=function(){let o=this;if(o._modelCuttingPolygon=rh.fromPositions({positions:ee.fromDegreesArray(o._Apositions),height:o._baseHeight}),o._modelArr.length>0)for(let A of o._modelArr)A.addFlattenPolygon(o._modelCuttingPolygon),A.needUpdateFlatten=!0,A.clipPlaneOfFlatten=!0;else console.info("\u8BF7\u6DFB\u52A0\u6A21\u578B\uFF01")};_h.prototype.removeModelCutting=function(){let o=this;if(o._modelArr.length>0){for(let A of o._modelArr)A.removeFlattenPolygon(o._modelCuttingPolygon);o._modelCuttingPolygon=null,o._modelArr=[]}else console.info("\u8BF7\u6DFB\u52A0\u6A21\u578B\uFF01")};_h.prototype.computeCentroidOfPolygon=function(o){let A=[],f=[],m=0,C=0;for(let v=0;v<o.length;v++){let E=Kt.fromCartesian(o[v]);m+=E.longitude,C+=E.latitude,A.push(E.longitude),f.push(E.latitude)}let y=0,x=0;return y=m/o.length,x=C/o.length,new Kt(y,x)};_h.prototype.edit=function(o,A,f){let m=this,C=m.editPoint,y=m.nowPoint;if(m._earthCtrl.coreMap.scene.globe.depthTestAgainstTerrain=!1,y){for(let E of m.editPoint)E&&(E.show=!0);m.update(y,C,o);return}for(let E=2;E<m._hierarchy.length;E=E+3)m._hierarchy[E]=m.originHeight-m._deepth;m.FlattenPolygon[0]&&m._viewer.entities.remove(m.FlattenPolygon[0]),m.FlattenPolygon=[];let x=this._viewer.entities.add({name:null,id:m._earthCtrl.factory.createUUID(),polygon:{hierarchy:new Un(ee.fromDegreesArrayHeights(m._hierarchy)),material:new z0({image:Ae(m.bottomImgUrl,`${window.SmartEarthRootUrl}Workers/image/bottomplane.jpg`),repeat:new It(1,1)}),perPositionHeight:!0}});m.FlattenPolygon.push(x);let v=m.FlattenPolygon[0].polygon.hierarchy.getValue();for(let E of v.positions){let I=this._viewer.entities.add({id:m._earthCtrl.factory.createUUID(),position:E,point:{color:At.WHITE,pixelSize:12,outlineColor:At.BLACK,outlineWidth:1}});C.push(I)}if(o)if(A){for(let E of C)if(A===E.id){m.nowPoint=E,m.update(E,C,o);return}}else m._earthCtrl.measure.pickObject(null,function(E){let I=E.pickedObject.id;for(let w of C)if(I.id===w.id){m.nowPoint=w,m.update(w,C,o);return}});else f&&f(C)};_h.prototype.update=function(o,A,f){let m=this,C=o.position.getValue(),x=m._scene.globe.ellipsoid.cartesianToCartographic(C),v=je.toDegrees(x.longitude),E=je.toDegrees(x.latitude),I=x.height;o.position.setValue(ee.fromDegrees(v,E,I+f)),m.editPoint=A,m.editPosition=[];let w=[];for(let M of A){let B=M.position.getValue();w.push(B),m.editPosition.push(B)}m.FlattenPolygon[0].polygon.hierarchy=new Bn(function(){return new Un(w)},!0);let Q=m.editPosition;Q.push(Q[0]);for(let M=0;M<Q.length-1;M++){let T=[];for(let D=0;D<=160;D++){let F=ee.lerp(Q[M],Q[M+1],D/160,new ee),L=Kt.fromCartesian(F);T.push(L.height)}m.wallArr[M].wall.minimumHeights.setValue(T)}};_h.prototype.endEdit=function(){let o=this;if(o._earthCtrl.coreMap.scene.globe.depthTestAgainstTerrain=!0,o.editPoint.length>0)for(let A of o.editPoint)A&&(A.show=!1)};_h.prototype.computeCutVolume=function(o,A){let f=this,m=15e3,C=-15e3;o==="auto"&&(o=wi.fromPoints(this._positions).radius/20);let y=this.getPointsInPolygon(this._degreesArr,o,!0),x=Zl.polygon([this._degreesArr]),v=()=>{let{tin:E}=this.tinFromPoints(y,{getArea:!0,polygon:x});this.tinData=E;let I={fill:0,dig:0},w={fill:"\u7ACB\u65B9\u7C73",dig:"\u7ACB\u65B9\u7C73"},Q,M,B,T,D,F={fill:1,dig:1};this.Triangulation=[],E.features.forEach(R=>{if(R.positions){if(this.tin){let U=this._viewer.entities.add({polygon:{hierarchy:new Un(R.positions),material:this._drawColor.polygon,perPositionHeight:!0,outline:!0,outlineColor:At.YELLOW}});this._volumeTin.push(U)}let k=R.geometry.coordinates[0];Q=k[0][2],M=k[1][2],B=k[2][2],D=R.area,this.Triangulation.push({bottomArea:D,height:[Q,M,B]}),T=(Q-m+M-m+B-m)/3,T>0?I.dig=I.dig+D*T*F.dig:I.fill=I.fill-D*T*F.fill,I.dig>1e10&&w.dig==="\u7ACB\u65B9\u7C73"&&(I.dig=I.dig/1e9,w.dig="\u7ACB\u65B9\u5343\u7C73",F.dig=1e-9),I.fill>1e10&&w.fill==="\u7ACB\u65B9\u7C73"&&(I.fill=I.fill/1e9,w.fill="\u7ACB\u65B9\u5343\u7C73",F.fill=1e-9)}});let L=this.computeCentroidOfPolygon(this._positions);return this._volumeLabel=this._viewer.entities.add({position:ee.fromRadians(L.longitude,L.latitude,C),label:{text:`\u6316\u65B9\u4F53\u79EF\uFF1A${I.dig.toFixed(4)}${w.dig}`,pixelOffset:{x:0,y:-30},font:"16px \u5B8B\u4F53",fillColor:At.GOLD,verticalOrigin:bn.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),this._volumeLabel1=this._viewer.entities.add({position:ee.fromRadians(L.longitude,L.latitude,C),label:{text:`\u586B\u65B9\u4F53\u79EF\uFF1A${I.fill.toFixed(4)}${w.fill}`,pixelOffset:{x:0,y:-70},font:"16px \u5B8B\u4F53",fillColor:At.GOLD,verticalOrigin:bn.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),{maxHeight:C,minHeight:m,volume:I,unit:w,spacing:o}};if(A){let E=[];return y.features.forEach(w=>{let Q=w.geometry.coordinates;E.push(Kt.fromDegrees(Q[0],Q[1]))}),EQ(this._viewer.scene.globe.terrainProvider,E).then(w=>(y.features.forEach((Q,M)=>{let B=Q.geometry.coordinates;B[2]=w[M]&&w[M].height?w[M].height:0,C<B[2]&&(C=B[2]),m>B[2]&&(m=B[2])}),v()))}return y.features.forEach(E=>{let I=E.geometry.coordinates,w=new Kt(je.toRadians(I[0]),je.toRadians(I[1]));I[2]=this._viewer.scene.sampleHeight(w)||0,C<I[2]&&(C=I[2]),m>I[2]&&(m=I[2])}),v()};_h.prototype.getPoint=function(o,A,f,m,C,y){let x=this,v=160,E=je.lerp(o,f,1/v)-o,I=je.lerp(A,m,1/v)-A,w=[],Q=[],M=[],B;w.push(o,A),B=ee.fromDegrees(o,A),Q.push(Kt.fromCartesian(B));for(let T=0;T<v;T++){let D=o+(T+1)*E,F=A+(T+1)*I;w.push(D,F),B=ee.fromDegrees(D,F),Q.push(Kt.fromCartesian(B))}return w.push(f,m),B=ee.fromDegrees(f,m),Q.push(Kt.fromCartesian(B)),{wallJwd:w,positions:Q}};_h.prototype.getHeightsFromLonLat=function(o,A){let f=this._viewer,m=[];o.forEach(function(C){m.push(f.scene.sampleHeight(new Kt(C.longitude,C.latitude)))}),typeof A=="function"&&A(m)};_h.prototype.isHaveTerrain=function(){return!!(this._viewer.scene&&this._viewer.scene.terrainProvider&&this._viewer.scene.terrainProvider._layers)};_h.prototype.drawwall=function(o,A,f){let m=this,C=m._viewer.entities.add({wall:{positions:new Bn(function(){return ee.fromDegreesArray(o)},!1),maximumHeights:A,minimumHeights:f}}),y=C.wall;y.material=new z0({image:Ae(m.wallImgUrl,`${window.SmartEarthRootUrl}Workers/image/dzmc.jpg`),repeat:new It(1,1)}),m.wallArr.push(C)};_h.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=this.loadingImg,o.appendChild(A),this.loading=o,this._viewer.container.appendChild(o)};_h.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};_h.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};_h.prototype.addPoint=function(o){this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=null),this._prevEntity1&&(this.addPointHandle=new Ur(this._viewer.scene.canvas),this.addPointHandle.setInputAction(function(A){let f=this._viewer.scene.pick(A.position);if(f&&f.id&&f.id.id===this._prevEntity1.id){let m=this._viewer.scene.pickPosition(A.position);if(m){let C=Kt.fromCartesian(m);this.addPointHandle.destroy(),this.addPointHandle=null,o&&typeof o=="function"&&o(C.height.toFixed(1))}}}.bind(this),Ki.LEFT_CLICK),this.addPointHandle.setInputAction(function(A){let f=this._viewer.scene.pick(A.endPosition);f&&f.id&&f.id.id===this._prevEntity1.id?this._tooltip.showAt(A.endPosition,"\u70B9\u51FB\u4FEE\u6539\u57FA\u51C6\u9762\u9AD8\u5EA6"):this._tooltip.show(!1)}.bind(this),Ki.MOUSE_MOVE))};_h.prototype.showTin=function(o){this.tin=o,this._volumeTin.forEach(A=>{this._viewer.entities.remove(A)}),this._volumeTin=[],o&&this.tinData&&this.tinData.features.forEach(A=>{if(A.positions){let f=this._viewer.entities.add({polygon:{hierarchy:new Un(A.positions),material:this._drawColor.polygon,perPositionHeight:!0,outline:!0,outlineColor:At.YELLOW}});this._volumeTin.push(f)}})};_h.prototype.setDatum=function(o,A){if(this.Triangulation&&this.Triangulation.length>0){let f,m,C,y={fill:0,dig:0},x={fill:"\u7ACB\u65B9\u7C73",dig:"\u7ACB\u65B9\u7C73"},v={fill:1,dig:1};this.Triangulation.forEach(function(E){f=E.bottomArea,m=E.height,C=(m[0]-o+m[1]-o+m[2]-o)/3,C>0?y.dig=y.dig+f*C*v.dig:y.fill=y.fill-f*C*v.fill,y.dig>1e10&&x.dig==="\u7ACB\u65B9\u7C73"&&(y.dig=y.dig/1e9,x.dig="\u7ACB\u65B9\u5343\u7C73",v.dig=1e-9),y.fill>1e10&&x.fill==="\u7ACB\u65B9\u7C73"&&(y.fill=y.fill/1e9,x.fill="\u7ACB\u65B9\u5343\u7C73",v.fill=1e-9)}),this._volumeLabel.label.text=`\u6316\u65B9\u4F53\u79EF\uFF1A${y.dig.toFixed(4)}${x.dig}`,this._volumeLabel1.label.text=`\u586B\u65B9\u4F53\u79EF\uFF1A${y.fill.toFixed(4)}${x.fill}`,this._prevEntity.polygon.height=o,A&&typeof A=="function"&&A({volume:y,unit:x})}};_h.prototype.getPointsInPolygon=function(o,A=50,f=!0){if(o.length<3)return;o.push(o[0]);let m=Zl.lineString(o),C=Zl.bbox(m),y=Zl.pointGrid(C,A,{units:"meters"}),x=Zl.polygon([o]),v=Zl.pointsWithinPolygon(y,x);if(f)for(let E=0;E<o.length-1;E++){let I=Zl.lineString([o[E],o[E+1]]),w={units:"meters"},Q=Zl.length(I,w),M;for(let B=A;;B+=A)if(B<=Q)M=Zl.along(I,B,w),v.features.push(M);else{M=Zl.along(I,Q,w),v.features.push(M);break}}return v};_h.prototype.tinFromPoints=function(o,A={}){let{polygon:f,getArea:m}=A,C=Zl.tin(o),y=0;return C&&C.features&&C.features.forEach(x=>{let v=!0;if(f){let E=Zl.centerOfMass(x);v=Zl.booleanPointInPolygon(E,f)}if(v){let E=x.geometry.coordinates[0],I=[],w=[];for(let Q=0;Q<3;Q++)I.push([E[Q][0],E[Q][1]]),w.push(ee.fromDegrees(E[Q][0],E[Q][1],E[Q][2]));x.positions=w,m&&(x.area=this.getArea(I,w,!0),y+=x.area)}}),{tin:C,area:y}};_h.prototype.getArea=function(o,A,f){if(o.length<3)return;o.push(o[0]);let m=o,C=0,y=Zl.polygon([m]),x;m.length===4?x=[y]:x=Zl.tesselate(y).features;let v,E,I,w;return x.forEach(Q=>{v=Q.geometry.coordinates[0],E=m.findIndex(F=>F.toString()===v[0].toString()),I=m.findIndex(F=>F.toString()===v[1].toString()),w=m.findIndex(F=>F.toString()===v[2].toString());let M=this.getdistance(A[E],A[I]),B=this.getdistance(A[I],A[w]),T=this.getdistance(A[E],A[w]),D=(M+B+T)/2;C+=Math.sqrt(D*((D-M)*(D-B)*(D-T)))}),f||(C<1e6?C=`${C.toFixed(2)}\u5E73\u65B9\u7C73`:C=`${(C/1e6).toFixed(2)}\u5E73\u65B9\u5343\u7C73`),C};_h.prototype.getdistance=function(o,A){let f=Kt.fromCartesian(o),m=Kt.fromCartesian(A),C=new l0;C.setEndPoints(f,m);let y=C.surfaceDistance;return y=Math.sqrt(Math.pow(y,2)+Math.pow(m.height-f.height,2)),y};var bAt=_h;function M2(o,A={}){this._earthCtrl=o,this._viewer=o.coreMap,this._scene=o.coreMap.scene,this.options=Ae(A,{}),this._modelArr=[],this._Apositions=[],this.FlattenPolygon=[],this._Loading=Ae(A.loading,!1),this._bottom=Ae(A.bottom,!1),this.loadingImg=Ae(A.loadingImg,`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`),this._Tooltip=new pw(o),this._tooltip=this._Tooltip.CreateTooltip(),this._positions=[],this._deepth=100,this._drawColor={point:Ae(this.options.drawColor?.point,At.BLUE),polyline:Ae(this.options.drawColor?.polyline,At.YELLOW),polygon:Ae(this.options.drawColor?.polygon,At.YELLOW.withAlpha(.5))}}M2.prototype.removeMeasureFromMap=function(){this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=void 0),this.Triangulation=[],this.tinData=void 0,this._tooltip.show(!1)};M2.prototype.startDrawing=function(o={},A){let f=this._scene,m=this._tooltip,C=3,y,x=[],v=[],E=[],I=[],w=[];this._positions=v,this._hierarchy=E,this._heightsort=I,this._degreesArr=w,this._deepth=Ae(o.deepth,100),this._modelArr=Ae(o.modelArr,[]);let Q=this;if(this._mouseHandler&&this._mouseHandler.destroy(),this.loading||this.addLoading(),o.positions){let M=ee.fromDegreesArray(o.positions);for(let B of M)v.push(B);if(!(v.length<C)){for(let B=0;B<o.positions.length;B+=2)w.push([o.positions[B],o.positions[B+1]]);console.log(v,"\u4F4D\u7F6E\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A"),this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:ee.fromDegreesArray(o.positions),material:Q._drawColor.polygon,fill:!0}});for(let B=0;B<o.positions.length;B+=2){let T=Q._viewer.scene.sampleHeight(new Kt(je.toRadians(o.positions[B]),je.toRadians(o.positions[B+1])));I.push(T),E.push(o.positions[B],o.positions[B+1],T)}this._Apositions=o.positions,this.stopDrawing(B=>{A&&A(B)})}}else{let M=new Ur(f.canvas);this._mouseHandler=M,this.removeMeasureFromMap(),this._viewer.container.style.cursor=`url(${globalThis.GEOWORLD_BASE_URL} 'Workers/image/cursor/draw.cur')`;let B;M.setInputAction(function(T){if(T.position!==null){let D=f.camera.getPickRay(T.position),F=f.globe.pick(D,f);if(this._viewer.scene.pick(T.position)){let R=this._viewer.scene.pickPosition(T.position);R&&(F=R)}if(F){let R=Kt.fromCartesian(F),k=je.toDegrees(R.longitude),U=je.toDegrees(R.latitude);if(x.length===0&&(x.push(k,U),w.push([k,U]),v.push(F),y=F),v.length>=4){let V=Ss.wgs84ToWindowCoordinates(this._viewer.scene,y);if(V!==void 0){let H=V.x-T.position.x,q=V.y-T.position.y;if(H*H+q*q<16){x.splice(x.length-2,2),v.pop(),this.stopDrawing(A);return}}}x.push(k,U),w.push([k,U]),v.push(F),v.length===2&&!B&&(B=this._viewer.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new Bn(function(){return v},!1),clampToGround:!0,material:Q._drawColor.polygon,width:3}})),v.length===C&&(B&&this._viewer.entities.remove(B),this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:new Un(ee.fromDegreesArray(x)),material:Q._drawColor.polygon,fill:!0}}),this._prevEntity.polygon.hierarchy=new Bn(()=>new Un(ee.fromDegreesArray(x)),!1))}}}.bind(this),Ki.LEFT_CLICK),M.setInputAction(function(T){let D=T.endPosition;if(D!==null)if(v.length===0)m.showAt(D,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7B2C\u4E00\u4E2A\u70B9");else{let F=f.camera.getPickRay(D),L=f.globe.pick(F,f),R=this._viewer.scene.pick(D),k=!1;if(R){let U=this._viewer.scene.pickPosition(D);U&&(L=U),k=!0}if(L){let U=Kt.fromCartesian(L),V=je.toDegrees(U.longitude),H=je.toDegrees(U.latitude);if(x.splice(x.length-2,2),w.pop(),v.pop(),x.push(V,H),w.push([V,H]),v.push(L),m.showAt(D,"\u53F3\u952E\u7ED3\u675F\u7ED8\u5236"),v.length>=3&&v.length>=4){let q=Ss.wgs84ToWindowCoordinates(this._viewer.scene,y);if(q!==void 0){let ie=q.x-D.x,Z=q.y-D.y;ie*ie+Z*Z<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}}.bind(this),Ki.MOUSE_MOVE),M.setInputAction(function(T){this.end&&this.end()}.bind(this),Ki.RIGHT_CLICK),this.end=T=>{if(this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),Q._viewer.container.style.cursor="default",this._tooltip.show(!1),B&&this._viewer.entities.remove(B),this.end=void 0,console.log(w,"?????????"),!(v.length<C)){if(this._prevEntity&&(this._prevEntity.polygon.hierarchy=ee.fromDegreesArray(x)),T==="cancel"){this._prevEntity&&this._viewer.entities.remove(this._prevEntity);return}for(let D=0;D<x.length;D+=2){let F=Q._viewer.scene.sampleHeight(new Kt(je.toRadians(x[D]),je.toRadians(x[D+1])));I.push(F),E.push(x[D],x[D+1],F)}this._Apositions=x,this.stopDrawing(A)}}}};M2.prototype.stopDrawing=function(o){let A=this;this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._Loading&&this.isLoading(!0),setTimeout(()=>{A._heightsort.sort(function(m,C){return m-C});let f=null;A._bottom?(f=this._viewer.entities.add({name:null,id:A._earthCtrl.factory.createUUID(),polygon:{hierarchy:new Bn(function(){return new Un(ee.fromDegreesArrayHeights(A._hierarchy))},!1),material:new z0({image:Ae(A.bottomImgUrl,`${window.SmartEarthRootUrl}Workers/image/bottomplane.jpg`),repeat:new It(1,1)})}}),A._baseHeight=A._heightsort[0]-A._deepth,f.polygon.height=A._baseHeight):f=this._viewer.entities.add({name:null,id:A._earthCtrl.factory.createUUID(),polygon:{hierarchy:new Bn(function(){return new Un(ee.fromDegreesArrayHeights(A._hierarchy))},!1),material:At.YELLOW.withAlpha(0)}}),A.FlattenPolygon.push(f),A.modelCutting()})};M2.prototype.modelCutting=function(){let o=this;if(o._modelCuttingPolygon=rh.fromPositions({positions:ee.fromDegreesArray(o._Apositions),height:o._baseHeight}),o._modelArr.length>0)for(let A of o._modelArr)A.addFlattenPolygon(o._modelCuttingPolygon),A.needUpdateFlatten=!0,A.clipPlaneOfFlatten=!0;else console.info("\u8BF7\u6DFB\u52A0\u6A21\u578B\uFF01")};M2.prototype.removeModelCutting=function(){let o=this;if(o._modelArr.length>0){for(let A of o._modelArr)A.removeFlattenPolygon(o._modelCuttingPolygon);o._modelCuttingPolygon=null,o._modelArr=[]}};M2.prototype.removeFromMap=function(){if(this.removeMeasureFromMap(),this.FlattenPolygon&&this.FlattenPolygon.length>0){for(let o=0;o<this.FlattenPolygon.length;o++)this._viewer.entities.remove(this.FlattenPolygon[o]);this.FlattenPolygon=[]}this.removeModelCutting()};M2.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=this.loadingImg,o.appendChild(A),this.loading=o,this._viewer.container.appendChild(o)};M2.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};M2.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};var QAt=M2;function P2(o,A={}){this._earthCtrl=o,this._viewer=o.coreMap,this._scene=o.coreMap.scene,this.options=Ae(A,{}),this._Apositions=[],this.FlattenPolygon=[],this._terrainFlatten=new _N(o.coreMap.scene),this._Loading=Ae(A.loading,!1),this._bottom=Ae(A.bottom,!1),this.loadingImg=Ae(A.loadingImg,`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`),this._Tooltip=new pw(o),this._tooltip=this._Tooltip.CreateTooltip(),this._positions=[],this._deepth=10,this._drawColor={point:Ae(this.options.drawColor?.point,At.BLUE),polyline:Ae(this.options.drawColor?.polyline,At.YELLOW),polygon:Ae(this.options.drawColor?.polygon,At.YELLOW.withAlpha(.5))}}P2.prototype.removeMeasureFromMap=function(){this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=void 0),this.Triangulation=[],this.tinData=void 0,this._tooltip.show(!1)};P2.prototype.startDrawing=function(o={},A){let f=this._scene,m=this._tooltip,C=3,y,x=[],v=[],E=[],I=[],w=[];this._positions=v,this._hierarchy=E,this._heightsort=I,this._degreesArr=w,this._deepth=Ae(o.deepth,100);let Q=this;if(this._mouseHandler&&this._mouseHandler.destroy(),this.loading||this.addLoading(),o.positions){let M=ee.fromDegreesArray(o.positions);for(let B of M)v.push(B);if(!(v.length<C)){for(let B=0;B<o.positions.length;B+=2)w.push([o.positions[B],o.positions[B+1]]);this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:ee.fromDegreesArray(o.positions),material:Q._drawColor.polygon,fill:!0}});for(let B=0;B<o.positions.length;B+=2){let T=Q._viewer.scene.sampleHeight(new Kt(je.toRadians(o.positions[B]),je.toRadians(o.positions[B+1])));I.push(T),E.push(o.positions[B],o.positions[B+1],T)}this._Apositions=o.positions,this.stopDrawing(B=>{A&&A(B)})}}else{let M=new Ur(f.canvas);this._mouseHandler=M,this.removeMeasureFromMap(),this._viewer.container.style.cursor=`url(${globalThis.GEOWORLD_BASE_URL} 'Workers/image/cursor/draw.cur')`;let B;M.setInputAction(function(T){if(T.position!==null){let D=f.camera.getPickRay(T.position),F=f.globe.pick(D,f);if(this._viewer.scene.pick(T.position)){let R=this._viewer.scene.pickPosition(T.position);R&&(F=R)}if(F){let R=Kt.fromCartesian(F),k=je.toDegrees(R.longitude),U=je.toDegrees(R.latitude);if(x.length===0&&(x.push(k,U),w.push([k,U]),v.push(F),y=F),v.length>=4){let V=Ss.wgs84ToWindowCoordinates(this._viewer.scene,y);if(V!==void 0){let H=V.x-T.position.x,q=V.y-T.position.y;if(H*H+q*q<16){x.splice(x.length-2,2),v.pop(),this.stopDrawing(A);return}}}x.push(k,U),w.push([k,U]),v.push(F),v.length===2&&!B&&(B=this._viewer.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new Bn(function(){return v},!1),clampToGround:!0,material:Q._drawColor.polygon,width:3}})),v.length===C&&(B&&this._viewer.entities.remove(B),this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:new Un(ee.fromDegreesArray(x)),material:Q._drawColor.polygon,fill:!0}}),this._prevEntity.polygon.hierarchy=new Bn(()=>new Un(ee.fromDegreesArray(x)),!1))}}}.bind(this),Ki.LEFT_CLICK),M.setInputAction(function(T){let D=T.endPosition;if(D!==null)if(v.length===0)m.showAt(D,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7B2C\u4E00\u4E2A\u70B9");else{let F=f.camera.getPickRay(D),L=f.globe.pick(F,f),R=this._viewer.scene.pick(D),k=!1;if(R){let U=this._viewer.scene.pickPosition(D);U&&(L=U),k=!0}if(L){let U=Kt.fromCartesian(L),V=je.toDegrees(U.longitude),H=je.toDegrees(U.latitude);if(x.splice(x.length-2,2),w.pop(),v.pop(),x.push(V,H),w.push([V,H]),v.push(L),m.showAt(D,"\u53F3\u952E\u7ED3\u675F\u7ED8\u5236"),v.length>=3&&v.length>=4){let q=Ss.wgs84ToWindowCoordinates(this._viewer.scene,y);if(q!==void 0){let ie=q.x-D.x,Z=q.y-D.y;ie*ie+Z*Z<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}}.bind(this),Ki.MOUSE_MOVE),M.setInputAction(function(T){this.end&&this.end()}.bind(this),Ki.RIGHT_CLICK),this.end=T=>{if(this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),Q._viewer.container.style.cursor="default",this._tooltip.show(!1),B&&this._viewer.entities.remove(B),this.end=void 0,console.log(w,"?????????"),!(v.length<C)){if(this._prevEntity&&(this._prevEntity.polygon.hierarchy=ee.fromDegreesArray(x)),T==="cancel"){this._prevEntity&&this._viewer.entities.remove(this._prevEntity);return}for(let D=0;D<x.length;D+=2){let F=Q._viewer.scene.sampleHeight(new Kt(je.toRadians(x[D]),je.toRadians(x[D+1])));I.push(F),E.push(x[D],x[D+1],F)}this._Apositions=x,this.stopDrawing(A)}}}};P2.prototype.stopDrawing=function(o){let A=this;this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._Loading&&this.isLoading(!0),setTimeout(()=>{A._heightsort.sort(function(C,y){return C-y});let f=null;A._bottom?(f=this._viewer.entities.add({name:null,id:A._earthCtrl.factory.createUUID(),polygon:{hierarchy:new Bn(function(){return new Un(ee.fromDegreesArrayHeights(A._hierarchy))},!1),material:new z0({image:Ae(A.bottomImgUrl,`${window.SmartEarthRootUrl}Workers/image/bottomplane.jpg`),repeat:new It(1,1)})}}),A._baseHeight=A._heightsort[0]-A._deepth,f.polygon.height=A._baseHeight):f=this._viewer.entities.add({name:null,id:A._earthCtrl.factory.createUUID(),polygon:{hierarchy:new Bn(function(){return new Un(ee.fromDegreesArrayHeights(A._hierarchy))},!1),material:At.YELLOW.withAlpha(0)}}),A.FlattenPolygon.push(f);let m=[];A._baseHeight=A._heightsort[0]-A._deepth;for(let C=0;C<A._hierarchy.length;C+=3)m.push(A._hierarchy[C],A._hierarchy[C+1],A._baseHeight);console.log(m,"\u4F4D\u7F6E\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A"),A.terrainCutting(m)})};P2.prototype.terrainCutting=function(o){let A=this;A._terrainFlatten.addPolygon(o),A._terrainFlatten.update(),A._terrainFlatten.clipPlaneOfFlatten=!0};P2.prototype.removeTerrainCutting=function(){this._terrainFlatten.clearPolygon()};P2.prototype.removeFromMap=function(){if(this.removeMeasureFromMap(),this.FlattenPolygon&&this.FlattenPolygon.length>0){for(let o=0;o<this.FlattenPolygon.length;o++)this._viewer.entities.remove(this.FlattenPolygon[o]);this.FlattenPolygon=[]}this.removeTerrainCutting()};P2.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=this.loadingImg,o.appendChild(A),this.loading=o,this._viewer.container.appendChild(o)};P2.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};P2.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};var SAt=P2;function mw(o,A={}){this._earthCtrl=o,this._terrainFlatten=new _N(this._earthCtrl.coreMap.scene),this._viewer=o.coreMap,this._scene=o.coreMap.scene,this.options=Ae(A,{}),this._Tooltip=new pw(o),this._tooltip=this._Tooltip.CreateTooltip(),this._drawColor={point:Ae(this.options.drawColor?.point,At.BLUE),polyline:Ae(this.options.drawColor?.polyline,At.YELLOW),polygon:Ae(this.options.drawColor?.polygon,At.YELLOW.withAlpha(.5))},this.loadingImg=`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`,this.wallArr=[],this.FlattenPolygon=[],this._Apositions=[],this._heightsort=null,this._deepth=100,this._positions=[],this._modelArr=Ae(A.modelArr,[]),this._isFlattening=Ae(A.isFlattening,!0),this.modelCuttingPolygon=null,this.wallImgUrl=Ae(A.wallImgUrl,null),this.bottomImgUrl=Ae(A.bottomImgUrl,null),this._Loading=Ae(A.loading,!0)}mw.prototype.removeMeasureFromMap=function(){this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=void 0),this.Triangulation=[],this.tinData=void 0,this._tooltip.show(!1)};mw.prototype.removeFromMap=function(){if(this.removeMeasureFromMap(),this.wallArr.length>0){for(let o=0;o<this.wallArr.length;o++)this._viewer.entities.remove(this.wallArr[o]);this.wallArr=[]}if(this.FlattenPolygon&&this.FlattenPolygon.length>0){for(let o=0;o<this.FlattenPolygon.length;o++)this._viewer.entities.remove(this.FlattenPolygon[o]);this.FlattenPolygon=[]}this.removeModelCutting()};mw.prototype.deleteObject=mw.prototype.removeFromMap;mw.prototype.startDrawing=function(o={},A){let f=Ae(o.spacing,"auto"),m=this._scene,C=this._tooltip,y=3,x=this._positions,v=[],E;this._Apositions=o.positions,this._heightsort=v,this._deepth=Ae(o.deepth,100),this._sampleStep=Ae(o.sampleStep,100),this._maxSampleCount=Ae(o.maxSampleCount,200),this._drawColor.point=o.point||this._drawColor.point,this._drawColor.polyline=o.polyline||this._drawColor.polyline,this._drawColor.polygon=o.polygon||this._drawColor.polygon,this.loadingImg=o.loading||this.loadingImg;let I=this;if(this._mouseHandler&&this._mouseHandler.destroy(),this.loading||this.addLoading(),!o.positions){let w=new Ur(m.canvas);this._mouseHandler=w,this.removeMeasureFromMap(),this._viewer.container.style.cursor=`url(${globalThis.GEOWORLD_BASE_URL} 'Assets/image/cursor/draw.cur')`;let Q;w.setInputAction(function(B){if(B.position!==null){let T=this._viewer.scene.pickPosition(B.position);if(T){let D=Kt.fromCartesian(T);if(x.length===0&&(x.push(D),E=T),x.length>=4){let F=Ss.wgs84ToWindowCoordinates(this._viewer.scene,E);if(F!==void 0){let L=F.x-B.position.x,R=F.y-B.position.y;if(L*L+R*R<16){x.splice(x.length-2,2),this.stopDrawing(A);return}}}x.push(D),x.length===2&&!Q&&(Q=this._viewer.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new Bn(function(){let F=[];for(let L=0;L<x.length;L++){let R=x[L];F.push(R.longitude,R.latitude,R.height)}return ee.fromRadiansArrayHeights(F)},!1),clampToGround:!1,material:I._drawColor.polygon,width:3}})),x.length===y&&(Q&&this._viewer.entities.remove(Q),this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:new Bn(()=>{let F=[];for(let L=0;L<x.length;L++){let R=x[L];F.push(R.longitude,R.latitude,R.height)}return new Un(ee.fromRadiansArrayHeights(F))},!1),material:I._drawColor.polygon,fill:!0}}))}}}.bind(this),Ki.LEFT_CLICK),w.setInputAction(function(B){let T=B.endPosition;if(T!==null)if(x.length===0)C.showAt(T,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7B2C\u4E00\u4E2A\u70B9");else{let D=this._viewer.scene.pickPosition(T);if(D){let F=Kt.fromCartesian(D);if(x.splice(x.length-1,1),x.push(F),C.showAt(T,"\u53F3\u952E\u7ED3\u675F\u7ED8\u5236"),x.length>=3&&x.length>=4){let L=Ss.wgs84ToWindowCoordinates(this._viewer.scene,E);if(L!==void 0){let R=L.x-T.x,k=L.y-T.y;R*R+k*k<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}}.bind(this),Ki.MOUSE_MOVE);let M=null;w.setInputAction(function(B){M=window.setTimeout(()=>{console.log("\u5355\u51FB"),this.end&&this.end()},200)}.bind(this),Ki.RIGHT_CLICK),w.setInputAction(function(B){console.log("\u53CC\u51FB......"),clearTimeout(M)},Ki.LEFT_DOUBLE_CLICK),this.end=B=>{if(this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),I._viewer.container.style.cursor="default",this._tooltip.show(!1),Q&&this._viewer.entities.remove(Q),this.end=void 0,!(x.length<y)){if(this._prevEntity&&this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0,B==="cancel")return;for(let T=0;T<x.length;T+=2){let D=x[T].height;v.push(D)}this._Apositions=x,this.stopDrawing(f,A)}}}return this};function MLi(o,A,f){let m=je.lerp(o.longitude,A.longitude,1/f)-o.longitude,C=je.lerp(o.latitude,A.latitude,1/f)-o.latitude,y=[];y.push(o);for(let x=0;x<f;x++){let v=o.longitude+(x+1)*m,E=o.latitude+(x+1)*C;y.push(new Kt(v,E))}return y.push(A),y}function PLi(o,A,f,m,C){let y=[];A.forEach(function(x){let v=Kt.toCartesian(new Kt(x.longitude,x.latitude,m)),E=Kt.toCartesian(new Kt(x.longitude,x.latitude,f)),I=ee.normalize(ee.subtract(E,v,new ee),new ee),w=new ls(v,I),Q=null,M=[],B=o.scene.drillPickFromRay(w,1,M);o.scene.globe.show=!1,B.length>0&&!B[0].object&&B[0].position?(Q=o.scene.drillPickFromRay(w,100,M),Q.unshift(B[0])):Q=o.scene.drillPickFromRay(w,100,M),o.scene.globe.show=!0,y.push(Q)}),typeof C=="function"&&C(y)}function RLi(o,A,f){for(let y=0;y<o.length;y++){let x=o[y];for(let v=0;v<x.length;v++){let E=x[v].position,I=Kt.fromCartesian(E);if(I.height<A){x.splice(v,x.length-v);let w=ee.fromRadians(I.latitude,I.longitude,A);x.push({object:null,position:w});break}}{let v=x[x.length-1].position,E=Kt.fromCartesian(v);if(Math.abs(E.height-A)>.01){let I=ee.fromRadians(E.latitude,E.longitude,A);x.push({object:null,position:I})}}{let v=x[x.length-1].position,E=Kt.fromCartesian(v);console.log("di",E.height)}}for(let y=0;y<o.length;y++){let x=o[y],v=x[x.length-1];f.push(v.position)}let m=0;o.forEach(function(y){m=m<y.length?y.length:m}),o.forEach(function(y){if(m-y.length>0){let v=y.length;y.length=m,y.fill(null,v,y.length)}});let C=[];for(let y=0;y<m-1;y++){let x=[],v=[];for(let E=0;E<o.length;E++){let I=o[E][y],w=o[E][y+1];I&&w&&(x.push(I),v.push(w))}C.push({ups:x,bottoms:v})}return C}mw.prototype.stopDrawing=function(o,A){let f=this;this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._Loading&&this.isLoading(!0);let m=this._positions,C=this._viewer,y=this.wallArr,x=this._deepth,v=this._sampleStep,E=this._maxSampleCount;m.push(m[0]);let I=0;for(let w=0;w<m.length-1;w++){let Q=ee.fromRadians(m[w].longitude,m[w].latitude,m[w].height),M=ee.fromRadians(m[w+1].longitude,m[w+1].latitude,m[w+1].height),T=ee.distance(M,Q)/v;I=I<T?T:I}I=E<I?E:I,I=260,setTimeout(()=>{f._heightsort.sort(function(D,F){return D-F});let w=f._heightsort[0]+2e3,Q=f._heightsort[0]-2e3,M=[];for(let D=0;D<m.length-1;D++){let F=m[D],L=m[D+1],R=MLi(F,L,I);PLi(C,R,Q,w,function(k){let U=RLi(k,x,M);for(let V=0;V<U.length;V++){let H=U[V];y.push(LLi(C,H,V))}})}let B=[];for(let D=0;D<m.length;D++){let F=m[D];B.push(F.longitude,F.latitude,x)}let T=C.entities.add({polygon:{hierarchy:{positions:ee.fromRadiansArrayHeights(B)},perPositionHeight:!0,granularity:je.RADIANS_PER_DEGREE*100,material:new z0({image:`${globalThis.GEOWORLD_BASE_URL}Workers/image/bottomplane.jpg`,repeat:new It(1,1)}),fill:!0}});return y.push(T),f._isFlattening&&f.modelCutting(),A&&A(!0),this.isLoading(!1)},20)};mw.prototype.modelCutting=function(){let o=this,A=this._deepth,f=this._positions,m=[],C=[];for(let y=0;y<f.length;y++){let x=f[y];m.push(x.longitude,x.latitude,x.height-10),C.push(je.toDegrees(x.longitude),je.toDegrees(x.latitude),x.height-10)}if(o._modelCuttingPolygon=rh.fromPositions({positions:ee.fromRadiansArrayHeights(m),height:A-10}),o._terrainFlatten.addPolygon(C),o._terrainFlatten.update(),o._terrainFlatten.clipPlaneOfFlatten=!0,o._modelArr.length>0)for(let y of o._modelArr)y.addFlattenPolygon(o._modelCuttingPolygon),y.needUpdateFlatten=!0,y.clipPlaneOfFlatten=!0;else console.info("\u8BF7\u6DFB\u52A0\u6A21\u578B\uFF01")};mw.prototype.removeModelCutting=function(){let o=this;if(o._modelArr.length>0){for(let A of o._modelArr)A.removeFlattenPolygon(o._modelCuttingPolygon);o._modelCuttingPolygon=null,o._modelArr=[],o._terrainFlatten.clearPolygon(),o._terrainFlatten.clipPlaneOfFlatten=!1}else console.info("\u8BF7\u6DFB\u52A0\u6A21\u578B\uFF01")};function LLi(o,A,f){let m=[],C=[];for(let I=0;I<A.ups.length;I++){let w=A.ups[I];m.push(w.position);let Q=Kt.fromCartesian(w.position);C.push(Q.height)}let y=[];for(let I=0;I<A.bottoms.length;I++){let w=A.bottoms[I],Q=Kt.fromCartesian(w.position);y.push(Q.height)}let x=`${globalThis.GEOWORLD_BASE_URL}Workers/image/MTY0001.jpg`,v=`${globalThis.GEOWORLD_BASE_URL}Workers/image/MTY0002.jpg`,E=o.entities.add({wall:{positions:m,material:new z0({image:f%2?x:v,repeat:new It(.01,.01)}),maximumHeights:C,minimumHeights:y,granularity:je.RADIANS_PER_DEGREE*100}});return E.show=!0,E}mw.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=this.loadingImg,o.appendChild(A),this.loading=o,this._viewer.container.appendChild(o)};mw.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};mw.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};var DAt=mw;function id(o){this._earthCtrl=o,this._coreMap=o.coreMap,this.tools=[],this.vols=[],this.saveResult=!1}id.prototype.getDistanceSpace=function(o){this.saveResult===!1&&this.deleteObject(),this._tool=new kW(this._earthCtrl),this._tool.spaceDistance(o),this.tools.push(this._tool)};id.prototype.getDistanceHorizontal=function(o){this.saveResult===!1&&this.deleteObject(),this._tool=new kW(this._earthCtrl),this._tool.horizontalDistance(o),this.tools.push(this._tool)};id.prototype.deleteObject=function(){O(this._tool)&&this._tool.deleteObject(),this.saveResult===!1&&this.tools.pop()};id.prototype.deleteAll=function(){this.tools.forEach(function(o){o.deleteObject()}),this.vols.forEach(function(o){o.cleanUp()}),this._earthCtrl.measure.tools.forEach(function(o){o.clearResult()}),this.tools=[],this.vols=[],this._earthCtrl.measure.tools=[]};id.prototype.saveResults=function(o){this.saveResult=o};id.prototype.getPlaneArea=function(o){this.saveResult===!1&&this.deleteObject(),this._tool=new kW(this._earthCtrl),this._tool.getPlaneArea(o),this.tools.push(this._tool)};id.prototype.getSurfaceArea3d=function(o){this.saveResult===!1&&this.deleteObject(),this._tool=new kW(this._earthCtrl),this._tool.getSurfaceArea3d(o),this.tools.push(this._tool)};id.prototype.volumetric=function(o){this.saveResult===!1&&this.removeVolumetric(),this._vol=new _le(this._earthCtrl),this._vol.startDrawing(o),this.vols.push(this._vol)};id.prototype.removeVolumetric=function(o){O(this._vol)&&this.vols.forEach(function(A){A.cleanUp()})};id.prototype.lineOfSight=function(o){this._tool=new wAt(this._earthCtrl),this._tool.createLineOfSight(o),this.tools.push(this._tool)};id.prototype.createViewShed=function(o){return new Ile(this._earthCtrl,o)};id.prototype.createSubmergence=function(o){return new Ble(this._earthCtrl,o)};id.prototype.createProfile=function(o){return new wle(this._earthCtrl,o)};id.prototype.createBufferAnalysis=function(o){return new Jre(this._earthCtrl,o)};id.prototype.createSkyline=function(o){return new Qle(this._earthCtrl,o)};id.prototype.createCurtainContrast=function(o){return new vAt(this._earthCtrl,o)};id.prototype.createRestrictTheHeight=function(o){return new Dle(this._earthCtrl,o)};id.prototype.createModifyMesh=function(o,A){return new Tle(this._earthCtrl).addClipping(o,A)};id.prototype.createTerrainModifier=function(o){return new Mle(this._earthCtrl,o)};id.prototype.createTerrainExcavation=function(o){return new Lle(this._earthCtrl,o)};id.prototype.createExcavationAndFillAnalysis=function(o){return new Rle(this._earthCtrl,o)};id.prototype.createVolumetricMeasure=function(o){return new BAt(this._earthCtrl,o)};id.prototype.createModelVolumetric=function(o){return new bAt(this._earthCtrl,o)};id.prototype.createModelCutting=function(o){return new QAt(this._earthCtrl,o)};id.prototype.createTerrainCutting=function(o){return new SAt(this._earthCtrl,o)};id.prototype.createModelSection=function(o){return new DAt(this._earthCtrl,o)};var Nle=id;function kle(o,A){if(this._earthCtrl=o,!O(A.flagHtml))throw new Ui("flagDiv is required.");this._flagHtml=A.flagHtml,this._options=Ae(A,Ae.EMAIL),this._circleRadius=Ae(A.circleRadius,10),this._lon=Ae(A.lon,121),this._lat=Ae(A.lat,31),this._height=Ae(A.height,0),this._show=Ae(A.show,!0),this._flagScale=Ae(A.flagScale,4),this._circleColor=Ae(A.circleColor,At.RED),this._cylinderColor=Ae(A.cylinderColor,At.YELLOWGREEN),this._duration=Ae(A.duration,2e3),this._gradient=Ae(A.gradient,2),this._count=Ae(A.count,2),this._canvasZoom=Ae(A.canvasZoom,10),this._circleEntity=void 0,this._cylinderEntity=void 0,this._lineEntity=void 0,this._htmlPlaneEntity=void 0,this._linePlaneEntity=void 0,this._flagDiv=document.createElement("div"),this._flagDiv.style.opacity="0.7",this._flagDiv.style.margin="0",this._flagDiv.style.padding="0",this._flagDiv.id=Ae(A.id,Vu()),this._flagDiv.innerHTML=this._flagHtml,this._show&&this.addToMap()}kle.prototype.removeFromMap=function(){O(this._circleEntity)&&(this._earthCtrl.entities.remove(this._circleEntity),this._circleEntity=void 0),O(this._cylinderEntity)&&(this._earthCtrl.entities.remove(this._cylinderEntity),this._cylinderEntity=void 0),O(this._lineEntity)&&(this._earthCtrl.entities.remove(this._lineEntity),this._lineEntity=void 0),O(this._linePlaneEntity)&&(this._earthCtrl.entities.remove(this._linePlaneEntity),this._linePlaneEntity=void 0),O(this._htmlPlaneEntity)&&(this._earthCtrl.entities.remove(this._htmlPlaneEntity),this._htmlPlaneEntity=void 0)};kle.prototype.addToMap=function(){let o=this,A=0,f=2,m,C=ee.fromDegrees(o._lon,o._lat,o._height);if(O(o._circleEntity)||(o._circleEntity=o._earthCtrl.entities.add({position:C,ellipse:{height:o._height,semiMinorAxis:o._circleRadius,semiMajorAxis:o._circleRadius,material:new $8({duration:o._duration,gradient:o._gradient,color:o._circleColor,count:o._count})}})),!O(o._cylinderEntity)){let v=o._circleRadius*2/5,E=o._circleRadius*3/4;m=fQ.changeCartesian3Height(C,E/2),o._cylinderEntity=o._earthCtrl.entities.add({position:m,cylinder:{length:E,topRadius:v,bottomRadius:v,fill:!0,outline:!1,material:o._cylinderColor}})}if(O(o._lineEntity)||(A=o._circleRadius*o._flagScale+o._height,o._lineEntity=o._earthCtrl.entities.add({polyline:{width:f,positions:ee.fromDegreesArrayHeights([o._lon,o._lat,o._height,o._lon,o._lat,A]),material:o._cylinderColor}})),!O(o._htmlPlaneEntity)){A=o._circleRadius*o._flagScale;let v=A/5,E=v*3,I=A-v/2,w=4*f,Q=new ee(w/2,0,I),M=fQ.changeCartesian3ByScalar(C,Q);this._linePlaneEntity=o._earthCtrl.entities.add({position:M,plane:{plane:new Wa(ee.UNIT_Y,0),dimensions:new It(w,v),material:o._cylinderColor}});let B=new ee(E/2+w,0,I);m=fQ.changeCartesian3ByScalar(C,B);let T=o._flagDiv,D=o._canvasZoom,F=document.createElement("canvas");F.width=10*v/E*D,F.height=10*D,uH.drawDocument(T,F,{zoom:D}).then(function(L){o._htmlPlaneEntity=o._earthCtrl.entities.add({position:new Bn(y,!1),plane:{plane:new Bn(x,!0),dimensions:new It(E,v),material:new z0({image:L.image,transparent:!0})}})},function(L){console.info(L)})}function y(){return m}function x(){let v=new ee;return v=ee.negate(ee.UNIT_Y,v),new Wa(v,0)}};Object.defineProperties(kle.prototype,{});var TAt=kle;function Ole(o,A){this._earthCtrl=o,this._scene=o.coreMap.scene,this._options=O(A,Ae.EMPTY_OBJECT),this._color=Ae(A.color,At.RED),this._lon=Ae(A.lon,121),this._lat=Ae(A.lat,31),this._height=Ae(A.height,0),this._statistics=Ae(A.statisticData,1e3),this._radius=Ae(A.radius,100),this._duration=Ae(A.duration,2e3),this._gradient=Ae(A.gradient,2),this._count=Ae(A.count,2),this._scale=Ae(A.dataScale,1),this._show=Ae(A.show,!0),this._billboardWidthRatio=Ae(A.billboardWidthRatio,1.2),this._billboardHeightRatio=Ae(A.billboardHeightRatio,2.4),this._prefix=Ae(A.prefix,""),this._scaleByDistance=Ae(A.scaleByDistance,new To(1500,3,15e3,.1)),this._topFillColor=Ae(A.topFillColor,At.fromCssColorString("#323232")),this._circleEntity=void 0,this._cylinderEntity=void 0,this._billboardEntity=void 0,this._position=ee.fromDegrees(this._lon,this._lat,this._height),this._show&&this.addToMap()}var LN=new ee;Ole.prototype.addToMap=function(){let o=this;if(O(o._circleEntity)||(o._circleEntity=o._earthCtrl.entities.add({position:o._position,ellipse:{height:o._height,semiMinorAxis:o._radius,semiMajorAxis:o._radius,material:new $8({duration:o._duration,gradient:o._gradient,color:o._color,count:o._count})}})),!O(o._cylinderEntity)){LN=ee.clone(o._position,LN);let A=o._statistics*o._scale,f=Vn.eastNorthUpToFixedFrame(LN),m=new ee(0,0,A/2);Xe.multiplyByPoint(f,m,LN),o._cylinderEntity=o._earthCtrl.entities.add({position:LN,cylinder:{length:A,topRadius:o._radius/10,bottomRadius:o._radius/10,fill:!0,outline:!1,material:o._color}})}if(!O(o._billboardEntity)){LN=ee.clone(o._position,LN);let A=o._cylinderEntity.cylinder.length._value,f=Kt.fromCartesian(LN),m=ee.fromRadians(f.longitude,f.latitude,f.height+A);o._billboardEntity=o._earthCtrl.entities.add({position:m,billboard:{scaleByDistance:o._scaleByDistance,verticalOrigin:bn.BOTTOM,width:o._radius/o._billboardWidthRatio,height:o._radius/o._billboardHeightRatio,image:kLi(o._color,o._topFillColor,o._prefix+o._statistics,o._radius).toDataURL()}})}};Ole.prototype.removeFromMap=function(){O(this._cylinderEntity)&&(this._earthCtrl.entities.remove(this._cylinderEntity),this._cylinderEntity=void 0),O(this._circleEntity)&&(this._earthCtrl.entities.remove(this._circleEntity),this._circleEntity=void 0),O(this._billboardEntity)&&(this._earthCtrl.entities.remove(this._billboardEntity),this._billboardEntity=void 0)};function FLi(o,A,f,m){o.save(),o.strokeStyle="rgba(0,0,0,0)",o.scale(m/150,m/100),o.save(),o.fillStyle=A.toCssColorString(),o.lineWidth=4,o.beginPath(),o.moveTo(77.8,82.1),o.lineTo(64.6,69),o.lineTo(23.8,69),o.bezierCurveTo(20.8,69,18.3,66.5,18.3,63.5),o.lineTo(18.3,22.5),o.bezierCurveTo(18.3,19.5,20.8,17,23.8,17),o.lineTo(131.8,17),o.bezierCurveTo(134.8,17,137.3,19.5,137.3,22.5),o.lineTo(137.3,63.5),o.bezierCurveTo(137.3,66.5,134.8,69,131.8,69),o.lineTo(90.9,69),o.lineTo(77.8,82.1),o.closePath(),o.moveTo(23.8,18),o.bezierCurveTo(21.3,18,19.3,20,19.3,22.5),o.lineTo(19.3,63.5),o.bezierCurveTo(19.3,66,21.3,68,23.8,68),o.lineTo(65,68),o.lineTo(77.7,80.7),o.lineTo(90.5,68),o.lineTo(131.8,68),o.bezierCurveTo(134.3,68,136.3,66,136.3,63.5),o.lineTo(136.3,22.5),o.bezierCurveTo(136.3,20,134.3,18,131.8,18),o.lineTo(23.8,18),o.closePath(),o.fill(),o.stroke(),o.restore(),o.save(),o.fillStyle=f.toCssColorString(),o.beginPath(),o.moveTo(131.8,18),o.lineTo(23.80000000000001,18),o.bezierCurveTo(21.30000000000001,18,19.30000000000001,20,19.30000000000001,22.5),o.lineTo(19.30000000000001,63.5),o.bezierCurveTo(19.30000000000001,66,21.30000000000001,68,23.80000000000001,68),o.lineTo(65,68),o.lineTo(77.7,80.7),o.lineTo(90.5,68),o.lineTo(131.8,68),o.bezierCurveTo(134.3,68,136.3,66,136.3,63.5),o.lineTo(136.3,22.5),o.bezierCurveTo(136.3,20,134.2,18,131.8,18),o.closePath(),o.fill(),o.stroke(),o.restore(),o.restore()}function NLi(o,A,f){let m=f/1.4,C=m,y=m;A.width>A.height?y=m*(A.height/A.width):A.width<A.height&&(C=m*(A.width/A.height));let x=f/150*8,v=Math.round((f-C+x)/2),E=Math.round((5/6*f-y)/2);o.drawImage(A,v,E,C,y)}function kLi(o,A,f,m){let C=document.createElement("canvas");C.width=m,C.height=m;let y=C.getContext("2d");FLi(y,o,A,m);let x=m,v=k5(f,{font:`bold ${x}pt Microsoft YaHei`,fillColor:o});return NLi(y,v,x),C}Object.defineProperties(Ole.prototype,{billboard:{get:function(){return this._billboardEntity}},cylinder:{get:function(){return this._cylinderEntity}},circle:{get:function(){return this._circleEntity}},show:{get:function(){return this._show},set:function(o){O(this._billboardEntity)&&(this._billboardEntity.show=o),O(this._cylinderEntity)&&(this._cylinderEntity.show=o),O(this._circleEntity)&&(this._circleEntity.show=o)}}});var MAt=Ole;function fMe(o,A){if(this._earthCtrl=o,this._scene=o.coreMap.scene,this._options=Ae(A,Ae.EMPTY_OBJECT),this._color=Ae(A.color,At.RED),this._lon=Ae(A.lon,121),this._lat=Ae(A.lat,31),this._height=Ae(A.height,0),this._show=Ae(A.show,!0),this._containerWidth=Ae(A.containerWidth,200),this._containerHeight=Ae(A.containerHeight,200),this._containerColor=Ae(A.cylinderColor,At.YELLOWGREEN),this._canvasZoom=Ae(A.canvasZoom,10),this._scaleByDistance=Ae(A.scaleByDistance,new To(1500,3,15e3,.1)),this._tipsHtml=A.tipsHtml,this._tipsEntity=void 0,this._tipsDiv=document.createElement("div"),this._tipsDiv.style.opacity="0.7",this._tipsDiv.style.margin="0",this._tipsDiv.style.padding="0",this._tipsDiv.id=Ae(A.id,Vu()),this._tipsDiv.innerHTML=this._tipsHtml,!O(A.tipsHtml))throw new Ui("tipsHtml is required.");this.addToMap()}fMe.prototype.removeFromMap=function(){O(this._tipsEntity)&&(this._earthCtrl.entities.remove(this._tipsEntity),this._tipsEntity=void 0),O(this._tipsDiv)&&(this._earthCtrl.entities.remove(this._tipsDiv),this._tipsDiv=void 0)};fMe.prototype.addToMap=function(){let o=this,A=ee.fromDegrees(o._lon,o._lat,o._height);if(!O(o._tipsEntity)){let m=o._containerHeight,C=o._containerWidth,y=o._canvasZoom,x=o._tipsDiv,v=document.createElement("canvas");v.width=C,v.height=m,uH.drawDocument(x,v,{zoom:y}).then(function(E){o._tipsEntity=o._earthCtrl.entities.add({position:new Bn(f,!1),billboard:{scaleByDistance:o._scaleByDistance,verticalOrigin:bn.BOTTOM,width:C,height:m,image:E.image.src}})},function(E){console.info(E)})}function f(){return A}};var PAt=fMe;function jO(o,A){this._earthCtrl=o,this._scene=o.coreMap.scene,this._options=Ae(A,Ae.EMPTY_OBJECT),this.element=document.createElement("div"),this._html=Ae(A.html,""),this._lon=Ae(A.lon,121),this._lat=Ae(A.lat,31),this._height=Ae(A.height,10),this._show=Ae(A.show,!0),this._removeHandler=void 0,this._pos=void 0,this._position=void 0,this._c=void 0,this._changedC=void 0,this._point=void 0,this._parameter=A,this._rtti="GwScreenDialog",this.isInit=!1,this.isInit===!1&&this.addToMap()}jO.prototype.setHtml=function(o){this.element.innerHTML=o};jO.prototype.setShow=function(o){if(!this.isInit)return 0;this.element.style.display=o?"block":"none"};jO.prototype.showAt=function(){if(!this.isInit)return 0;this._position&&(this._pos=Ss.wgs84ToWindowCoordinates(this._scene,this._position),this._pos&&(this.element.style.left=`${this._pos.x}px`,this.element.style.top=`${this._pos.y}px`))};jO.prototype.removeFromMap=function(){this.element.remove(),this.isInit=!1};jO.prototype.addToMap=function(){if(this.isInit)return 0;nA(".map-widget",this.element),this.element.innerHTML=this._html,this.element.style.position="absolute",this.isInit=!0,this._position=ee.fromDegrees(this._lon,this._lat,this._height),this.showAt(),this._c=new It(this._pos.x,this._pos.y);let o=this;this._scene.camera.moveStart.addEventListener(function(){o._removeHandler=o._scene.postRender.addEventListener(function(){if(o._c){let A=new F5(Di.WGS84,o._earthCtrl.camera._camera.position);A&&o._position&&(A.isPointVisible(o._position)===!1?o.setShow(!1):(o._show===!0&&o.setShow(!0),o._changedC=Ss.wgs84ToWindowCoordinates(o._scene,o._position),o._changedC?(o._c=o._changedC,o.showAt()):o.setShow(!1)))}})}),this._scene.camera.moveEnd.addEventListener(function(){o._removeHandler&&o._removeHandler.call()})};Object.defineProperties(jO.prototype,{show:{get:function(){return this._show},set:function(o){this._show!==o&&(this._show=o,this.setShow(o))}},html:{get:function(){return this._html},set:function(o){this._html!==o&&(this._html=o,this.setHtml(o))}},lon:{get:function(){return this._lon},set:function(o){this._lon!==o&&(this._lon=o,this._position=ee.fromDegrees(this._lon,this._lat,this._height),this.showAt())}},lat:{get:function(){return this._lat},set:function(o){this._lat!==o&&(this._lat=o,this._position=ee.fromDegrees(this._lon,this._lat,this._height),this.showAt())}},height:{get:function(){return this._height},set:function(o){this._height!==o&&(this._height=o,this._position=ee.fromDegrees(this._lon,this._lat,this._height),this.showAt())}}});var RAt=jO;function UW(o){this._earthCtrl=o,this._coreMap=o.coreMap}UW.prototype.createStatisticFlag=function(o){return new TAt(this._earthCtrl,o)};UW.prototype.createStatisticCylinder=function(o){return new MAt(this._earthCtrl,o)};UW.prototype.createTipsContainer=function(o){return new PAt(this._earthCtrl,o)};UW.prototype.createScreenDialog=function(o){return new RAt(this._earthCtrl,o)};var LAt=UW;function Ule(){var o=["getKeyRecoveryParam","curveType","Input not Buffer","map","_ipad","b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef","setAutoPadding","rejected",'{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}',"dir","transform","ERR_UNKNOWN_ENCODING","mulf","Apr","_verify2","tmp","EncoderBuffer","password","raw","isBoxedPrimitive","onRuntimeInitialized","seqof","addn","sqlite3_bind_double","sum32_5","000000000000000000","bufferedRequest","non-byte EncoderBuffer value","set","ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","_countBits","assign","publicKey","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758","privateExponent","fired","root","isString","invalid sig","WeakMap","modulus must be greater than 1","_sqlite3_result_int64","-e4437ed6010e88286f547fa90abfe4c3","onend","modelDbModelIdList","The argument '","5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b","save","arrayBufferBlockCount","sum64_5_hi","notStrictEqual","sqlite3_column_blob","entry","c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","utf8","c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","readableListening","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865","/dev/stdin","clock","Password","codes","exitKey","a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","SetModelStoreyTransform","fromRed works only with numbers in reduction context","callbackify","e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","worldDirection","494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","byteLength","spread","kdeparams","canvas","7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","_final","not ","createDecipher","chdir","6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c","[object HTMLCollection]","_sqlite3_changes","dataStoreArrayBuffer","Trace","shim","isArgumentsObject","'name' must be a string","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58","isBuf","falling back to ArrayBuffer instantiation","Index out of range","call","[object Object]","emitter","tagged","rsa",'Failed to peek tag: "',"content","Attempt to access memory outside buffer bounds","eject","ERR_FR_TOO_MANY_REDIRECTS","exists","da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","pipe","String","boolean","Rand","_decodeTag","getHighWaterMark","3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","ERR_BUFFER_OUT_OF_BOUNDS","getCiphers","callee","2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06","serialNumber","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc","tinv","ineg","bool","0x8000000000000000","%Object.getOwnPropertyDescriptor%","00000000000000000","sync","maj32",". Build with -s ASSERTIONS=1 for more info.","0x7fffffffffffffff","search","iterator","readInt16LE","0000000000000","ECONNABORTED","join32","d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","imuln","zeroBits","acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","mtime","setRequestHeader","Instance","9333177ztxjEH","imul","worldUp","\x1B[31m"," [Function","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3","utils","toNumber","Number","heartbeat","ended","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375","isNull","stream","ixor","_importPublic","da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","outSize","path=","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589","hmacStrength","trying to set auth tag in unsupported state","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d","fillLast",'"buf" argument must be a Buffer or Uint8Array',"Jul","fromSecret","ETIMEDOUT","content-length","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e","notStrictEqualObject","aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","746590PyDowD","subjectPrivateKey","emitClose","writing","_secret","___errno_location"," ** ","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8","Number is too big","Function","_decode"," and <= ","4446261rhToce","RDNSequence","shift","numstr","oneC","Cancel","readingMore","BasePoint","52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","simpleSieve","getDivisor","charstr","a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","_events","SaveShell","Premature close","/dev/shm","176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ms exceeded","_sqlite3_open",'" argument must be of type number. Received type ',"recoveryParam","HEAP32","00000000000000000000000","onlyShowShells","persEnc","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8","revBin","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573","config","des-ede3","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e","allowHalfOpen","Not implemented yet","copy","computeSecret","Cipher","d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","handlers","Digest already called",`
uniform sampler2D colorTexture;
uniform sampler2D depthTexture;
// in vec2 v_textureCoordinates;
public/WebSDK/index.cjs
@@ -1,11 +1,11 @@
/**
 *
 * SmartEarth WebSDK - https://websdk.terra-it.cn
 * Version 3.2.4-11
 * Version 3.2.4-12
 *
 **/
var J_t=Object.create;var xX=Object.defineProperty;var W_t=Object.getOwnPropertyDescriptor;var j_t=Object.getOwnPropertyNames;var q_t=Object.getPrototypeOf,X_t=Object.prototype.hasOwnProperty;var Z_t=(o,A)=>()=>(A||o((A={exports:{}}).exports,A),A.exports),sde=(o,A)=>{for(var f in A)xX(o,f,{get:A[f],enumerable:!0})},y5e=(o,A,f,m)=>{if(A&&typeof A=="object"||typeof A=="function")for(let C of j_t(A))!X_t.call(o,C)&&C!==f&&xX(o,C,{get:()=>A[C],enumerable:!(m=W_t(A,C))||m.enumerable});return o};var S9=(o,A,f)=>(f=o!=null?J_t(q_t(o)):{},y5e(A||!o||!o.__esModule?xX(f,"default",{value:o,enumerable:!0}):f,o)),$_t=o=>y5e(xX({},"__esModule",{value:!0}),o);var Sct=Z_t((Qct,Dse)=>{(function(o,A,f){typeof Dse<"u"&&Dse.exports?Dse.exports=f():typeof define=="function"&&define.amd?define(f):A[o]=f()})("h337",Qct,function(){var o={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.25:"rgb(0,0,255)",.55:"rgb(0,255,0)",.85:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}},A=function(){var E=function(Q){this._coordinator={},this._data=[],this._radi=[],this._min=10,this._max=1,this._xField=Q.xField||Q.defaultXField,this._yField=Q.yField||Q.defaultYField,this._valueField=Q.valueField||Q.defaultValueField,Q.radius&&(this._cfgRadius=Q.radius)},I=o.defaultRadius;return E.prototype={_organiseData:function(w,Q){var M=w[this._xField],B=w[this._yField],T=this._radi,D=this._data,F=this._max,L=this._min,R=w[this._valueField]||1,k=w.radius||this._cfgRadius||I;D[M]||(D[M]=[],T[M]=[]),D[M][B]?D[M][B]+=R:(D[M][B]=R,T[M][B]=k);var U=D[M][B];return U>F?(Q?this.setDataMax(U):this._max=U,!1):U<L?(Q?this.setDataMin(U):this._min=U,!1):{x:M,y:B,value:R,radius:k,min:L,max:F}},_unOrganizeData:function(){var w=[],Q=this._data,M=this._radi;for(var B in Q)for(var T in Q[B])w.push({x:B,y:T,radius:M[B][T],value:Q[B][T]});return{min:this._min,max:this._max,data:w}},_onExtremaChange:function(){this._coordinator.emit("extremachange",{min:this._min,max:this._max})},addData:function(){if(arguments[0].length>0)for(var w=arguments[0],Q=w.length;Q--;)this.addData.call(this,w[Q]);else{var M=this._organiseData(arguments[0],!0);M&&(this._data.length===0&&(this._min=this._max=M.value),this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[M]}))}return this},setData:function(w){var Q=w.data,M=Q.length;this._data=[],this._radi=[];for(var B=0;B<M;B++)this._organiseData(Q[B],!1);return this._max=w.max,this._min=w.min||0,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},removeData:function(){},setDataMax:function(w){return this._max=w,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setDataMin:function(w){return this._min=w,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setCoordinator:function(w){this._coordinator=w},_getInternalData:function(){return{max:this._max,min:this._min,data:this._data,radi:this._radi}},getData:function(){return this._unOrganizeData()}},E}(),f=function(){var E=function(M){var B=M.gradient||M.defaultGradient,T=document.createElement("canvas"),D=T.getContext("2d");T.width=256,T.height=1;var F=D.createLinearGradient(0,0,256,1);for(var L in B)F.addColorStop(L,B[L]);return D.fillStyle=F,D.fillRect(0,0,256,1),D.getImageData(0,0,256,1).data},I=function(M,B){var T=document.createElement("canvas"),D=T.getContext("2d"),F=M,L=M;if(T.width=T.height=M*2,B==1)D.beginPath(),D.arc(F,L,M,0,2*Math.PI,!1),D.fillStyle="rgba(0,0,0,1)",D.fill();else{var R=D.createRadialGradient(F,L,M*B,F,L,M);R.addColorStop(0,"rgba(0,0,0,1)"),R.addColorStop(1,"rgba(0,0,0,0)"),D.fillStyle=R,D.fillRect(0,0,2*M,2*M)}return T},w=function(L){for(var B=[],T=L.min,D=L.max,F=L.radi,L=L.data,R=Object.keys(L),k=R.length;k--;)for(var U=R[k],V=Object.keys(L[U]),H=V.length;H--;){var q=V[H],ie=L[U][q],Z=F[U][q];B.push({x:U,y:q,value:ie,radius:Z})}return{min:T,max:D,data:B}};function Q(M){var B=M.container,T=this.shadowCanvas=document.createElement("canvas"),D=this.canvas=M.canvas||document.createElement("canvas"),F=this._renderBoundaries=[1e4,1e4,0,0],L=getComputedStyle(M.container)||{};D.className="heatmap-canvas",this._width=D.width=T.width=M.width||+L.width.replace(/px/,""),this._height=D.height=T.height=M.height||+L.height.replace(/px/,""),this.shadowCtx=T.getContext("2d"),this.ctx=D.getContext("2d"),D.style.cssText=T.style.cssText="position:absolute;left:0;top:0;",B.style.position="relative",B.appendChild(D),this._palette=E(M),this._templates={},this._setStyles(M)}return Q.prototype={renderPartial:function(M){M.data.length>0&&(this._drawAlpha(M),this._colorize())},renderAll:function(M){this._clear(),M.data.length>0&&(this._drawAlpha(w(M)),this._colorize())},_updateGradient:function(M){this._palette=E(M)},updateConfig:function(M){M.gradient&&this._updateGradient(M),this._setStyles(M)},setDimensions:function(M,B){this._width=M,this._height=B,this.canvas.width=this.shadowCanvas.width=M,this.canvas.height=this.shadowCanvas.height=B},_clear:function(){this.shadowCtx.clearRect(0,0,this._width,this._height),this.ctx.clearRect(0,0,this._width,this._height)},_setStyles:function(M){this._blur=M.blur==0?0:M.blur||M.defaultBlur,M.backgroundColor&&(this.canvas.style.backgroundColor=M.backgroundColor),this._width=this.canvas.width=this.shadowCanvas.width=M.width||this._width,this._height=this.canvas.height=this.shadowCanvas.height=M.height||this._height,this._opacity=(M.opacity||0)*255,this._maxOpacity=(M.maxOpacity||M.defaultMaxOpacity)*255,this._minOpacity=(M.minOpacity||M.defaultMinOpacity)*255,this._useGradientOpacity=!!M.useGradientOpacity},_drawAlpha:function(D){for(var B=this._min=D.min,T=this._max=D.max,D=D.data||[],F=D.length,L=1-this._blur;F--;){var R=D[F],k=R.x,U=R.y,V=R.radius,H=Math.min(R.value,T),q=k-V,ie=U-V,Z=this.shadowCtx,oe;this._templates[V]?oe=this._templates[V]:this._templates[V]=oe=I(V,L);var ne=(H-B)/(T-B);Z.globalAlpha=ne<.01?.01:ne,Z.drawImage(oe,q,ie),q<this._renderBoundaries[0]&&(this._renderBoundaries[0]=q),ie<this._renderBoundaries[1]&&(this._renderBoundaries[1]=ie),q+2*V>this._renderBoundaries[2]&&(this._renderBoundaries[2]=q+2*V),ie+2*V>this._renderBoundaries[3]&&(this._renderBoundaries[3]=ie+2*V)}},_colorize:function(){var M=this._renderBoundaries[0],B=this._renderBoundaries[1],T=this._renderBoundaries[2]-M,D=this._renderBoundaries[3]-B,F=this._width,L=this._height,R=this._opacity,k=this._maxOpacity,U=this._minOpacity,V=this._useGradientOpacity;M<0&&(M=0),B<0&&(B=0),M+T>F&&(T=F-M),B+D>L&&(D=L-B);for(var H=this.shadowCtx.getImageData(M,B,T,D),q=H.data,ie=q.length,Z=this._palette,oe=3;oe<ie;oe+=4){var ne=q[oe],se=ne*4;if(!!se){var ce;R>0?ce=R:ne<k?ne<U?ce=U:ce=ne:ce=k,q[oe-3]=Z[se],q[oe-2]=Z[se+1],q[oe-1]=Z[se+2],q[oe]=V?Z[se+3]:ce}}H.data=q,this.ctx.putImageData(H,M,B),this._renderBoundaries=[1e3,1e3,0,0]},getValueAt:function(M){var B,T=this.shadowCtx,D=T.getImageData(M.x,M.y,1,1),F=D.data[3],L=this._max,R=this._min;return B=Math.abs(L-R)*(F/255)>>0,B},getDataURL:function(){return this.canvas.toDataURL()}},Q}(),m=function(){var E=!1;return o.defaultRenderer==="canvas2d"&&(E=f),E}(),C={merge:function(){for(var v={},E=arguments.length,I=0;I<E;I++){var w=arguments[I];for(var Q in w)v[Q]=w[Q]}return v}},y=function(){var E=function(){function M(){this.cStore={}}return M.prototype={on:function(B,T,D){var F=this.cStore;F[B]||(F[B]=[]),F[B].push(function(L){return T.call(D,L)})},emit:function(B,T){var D=this.cStore;if(D[B])for(var F=D[B].length,L=0;L<F;L++){var R=D[B][L];R(T)}}},M}(),I=function(Q){var M=Q._renderer,B=Q._coordinator,T=Q._store;B.on("renderpartial",M.renderPartial,M),B.on("renderall",M.renderAll,M),B.on("extremachange",function(D){Q._config.onExtremaChange&&Q._config.onExtremaChange({min:D.min,max:D.max,gradient:Q._config.gradient||Q._config.defaultGradient})}),T.setCoordinator(B)};function w(){var Q=this._config=C.merge(o,arguments[0]||{});if(this._coordinator=new E,Q.plugin){var M=Q.plugin;if(o.plugins[M]){var B=o.plugins[M];this._renderer=new B.renderer(Q),this._store=new B.store(Q)}else throw new Error("Plugin '"+M+"' not found. Maybe it was not registered.")}else this._renderer=new m(Q),this._store=new A(Q);I(this)}return w.prototype={addData:function(){return this._store.addData.apply(this._store,arguments),this},removeData:function(){return this._store.removeData&&this._store.removeData.apply(this._store,arguments),this},setData:function(){return this._store.setData.apply(this._store,arguments),this},setDataMax:function(){return this._store.setDataMax.apply(this._store,arguments),this},setDataMin:function(){return this._store.setDataMin.apply(this._store,arguments),this},configure:function(Q){return this._config=C.merge(this._config,Q),this._renderer.updateConfig(this._config),this._coordinator.emit("renderall",this._store._getInternalData()),this},repaint:function(){return this._coordinator.emit("renderall",this._store._getInternalData()),this},getData:function(){return this._store.getData()},getDataURL:function(){return this._renderer.getDataURL()},getValueAt:function(Q){return this._store.getValueAt?this._store.getValueAt(Q):this._renderer.getValueAt?this._renderer.getValueAt(Q):null}},w}(),x={create:function(v){return new y(v)},register:function(v,E){o.plugins[v]=E}};return x})});var Hki={};sde(Hki,{Analysis:()=>Fle,BaseObject:()=>c0,Billboard:()=>Pse,Box:()=>Kse,BwMode:()=>fse,Camera:()=>Wae,Cesium:()=>z2e,ClusterLayer:()=>qut,ColorAdjustment:()=>dse,Core:()=>oct,Cylinder:()=>Jse,Degrees:()=>Xut,DoubleClickObjectTool:()=>rse,DoubleScreen:()=>ect,DynamicEyeOffset:()=>oPi,EarthCtrl:()=>e0t,Edit:()=>vle,EditTool:()=>use,ElevationTool:()=>tct,Ellipse:()=>$se,Ellipsoid:()=>jse,Environment:()=>pse,EventHandler:()=>SN,Explosion:()=>bse,FeatureLayer:()=>ule,Fire:()=>Ise,Fireworks:()=>Sse,FisheyeVideoProjection:()=>xse,Fog:()=>cse,Hawkeye:()=>fle,HorizontalDistanceTool:()=>Zae,HoverObjectTool:()=>ise,ImageryLayer:()=>rle,Label:()=>Nse,LineOfSightTool:()=>i0t,Measure:()=>ase,MeasureAreaTool:()=>kH,MeasureHeightTool:()=>qae,MeasureLineLengthTool:()=>jae,MeasurePathLengthTool:()=>DW,MeasureSlopeTool:()=>Xae,MeasureSurfaceAreaTool:()=>$ae,MilitaryPlotting:()=>nue,Model:()=>Lse,ModelClipping:()=>Dle,ModelEdit:()=>RH,ModelLayer:()=>sle,NightMode:()=>gse,Node:()=>UO,ObjectFactory:()=>D2,PerspectiveVideoProjection:()=>yse,PickObjectTool:()=>ese,PickPositionTool:()=>tse,Point:()=>Vse,Polygon:()=>Gse,Polyline:()=>Ose,PolylineVolume:()=>tle,Profile:()=>Ble,RClickObjectTool:()=>nse,RadarScan:()=>Tse,Rain:()=>Ase,Rectangle:()=>Xse,RestrictHeight:()=>Sle,SampleRenderedDataFlags:()=>nPi,Scene:()=>xle,SceneManager:()=>t0t,SelectSet:()=>Cse,Skyline:()=>ble,Smoke:()=>Bse,Snow:()=>hse,SpatialObject:()=>Qc,SpatialTransform:()=>Vae,SpotLight:()=>ple,Submergence:()=>_le,TerrainExcavation:()=>Rle,TerrainLayer:()=>ole,TerrainModifier:()=>Tle,Tool:()=>ja,ToolManager:()=>Jae,VERSIONINFO:()=>I5e,VideoProjection:()=>r0t,ViewShed:()=>Ele,Volumetric:()=>Ile,WFSTool:()=>jut,Waters:()=>dle,WorkChart:()=>Ale,ZBiasGeometryInstanceAttribute:()=>rPi,czmlPathAnimation:()=>ETe,loadArrayBuffer:()=>hPi,loadBlob:()=>APi,loadImage:()=>dPi,loadJson:()=>cPi,loadLayui:()=>ITe,loadText:()=>uPi,sampleRenderedData:()=>aPi,sampleRenderedMesh:()=>sPi,sampleRenderedTerrain:()=>lPi,viewerNavigationCubeMixin:()=>s0t});module.exports=$_t(Hki);var x5e="WebSDK v3.2.4-11",v5e="Cesium v1.99",E5e="2023.11.28",eBt="SmartEarth",tBt={VERSION:x5e,CesiumVERSION:v5e,CompileTime:E5e},iBt=typeof window<"u"?window:typeof self<"u"?self:{};iBt.logSmartEarth=()=>{let o=`
var J_t=Object.create;var xX=Object.defineProperty;var W_t=Object.getOwnPropertyDescriptor;var j_t=Object.getOwnPropertyNames;var q_t=Object.getPrototypeOf,X_t=Object.prototype.hasOwnProperty;var Z_t=(o,A)=>()=>(A||o((A={exports:{}}).exports,A),A.exports),sde=(o,A)=>{for(var f in A)xX(o,f,{get:A[f],enumerable:!0})},y5e=(o,A,f,m)=>{if(A&&typeof A=="object"||typeof A=="function")for(let C of j_t(A))!X_t.call(o,C)&&C!==f&&xX(o,C,{get:()=>A[C],enumerable:!(m=W_t(A,C))||m.enumerable});return o};var S9=(o,A,f)=>(f=o!=null?J_t(q_t(o)):{},y5e(A||!o||!o.__esModule?xX(f,"default",{value:o,enumerable:!0}):f,o)),$_t=o=>y5e(xX({},"__esModule",{value:!0}),o);var Sct=Z_t((Qct,Dse)=>{(function(o,A,f){typeof Dse<"u"&&Dse.exports?Dse.exports=f():typeof define=="function"&&define.amd?define(f):A[o]=f()})("h337",Qct,function(){var o={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.25:"rgb(0,0,255)",.55:"rgb(0,255,0)",.85:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}},A=function(){var E=function(Q){this._coordinator={},this._data=[],this._radi=[],this._min=10,this._max=1,this._xField=Q.xField||Q.defaultXField,this._yField=Q.yField||Q.defaultYField,this._valueField=Q.valueField||Q.defaultValueField,Q.radius&&(this._cfgRadius=Q.radius)},I=o.defaultRadius;return E.prototype={_organiseData:function(w,Q){var M=w[this._xField],B=w[this._yField],T=this._radi,D=this._data,F=this._max,L=this._min,R=w[this._valueField]||1,k=w.radius||this._cfgRadius||I;D[M]||(D[M]=[],T[M]=[]),D[M][B]?D[M][B]+=R:(D[M][B]=R,T[M][B]=k);var U=D[M][B];return U>F?(Q?this.setDataMax(U):this._max=U,!1):U<L?(Q?this.setDataMin(U):this._min=U,!1):{x:M,y:B,value:R,radius:k,min:L,max:F}},_unOrganizeData:function(){var w=[],Q=this._data,M=this._radi;for(var B in Q)for(var T in Q[B])w.push({x:B,y:T,radius:M[B][T],value:Q[B][T]});return{min:this._min,max:this._max,data:w}},_onExtremaChange:function(){this._coordinator.emit("extremachange",{min:this._min,max:this._max})},addData:function(){if(arguments[0].length>0)for(var w=arguments[0],Q=w.length;Q--;)this.addData.call(this,w[Q]);else{var M=this._organiseData(arguments[0],!0);M&&(this._data.length===0&&(this._min=this._max=M.value),this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[M]}))}return this},setData:function(w){var Q=w.data,M=Q.length;this._data=[],this._radi=[];for(var B=0;B<M;B++)this._organiseData(Q[B],!1);return this._max=w.max,this._min=w.min||0,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},removeData:function(){},setDataMax:function(w){return this._max=w,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setDataMin:function(w){return this._min=w,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setCoordinator:function(w){this._coordinator=w},_getInternalData:function(){return{max:this._max,min:this._min,data:this._data,radi:this._radi}},getData:function(){return this._unOrganizeData()}},E}(),f=function(){var E=function(M){var B=M.gradient||M.defaultGradient,T=document.createElement("canvas"),D=T.getContext("2d");T.width=256,T.height=1;var F=D.createLinearGradient(0,0,256,1);for(var L in B)F.addColorStop(L,B[L]);return D.fillStyle=F,D.fillRect(0,0,256,1),D.getImageData(0,0,256,1).data},I=function(M,B){var T=document.createElement("canvas"),D=T.getContext("2d"),F=M,L=M;if(T.width=T.height=M*2,B==1)D.beginPath(),D.arc(F,L,M,0,2*Math.PI,!1),D.fillStyle="rgba(0,0,0,1)",D.fill();else{var R=D.createRadialGradient(F,L,M*B,F,L,M);R.addColorStop(0,"rgba(0,0,0,1)"),R.addColorStop(1,"rgba(0,0,0,0)"),D.fillStyle=R,D.fillRect(0,0,2*M,2*M)}return T},w=function(L){for(var B=[],T=L.min,D=L.max,F=L.radi,L=L.data,R=Object.keys(L),k=R.length;k--;)for(var U=R[k],V=Object.keys(L[U]),H=V.length;H--;){var q=V[H],ie=L[U][q],Z=F[U][q];B.push({x:U,y:q,value:ie,radius:Z})}return{min:T,max:D,data:B}};function Q(M){var B=M.container,T=this.shadowCanvas=document.createElement("canvas"),D=this.canvas=M.canvas||document.createElement("canvas"),F=this._renderBoundaries=[1e4,1e4,0,0],L=getComputedStyle(M.container)||{};D.className="heatmap-canvas",this._width=D.width=T.width=M.width||+L.width.replace(/px/,""),this._height=D.height=T.height=M.height||+L.height.replace(/px/,""),this.shadowCtx=T.getContext("2d"),this.ctx=D.getContext("2d"),D.style.cssText=T.style.cssText="position:absolute;left:0;top:0;",B.style.position="relative",B.appendChild(D),this._palette=E(M),this._templates={},this._setStyles(M)}return Q.prototype={renderPartial:function(M){M.data.length>0&&(this._drawAlpha(M),this._colorize())},renderAll:function(M){this._clear(),M.data.length>0&&(this._drawAlpha(w(M)),this._colorize())},_updateGradient:function(M){this._palette=E(M)},updateConfig:function(M){M.gradient&&this._updateGradient(M),this._setStyles(M)},setDimensions:function(M,B){this._width=M,this._height=B,this.canvas.width=this.shadowCanvas.width=M,this.canvas.height=this.shadowCanvas.height=B},_clear:function(){this.shadowCtx.clearRect(0,0,this._width,this._height),this.ctx.clearRect(0,0,this._width,this._height)},_setStyles:function(M){this._blur=M.blur==0?0:M.blur||M.defaultBlur,M.backgroundColor&&(this.canvas.style.backgroundColor=M.backgroundColor),this._width=this.canvas.width=this.shadowCanvas.width=M.width||this._width,this._height=this.canvas.height=this.shadowCanvas.height=M.height||this._height,this._opacity=(M.opacity||0)*255,this._maxOpacity=(M.maxOpacity||M.defaultMaxOpacity)*255,this._minOpacity=(M.minOpacity||M.defaultMinOpacity)*255,this._useGradientOpacity=!!M.useGradientOpacity},_drawAlpha:function(D){for(var B=this._min=D.min,T=this._max=D.max,D=D.data||[],F=D.length,L=1-this._blur;F--;){var R=D[F],k=R.x,U=R.y,V=R.radius,H=Math.min(R.value,T),q=k-V,ie=U-V,Z=this.shadowCtx,oe;this._templates[V]?oe=this._templates[V]:this._templates[V]=oe=I(V,L);var ne=(H-B)/(T-B);Z.globalAlpha=ne<.01?.01:ne,Z.drawImage(oe,q,ie),q<this._renderBoundaries[0]&&(this._renderBoundaries[0]=q),ie<this._renderBoundaries[1]&&(this._renderBoundaries[1]=ie),q+2*V>this._renderBoundaries[2]&&(this._renderBoundaries[2]=q+2*V),ie+2*V>this._renderBoundaries[3]&&(this._renderBoundaries[3]=ie+2*V)}},_colorize:function(){var M=this._renderBoundaries[0],B=this._renderBoundaries[1],T=this._renderBoundaries[2]-M,D=this._renderBoundaries[3]-B,F=this._width,L=this._height,R=this._opacity,k=this._maxOpacity,U=this._minOpacity,V=this._useGradientOpacity;M<0&&(M=0),B<0&&(B=0),M+T>F&&(T=F-M),B+D>L&&(D=L-B);for(var H=this.shadowCtx.getImageData(M,B,T,D),q=H.data,ie=q.length,Z=this._palette,oe=3;oe<ie;oe+=4){var ne=q[oe],se=ne*4;if(!!se){var ce;R>0?ce=R:ne<k?ne<U?ce=U:ce=ne:ce=k,q[oe-3]=Z[se],q[oe-2]=Z[se+1],q[oe-1]=Z[se+2],q[oe]=V?Z[se+3]:ce}}H.data=q,this.ctx.putImageData(H,M,B),this._renderBoundaries=[1e3,1e3,0,0]},getValueAt:function(M){var B,T=this.shadowCtx,D=T.getImageData(M.x,M.y,1,1),F=D.data[3],L=this._max,R=this._min;return B=Math.abs(L-R)*(F/255)>>0,B},getDataURL:function(){return this.canvas.toDataURL()}},Q}(),m=function(){var E=!1;return o.defaultRenderer==="canvas2d"&&(E=f),E}(),C={merge:function(){for(var v={},E=arguments.length,I=0;I<E;I++){var w=arguments[I];for(var Q in w)v[Q]=w[Q]}return v}},y=function(){var E=function(){function M(){this.cStore={}}return M.prototype={on:function(B,T,D){var F=this.cStore;F[B]||(F[B]=[]),F[B].push(function(L){return T.call(D,L)})},emit:function(B,T){var D=this.cStore;if(D[B])for(var F=D[B].length,L=0;L<F;L++){var R=D[B][L];R(T)}}},M}(),I=function(Q){var M=Q._renderer,B=Q._coordinator,T=Q._store;B.on("renderpartial",M.renderPartial,M),B.on("renderall",M.renderAll,M),B.on("extremachange",function(D){Q._config.onExtremaChange&&Q._config.onExtremaChange({min:D.min,max:D.max,gradient:Q._config.gradient||Q._config.defaultGradient})}),T.setCoordinator(B)};function w(){var Q=this._config=C.merge(o,arguments[0]||{});if(this._coordinator=new E,Q.plugin){var M=Q.plugin;if(o.plugins[M]){var B=o.plugins[M];this._renderer=new B.renderer(Q),this._store=new B.store(Q)}else throw new Error("Plugin '"+M+"' not found. Maybe it was not registered.")}else this._renderer=new m(Q),this._store=new A(Q);I(this)}return w.prototype={addData:function(){return this._store.addData.apply(this._store,arguments),this},removeData:function(){return this._store.removeData&&this._store.removeData.apply(this._store,arguments),this},setData:function(){return this._store.setData.apply(this._store,arguments),this},setDataMax:function(){return this._store.setDataMax.apply(this._store,arguments),this},setDataMin:function(){return this._store.setDataMin.apply(this._store,arguments),this},configure:function(Q){return this._config=C.merge(this._config,Q),this._renderer.updateConfig(this._config),this._coordinator.emit("renderall",this._store._getInternalData()),this},repaint:function(){return this._coordinator.emit("renderall",this._store._getInternalData()),this},getData:function(){return this._store.getData()},getDataURL:function(){return this._renderer.getDataURL()},getValueAt:function(Q){return this._store.getValueAt?this._store.getValueAt(Q):this._renderer.getValueAt?this._renderer.getValueAt(Q):null}},w}(),x={create:function(v){return new y(v)},register:function(v,E){o.plugins[v]=E}};return x})});var Hki={};sde(Hki,{Analysis:()=>Fle,BaseObject:()=>c0,Billboard:()=>Pse,Box:()=>Kse,BwMode:()=>fse,Camera:()=>Wae,Cesium:()=>z2e,ClusterLayer:()=>qut,ColorAdjustment:()=>dse,Core:()=>oct,Cylinder:()=>Jse,Degrees:()=>Xut,DoubleClickObjectTool:()=>rse,DoubleScreen:()=>ect,DynamicEyeOffset:()=>oPi,EarthCtrl:()=>e0t,Edit:()=>vle,EditTool:()=>use,ElevationTool:()=>tct,Ellipse:()=>$se,Ellipsoid:()=>jse,Environment:()=>pse,EventHandler:()=>SN,Explosion:()=>bse,FeatureLayer:()=>ule,Fire:()=>Ise,Fireworks:()=>Sse,FisheyeVideoProjection:()=>xse,Fog:()=>cse,Hawkeye:()=>fle,HorizontalDistanceTool:()=>Zae,HoverObjectTool:()=>ise,ImageryLayer:()=>rle,Label:()=>Nse,LineOfSightTool:()=>i0t,Measure:()=>ase,MeasureAreaTool:()=>kH,MeasureHeightTool:()=>qae,MeasureLineLengthTool:()=>jae,MeasurePathLengthTool:()=>DW,MeasureSlopeTool:()=>Xae,MeasureSurfaceAreaTool:()=>$ae,MilitaryPlotting:()=>nue,Model:()=>Lse,ModelClipping:()=>Dle,ModelEdit:()=>RH,ModelLayer:()=>sle,NightMode:()=>gse,Node:()=>UO,ObjectFactory:()=>D2,PerspectiveVideoProjection:()=>yse,PickObjectTool:()=>ese,PickPositionTool:()=>tse,Point:()=>Vse,Polygon:()=>Gse,Polyline:()=>Ose,PolylineVolume:()=>tle,Profile:()=>Ble,RClickObjectTool:()=>nse,RadarScan:()=>Tse,Rain:()=>Ase,Rectangle:()=>Xse,RestrictHeight:()=>Sle,SampleRenderedDataFlags:()=>nPi,Scene:()=>xle,SceneManager:()=>t0t,SelectSet:()=>Cse,Skyline:()=>ble,Smoke:()=>Bse,Snow:()=>hse,SpatialObject:()=>Qc,SpatialTransform:()=>Vae,SpotLight:()=>ple,Submergence:()=>_le,TerrainExcavation:()=>Rle,TerrainLayer:()=>ole,TerrainModifier:()=>Tle,Tool:()=>ja,ToolManager:()=>Jae,VERSIONINFO:()=>I5e,VideoProjection:()=>r0t,ViewShed:()=>Ele,Volumetric:()=>Ile,WFSTool:()=>jut,Waters:()=>dle,WorkChart:()=>Ale,ZBiasGeometryInstanceAttribute:()=>rPi,czmlPathAnimation:()=>ETe,loadArrayBuffer:()=>hPi,loadBlob:()=>APi,loadImage:()=>dPi,loadJson:()=>cPi,loadLayui:()=>ITe,loadText:()=>uPi,sampleRenderedData:()=>aPi,sampleRenderedMesh:()=>sPi,sampleRenderedTerrain:()=>lPi,viewerNavigationCubeMixin:()=>s0t});module.exports=$_t(Hki);var x5e="WebSDK v3.2.4-12",v5e="Cesium v1.99",E5e="2023.12.1",eBt="SmartEarth",tBt={VERSION:x5e,CesiumVERSION:v5e,CompileTime:E5e},iBt=typeof window<"u"?window:typeof self<"u"?self:{};iBt.logSmartEarth=()=>{let o=`
%c${eBt}
%c
\u7248 \u672C \u53F7\uFF1A${x5e}    ${v5e}
@@ -16835,7 +16835,7 @@
gl_FragColor = mix(gl_FragColor, u_floodColor, 0.3);
}
}
`}Object.defineProperties(dAt.prototype,{parameter:{get:function(){return this._parameter}},show:{get:function(){return this._pps!==null},set:function(o){o?ELi(this):ILi(this)}},maxHeight:{get:function(){return this._maxHeight},set:function(o){this._maxHeight=o}},minHeight:{get:function(){return this._minHeight},set:function(o){this._minHeight=o}}});var zO=dAt;function xy(o,A){this._earthCtrl=o,this._coreMap=o.coreMap,this._minHeight=Ae(A.minHeight,0),this._maxHeight=Ae(A.maxHeight,0),this._extrudedHeight=Ae(A.extrudedHeight,0),this.shapeTool=void 0,this._speed=Ae(A.speed,1),this._baseWaterColor=Ae(A.baseWaterColor,new At(.2,.3,.6,.5)),this._waterFrequency=Ae(A.waterFrequency,1e3),this._animationSpeed=Ae(A.animationSpeed,.01),this._amplitude=Ae(A.amplitude,10),this._isPolygon=Ae(A.isPolygon,!0),this.eventHelper=new Mx,this._nowHeight=null,this._height=Ae(A.height,void 0),this._type=Ae(A.type,"up")}xy.prototype.drawPolygon=function(o){let A=this;this.shapeTool=A._earthCtrl.shapeTool.createDrawShapeTool(function(f){A.setPolygon({positions:f.result}),o&&o(A)})};xy.prototype.setPolygon=function(o){this.positions=o.positions;let A=this,f=A.computePolygonHeightRange(this.positions);A._minHeight=f.minHeight,A._maxHeight=f.maxHeight,A._extrudedHeight=A._minHeight};xy.prototype.computePolygonHeightRange=function(o){let A=[],f=this._earthCtrl.coreMap;for(let D=0;D<o.length;D++)A.push(o[D].clone());let m,C,y,x,v,E,I,w=0,Q=9999,M=Math.PI/Math.pow(2,11)/64,B=new rh.fromPositions({positions:A,vertexFormat:za.FLAT_VERTEX_FORMAT,granularity:M}),T=new rh.createGeometry(B);for(let D=0;D<T.indices.length;D+=3)m=T.indices[D],C=T.indices[D+1],y=T.indices[D+2],I=new ee(T.attributes.position.values[3*m],T.attributes.position.values[3*m+1],T.attributes.position.values[3*m+2]),(x=f.scene.globe.getHeight(Kt.fromCartesian(I)))<Q&&(Q=x),w<x&&(w=x),I=new ee(T.attributes.position.values[3*C],T.attributes.position.values[3*C+1],T.attributes.position.values[3*C+2]),(v=f.scene.globe.getHeight(Kt.fromCartesian(I)))<Q&&(Q=v),w<v&&(w=v),I=new ee(T.attributes.position.values[3*y],T.attributes.position.values[3*y+1],T.attributes.position.values[3*y+2]),(E=f.scene.globe.getHeight(Kt.fromCartesian(I)))<Q&&(Q=E),w<E&&(w=E);return{maxHeight:w,minHeight:Q}};xy.prototype.removeFromMap=function(){this._isPolygon?O(this.primitive)&&(this.removePrimitive(),this._extrudedHeight=this.minHeight,this.primitive=null):O(this.flood)&&(this.flood.show=!1),this.eventHelper&&this.eventHelper.removeAll(),this.shapeTool&&this.shapeTool.removeFromMap()};xy.prototype._onTick=function(){let o=this;o._type==="up"?o._extrudedHeight>=o._maxHeight?(o._extrudedHeight=o._maxHeight,o._nowHeight=o._extrudedHeight,o.eventHelper.removeAll()):(o._isPolygon?o.removePrimitive():O(o.flood)||(o.flood=new zO(o._earthCtrl,{minHeight:o.minHeight,maxHeight:o._extrudedHeight,positions:o.positions}),o.flood.show=!0),o._extrudedHeight+=o._speed,o._isPolygon?o.addPrimitive():o.flood.maxHeight=o._extrudedHeight):o._type==="down"&&(o._extrudedHeight<=o._minHeight?(o._extrudedHeight=o._minHeight,o._nowHeight=o._extrudedHeight,o.eventHelper.removeAll()):(o._isPolygon?o.removePrimitive():O(o.flood)||(o.flood=new zO(o._earthCtrl,{minHeight:o.minHeight,maxHeight:o._extrudedHeight,positions:o.positions}),o.flood.show=!0),o._extrudedHeight-=o._speed,o._isPolygon?o.addPrimitive():o.flood.maxHeight=o._extrudedHeight))};xy.prototype._onTickNext=function(){let o=this;o._nowHeight?o._type==="up"?o._extrudedHeight>=o._nowHeight+o._height?(o._extrudedHeight=o._nowHeight+o._height,o._nowHeight=o._extrudedHeight,o.eventHelper.removeAll()):(o._isPolygon?o.removePrimitive():O(o.flood)||(o.flood=new zO(o._earthCtrl,{minHeight:o.minHeight,maxHeight:o._extrudedHeight,positions:o.positions}),o.flood.show=!0),o._extrudedHeight+=o._speed,o._isPolygon?o.addPrimitive():o.flood.maxHeight=o._extrudedHeight):o._type==="down"&&(o._extrudedHeight<=o._nowHeight-o._height?(o._extrudedHeight=o._nowHeight-o._height,o._nowHeight=o._extrudedHeight,o.eventHelper.removeAll()):(o._isPolygon?o.removePrimitive():O(o.flood)||(o.flood=new zO(o._earthCtrl,{minHeight:o.minHeight,maxHeight:o._extrudedHeight,positions:o.positions}),o.flood.show=!0),o._extrudedHeight-=o._speed,o._isPolygon?o.addPrimitive():o.flood.maxHeight=o._extrudedHeight)):o._type==="up"?o._extrudedHeight>=o._minHeight+o._height?(o._extrudedHeight=o._minHeight+o._height,o._nowHeight=o._extrudedHeight,o.eventHelper.removeAll()):(o._isPolygon?o.removePrimitive():O(o.flood)||(o.flood=new zO(o._earthCtrl,{minHeight:o.minHeight,maxHeight:o._extrudedHeight,positions:o.positions}),o.flood.show=!0),o._extrudedHeight+=o._speed,o._isPolygon?o.addPrimitive():o.flood.maxHeight=o._extrudedHeight):o._type==="down"&&(o._extrudedHeight<=o._maxHeight-o._height?(o._extrudedHeight=o._maxHeight-o._height,o._nowHeight=o._extrudedHeight,o.eventHelper.removeAll()):(o._isPolygon?o.removePrimitive():O(o.flood)||(o.flood=new zO(o._earthCtrl,{minHeight:o.minHeight,maxHeight:o._extrudedHeight,positions:o.positions}),o.flood.show=!0),o._extrudedHeight-=o._speed,o._isPolygon?o.addPrimitive():o.flood.maxHeight=o._extrudedHeight))};xy.prototype.removePrimitive=function(){O(this.primitive)&&this._earthCtrl.primitives.remove(this.primitive)};xy.prototype.polygonAnalysis=function(){let o=this;O(o.shapeTool)&&(o.shapeTool.removeFromMap(),o.shapeTool=void 0),o._height?o.eventHelper.add(o._earthCtrl.coreMap.clock.onTick,xy.prototype._onTickNext,this):o.eventHelper.add(o._earthCtrl.coreMap.clock.onTick,xy.prototype._onTick,this);let A={};A.normalMap=`${globalThis.GEOWORLD_BASE_URL}Assets/Images/waterNormals.jpg`,A.baseWaterColor=o.baseWaterColor,A.frequency=o.waterFrequency,A.animationSpeed=o.animationSpeed,A.amplitude=o.amplitude;let f=new ss({fabric:{type:"Water",uniforms:A}});f.update(o._earthCtrl.coreMap.scene.context),o.primitiveAppearance=new MY({material:f,fragmentShaderSource:PY})};xy.prototype.postAnalysis=function(){let o=this;O(o.shapeTool)&&(o.shapeTool.removeFromMap(),o.shapeTool=void 0),o._height?o.eventHelper.add(o._earthCtrl.coreMap.clock.onTick,xy.prototype._onTickNext,this):o.eventHelper.add(o._earthCtrl.coreMap.clock.onTick,xy.prototype._onTick,this)};xy.prototype.addPrimitive=function(){let o=this;o.primitive=o._earthCtrl.primitives.add(new $a({geometryInstances:new co({geometry:rh.fromPositions({positions:o.positions,extrudedHeight:o._extrudedHeight})}),asynchronous:!1,appearance:o.primitiveAppearance}))};xy.prototype.startAnalysis=function(){let o=this;setTimeout(()=>{o._isPolygon?o.polygonAnalysis():o.postAnalysis()},100)};Object.defineProperties(xy.prototype,{isPolygon:{get:function(){return this._isPolygon}},minHeight:{set:function(o){this._minHeight=o},get:function(){return this._minHeight}},maxHeight:{set:function(o){this._maxHeight=o},get:function(){return this._maxHeight}},speed:{set:function(o){this._speed=o},get:function(){return this._speed}},baseWaterColor:{set:function(o){this._baseWaterColor=o},get:function(){return this._baseWaterColor}},waterFrequency:{set:function(o){this._waterFrequency=o},get:function(){return this._waterFrequency}},animationSpeed:{set:function(o){this._animationSpeed=o},get:function(){return this._animationSpeed}},amplitude:{set:function(o){this._amplitude=o},get:function(){return this._amplitude}},height:{set:function(o){this._height=o,this.postAnalysis()},get:function(){return this._height}},type:{set:function(o){this._type=o},get:function(){return this._type}}});var _le=xy;function KO(o,A){this._earthCtrl=o,this._coreMap=o.coreMap,this.shapeTool=void 0,this.positions=void 0,this.echarts=void 0,this.mCallback=Ae(A.callback,void 0),this.defaultChart=Ae(A.defaultChart,!0),this.step=Ae(A.step,20),this.image=A.image,this.echarstView=A.echartsView,this.echartsParentView=A.echartsParentView,this.billboard=void 0,this.minHeight=0,this.maxHeight=0,this.profile={arrHB:[],arrPoint:[],arrLX:[],points:[],distance:0}}KO.prototype.drawPolyLine=function(){let o=this;this.shapeTool=o._earthCtrl.shapeTool.createDrawShapeTool(function(A){o.setPolyline({positions:A.result})},"polyline")};KO.prototype.setPolyline=function(o){this.positions=o.positions};KO.prototype.startAnalysis=function(){if(!this.positions)return console.info("\u8BF7\u5148\u7ED8\u5236\u5256\u9762\u7EBF\uFF01");if(this.positions.length>1){this.profile.arrLX.push(0);for(let A=0;A<this.positions.length-1;A++){let f=this.positions[A],m=this.positions[A+1];this.profile2PointAnalysis(f,m)}this.processHeight();let o=this.profile;this.defaultChart&&wLi(this,o),O(this.mCallback)&&this.mCallback(o),this.positions=void 0}};KO.prototype.processHeight=function(){let o=this;if(!(o.profile.arrHB.length<=0)){o.minHeight=o.maxHeight=o.profile.arrHB[0];for(let A=1;A<o.profile.arrHB.length;A++){let f=o.profile.arrHB[A];f>o.maxHeight?o.maxHeight=f:f<o.minHeight&&(o.minHeight=f)}o.minHeight=parseInt(o.minHeight/100)*100;for(let A=0;A<o.profile.arrHB.length;A++){let f=o.profile.arrHB[A];o.profile.arrHB[A]=f-o.minHeight}}};var BLi=new ee;KO.prototype.profile2PointAnalysis=function(o,A){let f=this,m=ee.distance(o,A),C=parseInt(m/f.step),y=Kt.fromCartesian(o),x=Kt.fromCartesian(A);f.positions.length>2&&f.profile.arrLX.length>1&&f.profile.arrLX.push(f.profile.arrLX[f.profile.arrLX.length-1]+aMe(f.profile.points[f.profile.points.length-1],y)),f.profile.points.push(y),f.profile.arrPoint.push(oMe(o)),f.profile.arrHB.push(y.height);let v=f.profile.arrLX.length-1;console.info(v);for(let E=1;E<C;E++){let I=ee.lerp(o,A,E/C,BLi),w=Kt.fromCartesian(I),Q=f._coreMap.scene.globe.getHeight(w);w.height=Q;let M=aMe(f.profile.points[v+E-1],w);f.profile.distance=f.profile.distance+M,f.profile.points.push(w),f.profile.arrLX.push(f.profile.arrLX[v+E-1]+M),f.profile.arrPoint.push(oMe(I)),f.profile.arrHB.push(Q)}return f.profile.points.push(x),f.profile.arrLX.push(f.profile.arrLX[f.profile.arrLX.length-1]+aMe(f.profile.points[f.profile.points.length-1],x)),f.profile.arrPoint.push(oMe(A)),f.profile.arrHB.push(x.height),f.profile};function mAt(o,A){let f=document.getElementById(o);f.style.display=A?"block":"none"}var fAt;function wLi(o,A){if(A!==null&&A.arrPoint!==null){mAt(o.echartsParentView,!0),O(o.echarts)||(o.echarts=Nb.init(document.getElementById(o.echarstView),"dark"));let f=A.arrPoint,m={grid:{left:10,right:10,bottom:10,containLabel:!0},dataZoom:[{type:"inside",throttle:50}],tooltip:{trigger:"axis",formatter:function(C){let y="";if(C.length===0)return y;let x=f[C[0].dataIndex],v=C[0].value+o.minHeight;return fAt=new ee.fromDegrees(x.x,x.y,v),O(o.billboard)||(o.billboard=o._earthCtrl.entities.add({name:"profile_billboard",position:new Bn(function(){return fAt},!1),billboard:{verticalOrigin:bn.BOTTOM,image:o.image,iconWidth:8,iconHeight:8,scale:.5}})),o.billboard.show||(o.billboard.show=!0),y+=`\u6240\u5728\u4F4D\u7F6E&nbsp;${pAt(x.x)},${pAt(x.y)}<br />\u8DDD\u8D77\u70B9&nbsp;<label>${gAt(C[0].axisValue)}</label><br />${C[0].seriesName}&nbsp;<label style='color:${C[0].color};'>${gAt(v)}</label><br />`}},xAxis:[{name:"\u884C\u7A0B",type:"category",boundaryGap:!1,axisLine:{show:!1},axisLabel:{show:!1},data:A.arrLX}],yAxis:[{type:"value",axisLabel:{formatter:function(C){return`${C+o.minHeight}\u7C73`}}}],series:[{name:"\u9AD8\u7A0B\u503C",type:"line",smooth:!0,symbol:"none",sampling:"average",itemStyle:{normal:{color:"rgb(255, 70, 131)"}},areaStyle:{normal:{color:new Nb.graphic.LinearGradient(0,0,0,1,[{offset:0,color:"rgb(255, 158, 68)"},{offset:1,color:"rgb(255, 70, 131)"}])}},data:A.arrHB}]};o.echarts.setOption(m)}}function gAt(o,A){if(o===null)return"";o=Number(o),(A===null||A==="auto")&&(o<1e3?A="m":A="km");let f="";switch(A){default:case"m":f=`${o.toFixed(2)}\u7C73`;break;case"km":f=`${(o*.001).toFixed(2)}\u516C\u91CC`;break;case"mile":f=`${(o*54e-5).toFixed(2)}\u6D77\u91CC`;break;case"zhang":f=`${(o*.3).toFixed(2)}\u4E08`;break}return f}function pAt(o){let A=o.toString();return A.slice(0,A.indexOf(".")+3)}function oMe(o){let A=Kt.fromCartesian(o),f=je.toDegrees(A.longitude),m=je.toDegrees(A.latitude),C=A.height;return{x:f,y:m,z:C}}function aMe(o,A){let f=new l0;f.setEndPoints(o,A);let m=f.surfaceDistance;return m=Math.sqrt(Math.pow(m,2)+Math.pow(A.height-o.height,2)),m}KO.prototype.removeFromMap=function(){let o=this;O(o.shapeTool)&&(o.shapeTool.removeFromMap(),o.shapeTool=void 0),O(o.billboard)&&(o._earthCtrl.entities.remove(o.billboard),o.billboard=void 0),mAt(o.echartsParentView,!1)};var Ble=KO;function wle(o,A){this._earthCtrl=o,this._coreMap=o.coreMap,this._skylineColor=Ae(A.color,At.RED.withAlpha(1)),this._postProccessStage=null,this._postProcessStages=this._coreMap.scene.postProcessStages,this._width=Ae(A.width,1),this._edgeDetection=bv.createEdgeDetectionStage({width:this._width||1}),this.addToMap()}wle.prototype.addToMap=function(){this.removeFromMap();let o=new va({name:"czm_skylinetemp",fragmentShader:"uniform sampler2D colorTexture;uniform sampler2D depthTexture;varying vec2 v_textureCoordinates;void main(void){float depth = czm_readDepth(depthTexture, v_textureCoordinates);vec4 color = texture2D(colorTexture, v_textureCoordinates);if(depth<1.0 - 0.000001){gl_FragColor = color;}else{gl_FragColor = vec4(1.0,0.0,0.0,1.0);}}"}),A=new va({name:"czm_skylinetemp1",fragmentShader:"uniform sampler2D colorTexture;uniform sampler2D redTexture;uniform sampler2D silhouetteTexture;uniform vec4 skylineColor;varying vec2 v_textureCoordinates;void main(void){vec4 redcolor=texture2D(redTexture, v_textureCoordinates);vec4 silhouetteColor = texture2D(silhouetteTexture, v_textureCoordinates);vec4 color = texture2D(colorTexture, v_textureCoordinates);if(redcolor.r == 1.0){gl_FragColor = mix(color, skylineColor, silhouetteColor.a);}else{gl_FragColor = color;}}",uniforms:{redTexture:o.name,silhouetteTexture:this._edgeDetection.name,skylineColor:this._skylineColor}});this._postProccessStage=new CC({name:"czm_skyline",stages:[this._edgeDetection,o,A],inputPreviousStageTexture:!1,uniforms:this._edgeDetection.uniforms}),this._postProcessStages.add(this._postProccessStage)};wle.prototype.removeFromMap=function(){this._postProccessStage&&(this._earthCtrl.coreMap.scene.postProcessStages.remove(this._postProccessStage),this._postProccessStage=null)};Object.defineProperties(wle.prototype,{});var ble=wle;function Qle(o,A){this._earthCtrl=o,this._coreMap=o.coreMap,this.leftIndex=void 0,this.rightIndex=void 0,this.addToMap(A.leftIndex,A.rightIndex)}var YO={dragStartX:0,_scene:void 0};Qle.prototype.addToMap=function(o,A){document.getElementById("slider")&&this.clear();let m=this._coreMap.imageryLayers,C=this._coreMap.scene;YO._scene=C;let y=this._coreMap.container,x=document.createElement("div");x.id="slider",x.style.position="absolute",x.style.cursor="e-resize",x.style.top=0,x.style.backgroundColor="#D3D3D3",x.style.width="8px",x.style.height="100%",x.style.zIndex="1000",y.appendChild(x);let v=m.get(o),E=m.get(A);this.leftIndex=o,this.rightIndex=A,v.splitDirection=uI.LEFT,E.splitDirection=uI.RIGHT;let I=document.getElementById("slider");C.splitPosition=I.offsetLeft/I.parentElement.offsetWidth,I.addEventListener("mousedown",yAt,!1),window.addEventListener("mouseup",CAt,!1),I.style.left="50%",YO._scene.splitPosition=.5};function CAt(){window.removeEventListener("mousemove",sMe,!1)}function yAt(o){let A=document.getElementById("slider");YO.dragStartX=o.clientX-A.offsetLeft,window.addEventListener("mousemove",sMe,!1)}function sMe(o){let A=document.getElementById("slider"),f=(o.clientX-YO.dragStartX)/A.parentElement.offsetWidth;A.style.left=`${100*f}%`,YO._scene.splitPosition=f}Qle.prototype.removeFromMap=function(){let o=document.getElementById("slider");if(o){YO._scene.splitPosition="0%",o.removeEventListener("mousedown",yAt,!1),window.removeEventListener("mouseup",CAt,!1),window.removeEventListener("mousemove",sMe,!1),o.remove();let A=this._coreMap.imageryLayers,f=A.get(this.leftIndex),m=A.get(this.rightIndex);f.splitDirection=uI.NONE,m.splitDirection=uI.NONE,YO._scene=void 0}};Object.defineProperties(Qle.prototype,{});var xAt=Qle;function kW(o,A){this._earthCtrl=o,this._coreMap=o.coreMap,this.color=Ae(A.color,At.RED.withAlpha(.5)),this.positions=A.positions,this.baseHeight=Ae(A.baseHeight,0),this._height=Ae(A.height,0),this.extrudedHeight=Ae(A.extrudedHeight,1e4),this.limitHeightPrimitive=null,this.addToMap()}kW.prototype.addToMap=function(){if(this.removeFromMap(),!this.positions)return;let o=ee.fromDegreesArray(this.positions),A=new co({geometry:new rh({polygonHierarchy:new Un(o),height:this.baseHeight,extrudedHeight:this.baseHeight+this.extrudedHeight}),attributes:{color:Yo.fromColor(this.color)}});this.limitHeightPrimitive=this._coreMap.scene.primitives.add(new s6({geometryInstances:A,releaseGeometryInstances:!1,classificationType:Gu.CESIUM_3D_TILE}))};kW.prototype.changeHeight=function(o){!this.limitHeightPrimitive||(console.log("?!?!?!",this.limitHeightPrimitive),this.limitHeightPrimitive.readyPromise.then(A=>{let f=Kt.fromCartesian(this.limitHeightPrimitive._primitive._boundingSpheres[0].center);console.log("???",f);let m=ee.fromRadians(f.longitude,f.latitude,this.baseHeight),C=ee.fromRadians(f.longitude,f.latitude,this.baseHeight+o),y=ee.subtract(C,m,new ee);console.log("!!!!",this.limitHeightPrimitive._primitive.modelMatrix),this.limitHeightPrimitive._primitive.modelMatrix=Xe.setTranslation(Xe.IDENTITY,y,new Xe),this.baseHeight=this.baseHeight+o}))};kW.prototype.removeFromMap=function(){this.limitHeightPrimitive&&(this._coreMap.scene.primitives.remove(this.limitHeightPrimitive),this.limitHeightPrimitive=void 0)};Object.defineProperties(kW.prototype,{});var Sle=kW;function vAt(o){this._earthCtrl=o}vAt.prototype.toDegrees=function(o){let A=Kt.fromCartesian(o);return{lon:je.toDegrees(A.longitude),lat:je.toDegrees(A.latitude),height:A.height}};var EAt=vAt;function JO(o){this._viewer=o.coreMap,this._trans=new EAt}JO.prototype.addClipping=function(o,A={}){if(this.remove(),A.type==="polygon"){let f=A.positions,m=[];f.forEach(v=>{m.push(this._trans.toDegrees(v))}),m.push(m[0]);let C;A.isInner?C=this.isClockWise(m):C=!this.isClockWise(m),C&&m.reverse();let y=[],x=this.getInverseTransform(o);for(let v=0;v<m.length-1;v++){let E=this.createPlane(m[v],m[v+1],x);y.push(E)}o.clippingPlanes=new rB({planes:y,unionClippingRegions:!A.isInner})}return this.item=o,this};JO.prototype.getInverseTransform=function(o){let A,f=o.root.transform;return f&&f.equals(Xe.IDENTITY)||!f?A=Vn.eastNorthUpToFixedFrame(o.boundingSphere.center):A=Xe.fromArray(o.root.transform),Xe.inverseTransformation(A,new Xe)};JO.prototype.getOriginCoordinateSystemPoint=function(o,A){let f=ee.fromDegrees(o.lon,o.lat);return Xe.multiplyByPoint(A,f,new ee(0,0,0))};JO.prototype.createPlane=function(o,A,f){let m=this.getOriginCoordinateSystemPoint(o,f),C=this.getOriginCoordinateSystemPoint(A,f),y=new ee(0,0,1),x=ee.subtract(C,m,new ee),v=ee.cross(x,y,new ee);v=ee.normalize(v,v);let E=Wa.fromPointNormal(m,v);return kM.fromPlane(E)};JO.prototype.isClockWise=function(o){if(o.length<3)return null;o[0]===o[o.length-1]&&(o=o.slice(0,o.length-1));let A={i:-1,val:90};for(let E=0;E<o.length;E++){let{lat:I}=o[E];I<A.val&&(A.val=I,A.i=E)}let f=(A.i+o.length-1)%o.length,m=A.i,C=(A.i+1)%o.length,y={lat:o[m].lat-o[f].lat,lon:o[m].lon-o[f].lon},x={lat:o[C].lat-o[m].lat,lon:o[C].lon-o[m].lon},v=x.lon*y.lat-y.lon*x.lat;return v===0?o[C].lon<o[f].lon:v>0};JO.prototype.remove=function(){this.item&&this.item.clippingPlanes&&this.item.clippingPlanes.removeAll(),this.item&&(this.item.clippingPlanes=void 0)};var Dle=JO;var lMe;function uMe(o,A){this._viewer=o.coreMap,lMe=o.coreMap,this.createTerrainModifier(A.name,A.polygon,A.altitude)}uMe.prototype.findDirectParent=function(o){try{let A=[];if(o.width===Math.PI)return null;for(let f=0;f<lMe.scene.globe._surface._tilesToRender.length;f++){let m=lMe.scene.globe._surface._tilesToRender[f],C=m._rectangle;Si.intersection(C,o)&&A.push(m)}return A}catch(A){console.log(A)}return null};uMe.prototype.createTerrainModifier=function(o,A,f){let m=A.length,C=new Array(m);C.fill(f);let y=Vu(),x=Date.now(),v=Si.fromCartesianArray(A),E=this.findDirectParent(v);this._viewer.terrainProvider&&this._viewer.terrainProvider._modifyTerrainObjects===void 0&&(this._viewer.terrainProvider._modifyTerrainObjects=[]);let I=this._viewer,w={id:y,name:o,show:!0,rectangle:v,vertices:A,heights:C,timeStamp:x,remove:function(){if(I.terrainProvider&&I.terrainProvider._modifyTerrainObjects)for(let Q=I.terrainProvider._modifyTerrainObjects.length-1;Q>=0;Q--)I.terrainProvider._modifyTerrainObjects[Q].id===y&&I.terrainProvider._modifyTerrainObjects.splice(Q,1);if(E)try{for(let Q=0;Q<E.length;Q++)try{E[Q]._parent.freeResources()}catch(M){console.log(M)}}catch(Q){console.log(Q)}}};if(this._viewer.terrainProvider._modifyTerrainObjects.push(w),E)try{for(let Q=0;Q<E.length;Q++)try{E[Q]._parent.freeResources()}catch(M){console.log(M)}}catch(Q){console.log(Q)}return w};var Tle=uMe;var YH;function cMe(o){this._earthCtrl=o,this.Viewer=o.coreMap,YH=o.coreMap}cMe.prototype.CreateTooltip=function(o={},A,f){let m,C,y,x,v;typeof o=="object"&&(m=o),m&&m.origin?(m.origin==="center"&&(C=15,y=-12),m.origin==="top"&&(C=15,y=-44),m.origin==="bottom"&&(C=15,y=20)):(C=15,y=20),m&&m.color?(m.color==="white"&&(x="background: rgba(255, 255, 255, 0.8);color: black;"),m.color==="black"&&(x="background: rgba(0, 0, 0, 0.5);color: white;"),m.color==="yellow"&&(x="color: black;background-color: #ffcc33;border: 1px solid white;")):x="background: rgba(0, 0, 0, 0.5);color: white;",m&&m.id?v=`toolTip${m.id}`:v="toolTip";let E=document.getElementById(v);if(!E){let I=document.createElement("div");nA(".map-widget",I);let w=`<div id="${v}" style="display: none;pointer-events: none;position: absolute;z-index: 1000;opacity: 0.8;border-radius: 4px;padding: 4px 8px;white-space: nowrap;font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px;${x}"></div>`;nA(".map-widget",w),E=document.getElementById(v)}return f?(E.innerHTML=o,E.style.left=`${A.x+C}px`,E.style.top=`${A.y+y}px`,E.style.display="block"):E.style.display="none",{tooltip:E,style:m,showAt:function(I,w){this.tooltip.innerHTML=w,this.style&&this.style.origin?(this.style.origin==="center"&&(C=15,y=-this.tooltip.offsetHeight/2),this.style.origin==="top"&&(C=15,y=-this.tooltip.offsetHeight-20),this.style.origin==="bottom"&&(C=15,y=20)):(C=15,y=-this.tooltip.offsetHeight/2),this.tooltip.style.left=`${I.x+C}px`,this.tooltip.style.top=`${I.y+y}px`,this.tooltip.style.display="block"},show:function(I){I?this.tooltip.style.display="block":this.tooltip.style.display="none"}}};cMe.prototype.CreateResultTooltip=function(o={}){let A,f,m,C=o.id?`resultToolTip${o.id}`:"resultToolTip",y=document.getElementById(C);if(o.color?(o.color==="white"&&(m="background: rgba(255, 255, 255, 0.8);color: black;"),o.color==="black"&&(m="background: rgba(0, 0, 0, 0.5);color: white;"),o.color==="blue"&&(m="background: rgba(48, 119, 221);color: white;"),o.color==="yellow"&&(m="color: black;background-color: #ffcc33;border: 1px solid white;")):m="color: black;background-color: #ffcc33;border: 1px solid white;",!y){let Q=`<div id="${C}" class="resultToolTip" style="display: none;pointer-events: none;position: absolute;z-index: 1000;opacity: 0.8;border-radius: 4px;padding: 4px 8px;white-space: nowrap;font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px;${m}"></div>`;nA(".map-widget",Q),y=document.getElementById(C)}let x=o.addX||0,v=o.addY||0,E,I=this;function w(){if(E){if(o.far!==void 0||o.near!==void 0){let M=I.getPointToCameraDistance(YH,E);if(M>o.far){y.style.display="none";return}else if(M<o.near){y.style.display="none";return}y.style.display="block"}let Q=YH.scene.cartesianToCanvasCoordinates(E);if(!Q)return;A=-y.offsetWidth/2+x,f=-y.offsetHeight+v,y.style.left=`${Q.x+A}px`,y.style.top=`${Q.y+f}px`}}return YH.clock.onTick.addEventListener(w),{tooltip:y,position:E,showAt:function(Q,M){if(this.tooltip.innerHTML=M,this.tooltip.style.display="block",this.position=Q,E=Q,E){let B=YH.scene.cartesianToCanvasCoordinates(E);if(!B)return;A=-this.tooltip.offsetWidth/2+x,f=-this.tooltip.offsetHeight+v,this.tooltip.style.left=`${B.x+A}px`,this.tooltip.style.top=`${B.y+f}px`}},show:function(Q){Q?(this.tooltip.style.display="block",E=this.position):(this.tooltip.style.display="none",E=void 0)},destroy(){YH.clock.onTick.removeEventListener(w),y.remove()}}};var gw=cMe;var AMe=class{constructor(){this.minHeight=Number.MAX_VALUE,this.maxHeight=Number.MIN_VALUE,this.cutVolume=0,this.fillVolume=0,this.baseArea=0}},hMe=class{constructor(){this.minHeight=Number.MAX_VALUE,this.maxHeight=Number.MIN_VALUE,this.avgHeight=0,this.baseArea=0}};function Mle(o,A){this._earthCtrl=o,this._viewer=o.coreMap,this.baseHeight=Ae(A.baseHeight,0),this.options=A}Mle.prototype.start=function(){let o=this.options.positions,A=this.options.countBase,f=this.options.basePositions,m=this.options.baseHeight,C=new AMe,y=[];o.forEach(Q=>{let M=Kt.fromCartesian(Q);this.baseHeight=Math.min(M.height,Ae(m,this.baseHeight)),y.push(Ss.wgs84ToWindowCoordinates(this._viewer.scene,Q))});let x=bLi(y),v=Zl.randomPoint(100,{bbox:[x[0],x[1],x[2],x[3]]}),E=QLi(y);Zl.voronoi(v,{bbox:[x[0],x[1],x[2],x[3]]}).features.forEach(Q=>{let M=SLi(E,Q.geometry);if(M.length>0){let B=this.computeCubeInfo(M);this.baseHeight>B.avgHeight?C.fillVolume+=(this.baseHeight-B.avgHeight)*C.baseArea:C.cutVolume+=(B.avgHeight-this.baseHeight)*C.baseArea,C.maxHeight=Math.max(C.maxHeight,B.maxHeight),C.minHeight=Math.min(C.minHeight,B.minHeight),C.baseArea+=B.baseArea}});let w=this.countBaseVolume(A,f,m);return w!==0&&(C.cutVolume+=w,C.fillVolume+=w),C};Mle.prototype.countBaseVolume=function(o,A,f){let m=this;if(o){let C=[],y=[];for(let Q=0;Q<A.length;Q=Q+3){y.push(A[Q+2]);let M=ee.fromDegrees(A[Q],A[Q+1],f),B=Kt.fromCartesian(M);C.push(B)}C.push(C[0]);let x=IAt(C);y.sort(function(Q,M){return Q-M});let v=y[0],E=y[y.length-1];return Number(E-v)*x/2}return 0};Mle.prototype.computeCubeInfo=function(o){let A=this,f=[],m=Number.MAX_VALUE,C=Number.MIN_VALUE,y=0;o.forEach(function(E){let I=A._earthCtrl.coreMap.scene.camera.getPickRay(E),w=A._earthCtrl.coreMap.scene.globe.pick(I,A._earthCtrl.coreMap.scene),Q=Kt.fromCartesian(w);f.push(Q),m=Math.min(m,Q.height),C=Math.max(C,Q.height),y+=Q.height});let x=y/o.length,v=new hMe;return v.minHeight=m,v.maxHeight=C,v.avgHeight=x,v.baseArea=IAt(f),v};function IAt(o){let A=[0],f=[0],m=new l0,C=Math.PI/180;for(let x=0;x<o.length-1;x++){let v=o[x],E=o[x+1];m.setEndPoints(v,E);let I=Math.sqrt(Math.pow(m.surfaceDistance,2)),w=E.latitude*C,Q=E.longitude*C,M=v.latitude*C,B=v.longitude*C,T=-Math.atan2(Math.sin(Q-B)*Math.cos(M),Math.cos(w)*Math.sin(M)-Math.sin(w)*Math.cos(M)*Math.cos(Q-B));T<0&&(T+=Math.PI*2),f.push(Math.sin(T)*I+f[x]),A.push(Math.cos(T)*I+A[x])}let y=0;for(let x=0;x<A.length-1;x++)y+=A[x]*f[x+1]-A[x+1]*f[x];return Math.abs(y+A[A.length-1]*f[0]-A[0]*f[f.length-1])/2}function bLi(o){let A=[],f=Number.MAX_VALUE,m=Number.MIN_VALUE,C=Number.MAX_VALUE,y=Number.MIN_VALUE;return o.forEach(x=>{f=Math.min(f,x.x),m=Math.max(m,x.x),C=Math.min(C,x.y),y=Math.max(y,x.y)}),A.push(f),A.push(C),A.push(m),A.push(y),A}function QLi(o){let A=[[]];return o.forEach(m=>{A[0].push([m.x,m.y])}),A[0].push([o[0].x,o[0].y]),Zl.polygon(A).geometry}function SLi(o,A){let f=Zl.intersect(o,A);return f?.geometry!==void 0?DLi(f?.geometry):[]}function DLi(o){let A=[];return o.coordinates.forEach(function(f){f.forEach(function(m){A.push(new It(m[0],m[1]))})}),A.push(new It(o.coordinates[0][0][0],o.coordinates[0][0][1])),A}var Ple=Mle;function Gx(o,A){this._earthCtrl=o,this._viewer=o.coreMap,this._cesium=_r,this._scene=o.coreMap.scene,this._Tooltip=new gw(o),this.loadingImg=`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`,this.tooltip=this._Tooltip.CreateTooltip(),this.FlattenIsDraw=!1,this.wallArr=[],this.hierarchy=[],this.tophierarchy=[],this.heightsort=[],this.FlattenPolygon=[],this.deepth=100,this.polygon=null,this.editPoint=[],this.nowPoint=null,this.editPosition=[],this.topPositions=null,this._volumeLabel=void 0,this._volumeLabel1=void 0,this._option=Ae(A.option,{}),this._irregularCut=Ae(A.irregularCut,!1),this.terrainFlatten=new IN(o.coreMap.scene),this.CreatePolygon(A.height,A.option,A.callback)}Gx.prototype.CreatePolygon=function(o,A,f){if(this.FlattenIsDraw)return;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=null),this.removeLabel(),this.addLoading(),this.FlattenIsDraw=!0;let m=this._viewer,C=this._cesium;this.deepth=o||this.deepth,this.removeFromMap(),!A&&(A={});let y=[],x=this.hierarchy,v=this.polygon,E,I=null,w=0,Q=this.heightsort,M=this.deepth,B=this.wallArr,T=this;this.drawHandler=new C.ScreenSpaceEventHandler(m.scene.canvas),m.scene.globe.depthTestAgainstTerrain=!0;let D=this.tooltip,F;this._viewer.container.style.cursor=`url(${window.SmartEarthRootUrl} 'Workers/image/cursor/draw.cur')`,this.drawHandler.setInputAction(function(V){E=R(V.position);let H=C.Cartographic.fromCartesian(E),q=C.Math.toDegrees(H.longitude),ie=C.Math.toDegrees(H.latitude),Z=H.height;y.push(E),x.push(q,ie,H.height),T.tophierarchy.push(q,ie,Z),w===0?(y.push(E),x.push(q,ie,H.height),F=m.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new C.CallbackProperty(()=>y,!1),clampToGround:!0,material:new C.ColorMaterialProperty(C.Color.YELLOW.withAlpha(.3)),width:3}})):w===1&&(F&&m.entities.remove(F),v=m.entities.add({name:null,id:T._earthCtrl.factory.createUUID(),polygon:{hierarchy:new C.PolygonHierarchy(C.Cartesian3.fromDegreesArrayHeights(x)),material:C.Color.YELLOW.withAlpha(.3)}}),v.polygon.hierarchy=new C.CallbackProperty(L,!1)),w++},C.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(function(V){if(w===0){D.showAt(V.endPosition,"\u5DE6\u952E\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u70B9");return}else w===1?D.showAt(V.endPosition,"\u70B9\u51FB\u6DFB\u52A0\u7B2C\u4E8C\u4E2A\u70B9"):D.showAt(V.endPosition,"\u53F3\u952E\u7ED3\u675F\u7ED8\u5236");E=R(V.endPosition);let H=C.Cartographic.fromCartesian(E),q=C.Math.toDegrees(H.longitude),ie=C.Math.toDegrees(H.latitude);x.splice(x.length-3,3),y.splice(y.length-1,1),y.push(E),x.push(q,ie,H.height)},C.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(function(V){this.end&&this.end()}.bind(this),C.ScreenSpaceEventType.RIGHT_CLICK),this.end=V=>{if(D.show(!1),T._viewer.container.style.cursor="default",T.drawHandler.destroy(),F&&m.entities.remove(F),v&&m.entities.remove(v),this.FlattenIsDraw=!1,this.end=void 0,V==="cancel"||y.length<3)return;if(w<2){w=0;return}w=0;for(let se=2;se<x.length;se=se+3)Q.push(x[se]);Q.sort(function(se,ce){return se-ce}),v=m.entities.add({name:null,id:T._earthCtrl.factory.createUUID(),polygon:{hierarchy:new C.CallbackProperty(function(){return new C.PolygonHierarchy(C.Cartesian3.fromDegreesArrayHeights(x))},!1),material:new C.ImageMaterialProperty({image:C.defaultValue(A.bottomImgUrl,`${window.SmartEarthRootUrl}Workers/image/bottomplane.jpg`),repeat:new C.Cartesian2(1,1)})}}),y.push(y[0]);let H,q,ie,Z,oe,ne;for(let se=0;se<y.length-1;se++){H=C.Cartographic.fromCartesian(y[se]),q=C.Cartographic.fromCartesian(y[se+1]),ie=C.Math.toDegrees(H.longitude),oe=C.Math.toDegrees(H.latitude),Z=C.Math.toDegrees(q.longitude),ne=C.Math.toDegrees(q.latitude),I?I=I>q.height?q.height:I:I=H.height>q.height?q.height:H.height;let ce=T.getPoint(ie,oe,Z,ne,H.height,q.height),j=[],de=[];T.getHeightsFromLonLat(ce.positions,function(me){if(me){j=me;for(let _e=0;_e<j.length;_e++)de.push(T.heightsort[0]-T.deepth);T.drawwall(ce.wallJwd,j,de)}})}v.polygon.height=Q[0]-M,this.FlattenPolygon.push(v),this.originHeight=Q[0],k(y),this.topPositions=y,typeof f=="function"&&f(y)};function L(){return new C.PolygonHierarchy(C.Cartesian3.fromDegreesArrayHeights(x))}function R(V){let H;if(m.scene.terrainProvider.constructor.name==="EllipsoidTerrainProvider")H=m.camera.pickEllipsoid(V,m.scene.globe.ellipsoid);else{let ie=m.scene.camera.getPickRay(V);H=m.scene.globe.pick(ie,m.scene)}if(m.scene.pick(V)){let ie=m.scene.pickPosition(V);if(ie){H=ie;let Z=C.Cartographic.fromCartesian(H),oe=m.scene.globe.getHeight(Z);Z.height=oe,H=C.Cartographic.toCartesian(Z)}}return H}function k(V){let H=m.scene.globe,q=V.concat();q.splice(q.length-1,1);for(let Z=0;Z<q.length-1;Z++)q[Z].x===q[Z+1].x&&q[Z].y===q[Z+1].y&&(q.splice(Z,1),Z--);let ie=q.length;if(U(q)&&q.reverse(),T.irregularCut){T.terrainFlatten.clearPolygon();let Z=[],oe=m.scene.globe.ellipsoid;for(let ne=0;ne<q.length;ne++){let se=oe.cartesianToCartographic(q[ne]),ce=C.Math.toDegrees(se.longitude),j=C.Math.toDegrees(se.latitude),de=se.height;Z.push(ce,j,de)}T.terrainFlatten.addPolygon(Z),T.terrainFlatten.update(),T.terrainFlatten.clipPlaneOfFlatten=!0}else{let Z=[];for(let oe=0;oe<ie;++oe){let ne=(oe+1)%ie,se=C.Cartesian3.add(q[oe],q[ne],new C.Cartesian3);se=C.Cartesian3.multiplyByScalar(se,.5,se);let ce=C.Cartesian3.normalize(se,new C.Cartesian3),j=C.Cartesian3.subtract(q[ne],se,new C.Cartesian3);j=C.Cartesian3.normalize(j,j);let de=C.Cartesian3.cross(j,ce,new C.Cartesian3);de=C.Cartesian3.normalize(de,de);let me=new C.Plane(de,0),_e=C.Plane.getPointDistance(me,se);Z.push(new C.ClippingPlane(de,_e))}H.clippingPlanes=new C.ClippingPlaneCollection({planes:Z})}}function U(V){if(V.length>=3)return!((V[1].x-V[0].x)*(V[2].y-V[1].y)-(V[1].y-V[0].y)*(V[2].x-V[1].x)>0)}return this};Gx.prototype.getPoint=function(o,A,f,m,C,y){let x=this,v=160,E=je.lerp(o,f,1/v)-o,I=je.lerp(A,m,1/v)-A,w=[],Q=[],M=[],B;w.push(o,A),B=ee.fromDegrees(o,A),Q.push(Kt.fromCartesian(B));for(let T=0;T<v;T++){let D=o+(T+1)*E,F=A+(T+1)*I;w.push(D,F),B=ee.fromDegrees(D,F),Q.push(Kt.fromCartesian(B))}return w.push(f,m),B=ee.fromDegrees(f,m),Q.push(Kt.fromCartesian(B)),{wallJwd:w,positions:Q}};Gx.prototype.getHeightsFromLonLat=function(o,A){let f=this._viewer,m=f.camera,C=[];if(this.isHaveTerrain(f))if(O(f.terrainProvider.availability)){let y=vQ(f.terrainProvider,o);Promise.resolve(y).then(function(x){x.forEach(function(v){C.push(v.height)}),typeof A=="function"&&A(C)})}else o.forEach(function(y){let x=f.scene.globe.getHeight(y);C.push(x)}),typeof A=="function"&&A(C);else o.forEach(function(y){C.push(f.scene.globe.getHeight(y))}),typeof A=="function"&&A(C)};Gx.prototype.isHaveTerrain=function(){return!!(this._viewer.scene&&this._viewer.scene.terrainProvider&&this._viewer.scene.terrainProvider._layers)};Gx.prototype.drawwall=function(o,A,f){let m=this,C=m._viewer.entities.add({wall:{positions:new Bn(function(){return ee.fromDegreesArray(o)},!1),maximumHeights:A,minimumHeights:f}}),y=C.wall;y.material=new z0({image:Ae(m._option.wallImgUrl,`${window.SmartEarthRootUrl}Workers/image/dzmc.jpg`),repeat:new It(1,1)}),m.wallArr.push(C)};Gx.prototype.setDeepth=function(o){this.FlattenPolygon[0]&&this.FlattenPolygon[0].polygon.height.setValue(this.originHeight-o),this.wallArr.forEach(A=>{let f=A.wall.minimumHeights.getValue();f=Array(f.length),f.fill(this.originHeight-o),A.wall.minimumHeights.setValue(f)})};Gx.prototype.edit=function(o){let A=this,f=A.editPoint,m=A.nowPoint;if(A._earthCtrl.coreMap.scene.globe.depthTestAgainstTerrain=!1,m){for(let x of A.editPoint)x&&(x.show=!0);A.update(m,f,o);return}for(let x=2;x<A.hierarchy.length;x=x+3)A.hierarchy[x]=A.originHeight-A.deepth;A.FlattenPolygon[0]&&A._viewer.entities.remove(A.FlattenPolygon[0]),A.FlattenPolygon=[];let C=this._viewer.entities.add({name:null,id:A._earthCtrl.factory.createUUID(),polygon:{hierarchy:new Un(ee.fromDegreesArrayHeights(A.hierarchy)),material:new z0({image:Ae(A._option.bottomImgUrl,`${window.SmartEarthRootUrl}Workers/image/bottomplane.jpg`),repeat:new It(1,1)}),perPositionHeight:!0}});A.FlattenPolygon.push(C);let y=A.FlattenPolygon[0].polygon.hierarchy.getValue();for(let x of y.positions){let v=this._viewer.entities.add({id:A._earthCtrl.factory.createUUID(),position:x,point:{color:At.WHITE,pixelSize:12,outlineColor:At.BLACK,outlineWidth:1}});f.push(v)}A._earthCtrl.measure.pickObject(null,function(x){let v=x.pickedObject.id;for(let E of f)if(v.id===E.id){A.nowPoint=E,A.update(E,f,o);return}})};Gx.prototype.endEdit=function(){let o=this;if(o._earthCtrl.coreMap.scene.globe.depthTestAgainstTerrain=!0,o.editPoint.length>0)for(let A of o.editPoint)A&&(A.show=!1)};Gx.prototype.excavationAndFill=function(){this.removeLabel();let o=this;this.endEdit(),o.topPositions&&(this.isLoading(!0),setTimeout(()=>{let A=null,f=null,m=!1;if(o.editPosition.length>0){let v=[];f=[];for(let E=0;E<o.editPosition.length-1;E++){let I=Kt.fromCartesian(o.editPosition[E]),w=je.toDegrees(I.longitude),Q=je.toDegrees(I.latitude),M=I.height;v.push(M),f.push(w,Q,M)}v.sort(function(E,I){return I-E}),A=v[0],m=!0}else A=o.heightsort[0]-o.deepth;let y=new Ple(o._earthCtrl,{positions:o.topPositions,baseHeight:A,basePositions:f,countBase:m}).start(),x=o.computeCentroidOfPolygon(o.topPositions);this._volumeLabel=this._viewer.entities.add({position:ee.fromRadians(x.longitude,x.latitude,o.heightsort[o.heightsort.length-1]),label:{text:`\u6316\u65B9\u4F53\u79EF\uFF1A${y.cutVolume}\u7ACB\u65B9\u7C73`,pixelOffset:{x:0,y:-30},font:"16px \u5B8B\u4F53",fillColor:At.GOLD,verticalOrigin:bn.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),this._volumeLabel1=this._viewer.entities.add({position:ee.fromRadians(x.longitude,x.latitude,o.heightsort[o.heightsort.length-1]),label:{text:`\u586B\u65B9\u4F53\u79EF\uFF1A${y.fillVolume}\u7ACB\u65B9\u7C73`,pixelOffset:{x:0,y:-70},font:"16px \u5B8B\u4F53",fillColor:At.GOLD,verticalOrigin:bn.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),this.isLoading(!1),console.log(y.result)},100))};Gx.prototype.computeCentroidOfPolygon=function(o){let A=[],f=[],m=0,C=0;for(let v=0;v<o.length;v++){let E=Kt.fromCartesian(o[v]);m+=E.longitude,C+=E.latitude,A.push(E.longitude),f.push(E.latitude)}let y=0,x=0;return y=m/o.length,x=C/o.length,new Kt(y,x)};Gx.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=this.loadingImg,o.appendChild(A),this.loading=o,this._viewer.container.appendChild(o)};Gx.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};Gx.prototype.update=function(o,A,f){let m=this,C=o.position.getValue(),x=m._scene.globe.ellipsoid.cartesianToCartographic(C),v=je.toDegrees(x.longitude),E=je.toDegrees(x.latitude),I=x.height;o.position.setValue(ee.fromDegrees(v,E,I+f)),m.editPoint=A,m.editPosition=[];let w=[];for(let M of A){let B=M.position.getValue();w.push(B),m.editPosition.push(B)}m.FlattenPolygon[0].polygon.hierarchy=new Bn(function(){return new Un(w)},!0);let Q=m.editPosition;Q.push(Q[0]);for(let M=0;M<Q.length-1;M++){let T=[];for(let D=0;D<=160;D++){let F=ee.lerp(Q[M],Q[M+1],D/160,new ee),L=Kt.fromCartesian(F);T.push(L.height)}m.wallArr[M].wall.minimumHeights.setValue(T)}};Gx.prototype.removeFromMap=function(){this.endEdit(),this._earthCtrl.tools.clearTool(),this.editPoint=[],this.nowPoint=null;let o=this._viewer;if(this.wallArr.length>0){for(let A=0;A<this.wallArr.length;A++)o.entities.remove(this.wallArr[A]);this.wallArr=[]}o.scene.globe.clippingPlanes&&o.scene.globe.clippingPlanes.removeAll(),this.FlattenPolygon&&this.FlattenPolygon.length>0&&(this.FlattenPolygon.forEach(function(A){o.entities.remove(A)}),this.FlattenPolygon=[]),this.FlattenIsDraw=!1,this.removeLabel(),this.terrainFlatten&&this.terrainFlatten.clearPolygon()};Gx.prototype.removeLabel=function(){this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0)};var Rle=Gx;function _C(o,A={}){this._earthCtrl=o,this._viewer=o.coreMap,this._scene=o.coreMap.scene,this.options=Ae(A,{}),this._Tooltip=new gw(o),this._tooltip=this._Tooltip.CreateTooltip(),this._drawColor={point:Ae(this.options.drawColor?.point,At.BLUE),polyline:Ae(this.options.drawColor?.polyline,At.YELLOW),polygon:Ae(this.options.drawColor?.point,At.YELLOW.withAlpha(.5))},this.selectDatum=!0,this.onlyTerrain=!0,this.tin=!1,this._volumeTin=[],this.loadingImg=`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`,this.unit=Ae(A.unit,"km\xB3")}_C.prototype.removeFromMap=function(){this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._prevEntity1!==void 0&&(this._viewer.entities.remove(this._prevEntity1),this._prevEntity1=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._volumeTin.forEach(o=>{this._viewer.entities.remove(o)}),this._volumeTin=[],this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=void 0),this.Triangulation=[],this.tinData=void 0,this._tooltip.show(!1)};_C.prototype.deleteObject=_C.prototype.removeFromMap;_C.prototype.startDrawing=function(o={},A="auto",f){let m=this._scene,C=this._tooltip,y=3,x=[],v=[],E=[],I;this._positions=v,this._degreesArr=E,this._drawColor.point=o.point||this._drawColor.point,this._drawColor.polyline=o.polyline||this._drawColor.polyline,this._drawColor.polygon=o.polygon||this._drawColor.polygon,this.loadingImg=o.loading||this.loadingImg,this.tin=Ae(o.tin,!0),this.onlyTerrain=Ae(o.onlyTerrain,!1),this.selectDatum=Ae(o.selectDatum,!0);let w=this;this._mouseHandler&&this._mouseHandler.destroy(),this.loading||this.addLoading();let Q=new Ur(m.canvas);this._mouseHandler=Q,this.removeFromMap(),this._viewer.container.style.cursor=`url(${globalThis.GEOWORLD_BASE_URL} 'Workers/image/cursor/draw.cur')`;let M;Q.setInputAction(function(T){if(T.position!==null){let D=m.camera.getPickRay(T.position),F=m.globe.pick(D,m);if(this._viewer.scene.pick(T.position)){let R=this._viewer.scene.pickPosition(T.position);R&&(F=R)}if(F){let R=Kt.fromCartesian(F),k=je.toDegrees(R.longitude),U=je.toDegrees(R.latitude);if(x.length===0&&(x.push(k,U),E.push([k,U]),v.push(F),I=F),v.length>=4){let V=Ss.wgs84ToWindowCoordinates(this._viewer.scene,I);if(V!==void 0){let H=V.x-T.position.x,q=V.y-T.position.y;if(H*H+q*q<16){x.splice(x.length-2,2),v.pop(),this.stopDrawing(f);return}}}x.push(k,U),E.push([k,U]),v.push(F),v.length===2&&!M&&(M=this._viewer.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new Bn(function(){return v},!1),clampToGround:!0,material:w._drawColor.polygon,width:3}})),v.length===y&&(M&&this._viewer.entities.remove(M),this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:new Un(ee.fromDegreesArray(x)),material:w._drawColor.polygon,fill:!0}}),this._prevEntity.polygon.hierarchy=new Bn(B,!1))}}}.bind(this),Ki.LEFT_CLICK),Q.setInputAction(function(T){let D=T.endPosition;if(D!==null)if(v.length===0)C.showAt(D,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7B2C\u4E00\u4E2A\u70B9");else{let F=m.camera.getPickRay(D),L=m.globe.pick(F,m),R=this._viewer.scene.pick(D),k=!1;if(R){let U=this._viewer.scene.pickPosition(D);U&&(L=U),k=!0}if(L){let U=Kt.fromCartesian(L),V=je.toDegrees(U.longitude),H=je.toDegrees(U.latitude);if(x.splice(x.length-2,2),E.pop(),v.pop(),x.push(V,H),E.push([V,H]),v.push(L),C.showAt(D,"\u53F3\u952E\u7ED3\u675F\u7ED8\u5236"),v.length>=3&&v.length>=4){let q=Ss.wgs84ToWindowCoordinates(this._viewer.scene,I);if(q!==void 0){let ie=q.x-D.x,Z=q.y-D.y;ie*ie+Z*Z<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}}.bind(this),Ki.MOUSE_MOVE),Q.setInputAction(function(T){this.end&&this.end()}.bind(this),Ki.RIGHT_CLICK);function B(){return new Un(ee.fromDegreesArray(x))}return this.end=T=>{if(this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),w._viewer.container.style.cursor="default",this._tooltip.show(!1),M&&this._viewer.entities.remove(M),this.end=void 0,!(v.length<y)){if(this._prevEntity&&(this._prevEntity.polygon.hierarchy=ee.fromDegreesArray(x)),T==="cancel"){this._prevEntity&&this._viewer.entities.remove(this._prevEntity);return}this.stopDrawing(A,f)}},this};_C.prototype.stopDrawing=function(o,A){this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._volumeTin.forEach(f=>{this._viewer.entities.remove(f)}),this._volumeTin=[],this.isLoading(!0),setTimeout(()=>{let f=this.computeCutVolume(o,this.onlyTerrain),m=C=>{let y=C.maxHeight,x=C.minHeight;this._prevEntity.polygon.height=C.minHeight,this._prevEntity.polygon.heightReference=0;let v={id:this._earthCtrl.factory.createUUID(),polygon:{hierarchy:{positions:this._positions},height:x,extrudedHeight:y,closeTop:!1,closeBottom:!1,material:At.CYAN.withAlpha(.2),outline:!0,outlineColor:At.RED,outlineWidth:2}};if(this._prevEntity1=this._viewer.entities.add(v),typeof A=="function"&&A(C),this.selectDatum){let E=()=>{this.addPoint(I=>{this.setDatum(I,w=>{typeof A=="function"&&A({...C,...w}),E()})})};E()}};this.onlyTerrain?f.then(C=>{m(C)}):m(f)},100)};_C.prototype.computeCentroidOfPolygon=function(o){let A=[],f=[],m=0,C=0;for(let v=0;v<o.length;v++){let E=Kt.fromCartesian(o[v]);m+=E.longitude,C+=E.latitude,A.push(E.longitude),f.push(E.latitude)}let y=0,x=0;return y=m/o.length,x=C/o.length,new Kt(y,x)};_C.prototype.computeCutVolume=function(o,A){let f=this,m=15e3,C=-15e3;if(o==="auto"){let E=wi.fromPoints(this._positions);console.log("BoundingSphere.radius",E.radius),o=E.radius/20}let y=this.getPointsInPolygon(this._degreesArr,o,!0),x=Zl.polygon([this._degreesArr]),v=()=>{let{tin:E}=this.tinFromPoints(y,{getArea:!0,polygon:x});this.tinData=E;let I={fill:0,dig:0},w,Q,M,B,T;this.Triangulation=[],E.features.forEach(L=>{if(L.positions){if(this.tin){let k=this._viewer.entities.add({polygon:{hierarchy:new Un(L.positions),material:this._drawColor.polygon,perPositionHeight:!0,outline:!0,outlineColor:At.YELLOW}});this._volumeTin.push(k)}let R=L.geometry.coordinates[0];w=R[0][2],Q=R[1][2],M=R[2][2],T=L.area,this.Triangulation.push({bottomArea:T,height:[w,Q,M]}),B=(w-m+Q-m+M-m)/3,B>0?I.dig=I.dig+T*B:I.fill=I.fill-T*B}});let D=this.computeCentroidOfPolygon(this._positions);this.unit!=="m\xB3"&&(I.dig=I.dig/1e9,I.fill=I.fill/1e9);let F=this.unit==="m\xB3"?"\u7ACB\u65B9\u7C73":"\u7ACB\u65B9\u5343\u7C73";return this._volumeLabel=this._viewer.entities.add({position:ee.fromRadians(D.longitude,D.latitude,C),label:{text:`\u6316\u65B9\u4F53\u79EF\uFF1A${I.dig.toFixed(4)}${F}`,pixelOffset:{x:0,y:-30},font:"16px \u5B8B\u4F53",fillColor:At.GOLD,verticalOrigin:bn.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),this._volumeLabel1=this._viewer.entities.add({position:ee.fromRadians(D.longitude,D.latitude,C),label:{text:`\u586B\u65B9\u4F53\u79EF\uFF1A${I.fill.toFixed(4)}${F}`,pixelOffset:{x:0,y:-70},font:"16px \u5B8B\u4F53",fillColor:At.GOLD,verticalOrigin:bn.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),this.isLoading(!1),{maxHeight:C,minHeight:m,volume:I,unit:this.unit,spacing:o}};if(A){let E=[];return y.features.forEach(w=>{let Q=w.geometry.coordinates;E.push(Kt.fromDegrees(Q[0],Q[1]))}),vQ(this._viewer.scene.globe.terrainProvider,E).then(w=>(y.features.forEach((Q,M)=>{let B=Q.geometry.coordinates;B[2]=w[M]&&w[M].height?w[M].height:0,C<B[2]&&(C=B[2]),m>B[2]&&(m=B[2])}),v()))}return y.features.forEach(E=>{let I=E.geometry.coordinates,w=new Kt(je.toRadians(I[0]),je.toRadians(I[1]));I[2]=this._viewer.scene.sampleHeight(w)||0,C<I[2]&&(C=I[2]),m>I[2]&&(m=I[2])}),v()};_C.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=this.loadingImg,o.appendChild(A),this.loading=o,this._viewer.container.appendChild(o)};_C.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};_C.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};_C.prototype.addPoint=function(o){this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=null),this._prevEntity1&&(this.addPointHandle=new Ur(this._viewer.scene.canvas),this.addPointHandle.setInputAction(function(A){let f=this._viewer.scene.pick(A.position);if(f&&f.id&&f.id.id===this._prevEntity1.id){let m=this._viewer.scene.pickPosition(A.position);if(m){let C=Kt.fromCartesian(m);this.addPointHandle.destroy(),this.addPointHandle=null,o&&typeof o=="function"&&o(C.height.toFixed(1))}}}.bind(this),Ki.LEFT_CLICK),this.addPointHandle.setInputAction(function(A){let f=this._viewer.scene.pick(A.endPosition);f&&f.id&&f.id.id===this._prevEntity1.id?this._tooltip.showAt(A.endPosition,"\u70B9\u51FB\u4FEE\u6539\u57FA\u51C6\u9762\u9AD8\u5EA6"):this._tooltip.show(!1)}.bind(this),Ki.MOUSE_MOVE))};_C.prototype.showTin=function(o){this.tin=o,this._volumeTin.forEach(A=>{this._viewer.entities.remove(A)}),this._volumeTin=[],o&&this.tinData&&this.tinData.features.forEach(A=>{if(A.positions){let f=this._viewer.entities.add({polygon:{hierarchy:new Un(A.positions),material:this._drawColor.polygon,perPositionHeight:!0,outline:!0,outlineColor:At.YELLOW}});this._volumeTin.push(f)}})};_C.prototype.setDatum=function(o,A){if(this.Triangulation&&this.Triangulation.length>0){let f,m,C,y={fill:0,dig:0};this.Triangulation.forEach(function(v){f=v.bottomArea,m=v.height,C=(m[0]-o+m[1]-o+m[2]-o)/3,C>0?y.dig=y.dig+f*C*scale.dig:y.fill=y.fill-f*C*scale.fill}),this.unit!=="m\xB3"&&(y.dig=y.dig/1e9,y.fill=y.fill/1e9);let x=this.unit==="m\xB3"?"\u7ACB\u65B9\u7C73":"\u7ACB\u65B9\u5343\u7C73";this._volumeLabel.label.text=`\u6316\u65B9\u4F53\u79EF\uFF1A${y.dig.toFixed(4)}${x}`,this._volumeLabel1.label.text=`\u586B\u65B9\u4F53\u79EF\uFF1A${y.fill.toFixed(4)}${x}`,this._prevEntity.polygon.height=o,A&&typeof A=="function"&&A({volume:y,unit:this.unit})}};_C.prototype.getPointsInPolygon=function(o,A=50,f=!0){if(o.length<3)return;o.push(o[0]);let m=Zl.lineString(o),C=Zl.bbox(m),y=Zl.pointGrid(C,A,{units:"meters"}),x=Zl.polygon([o]),v=Zl.pointsWithinPolygon(y,x);if(f)for(let E=0;E<o.length-1;E++){let I=Zl.lineString([o[E],o[E+1]]),w={units:"meters"},Q=Zl.length(I,w),M;for(let B=A;;B+=A)if(B<=Q)M=Zl.along(I,B,w),v.features.push(M);else{M=Zl.along(I,Q,w),v.features.push(M);break}}return v};_C.prototype.tinFromPoints=function(o,A={}){let{polygon:f,getArea:m}=A,C=Zl.tin(o),y=0;return C&&C.features&&C.features.forEach(x=>{let v=!0;if(f){let E=Zl.centerOfMass(x);v=Zl.booleanPointInPolygon(E,f)}if(v){let E=x.geometry.coordinates[0],I=[],w=[];for(let Q=0;Q<3;Q++)I.push([E[Q][0],E[Q][1]]),w.push(ee.fromDegrees(E[Q][0],E[Q][1],E[Q][2]));x.positions=w,m&&(x.area=this.getArea(I,w,!0),y+=x.area)}}),{tin:C,area:y}};_C.prototype.getArea=function(o,A,f){if(o.length<3)return;o.push(o[0]);let m=o,C=0,y=Zl.polygon([m]),x;m.length===4?x=[y]:x=Zl.tesselate(y).features;let v,E,I,w;return x.forEach(Q=>{v=Q.geometry.coordinates[0],E=m.findIndex(F=>F.toString()===v[0].toString()),I=m.findIndex(F=>F.toString()===v[1].toString()),w=m.findIndex(F=>F.toString()===v[2].toString());let M=this.getdistance(A[E],A[I]),B=this.getdistance(A[I],A[w]),T=this.getdistance(A[E],A[w]),D=(M+B+T)/2;C+=Math.sqrt(D*((D-M)*(D-B)*(D-T)))}),f||(C<1e6?C=`${C.toFixed(2)}\u5E73\u65B9\u7C73`:C=`${(C/1e6).toFixed(2)}\u5E73\u65B9\u5343\u7C73`),C};_C.prototype.getdistance=function(o,A){let f=Kt.fromCartesian(o),m=Kt.fromCartesian(A),C=Di.MOON2000,x=new l0(f,m,C).surfaceDistance;return x=Math.sqrt(Math.pow(x,2)+Math.pow(m.height-f.height,2)),x};var _At=_C;function Lle(o){this.mEarthCtrl=o,this._polylines=[],this._resPolylines=[],this._points=[],this.entities=this.mEarthCtrl.entities,this.camera=this.mEarthCtrl.coreMap.camera,this.scene=this.mEarthCtrl.coreMap.scene}Lle.prototype.createLineOfSight=function(o){let A=[],f=this,m=[],C=[],y={polyline:[]};f.objectsToExclude=null;let x,v=function(){function M(B){this.options={polyline:{show:!0,positions:[],material:At.YELLOW,width:3,clampToGround:!1}},this.positionsp=B,this._init()}return M.prototype._init=function(){let B=this,T=function(){return B.positionsp};this.options.polyline.positions=new Bn(T,!1),this.polyline=f.entities.add(this.options),f.item=this.polyline,C.push(this.polyline)},M}(),E=new Ur(f.scene.canvas),I=[],w;if(this._points.length>0)for(let M=0;M<this._points.length;M++)this.entities.remove(this._points[M]);let Q=[];return E.setInputAction(function(M){let B,T=new ee(0,0,0);if(new ja(f.mEarthCtrl).pickVector(M.position,T)&&(B=T),!!B)if(I.length===0){I.push(B.clone(),B.clone());let F={leftX:M.position.x,leftY:M.position.y};Q.push(F),x=B.clone()}else{let F={rightX:M.position.x,rightY:M.position.y};Q.push(F);let L={postion:I,entity:C,cartesian:Q};m.push(L),Q=[],w=void 0,I=[],I.push(x.clone()),I.push(x.clone()),w=new v(I),A.push(w)}},Ki.LEFT_CLICK),E.setInputAction(function(M){let B,T=f.camera.getPickRay(M.endPosition);if(B=f.scene.globe.pick(T,f.scene),f.scene.pick(M.endPosition)){let F=f.scene.pickPosition(M.endPosition);F&&(B=F)}!B||I.length>=2&&(O(w)?B!==void 0&&(I.pop(),I.push(B)):(w=new v(I),A.push(w)))},Ki.MOUSE_MOVE),E.setInputAction(function(M){let B=f.entities.add(new UA);f.objectsToExclude=[B];let T=!0;for(let D=0;D<m.length;D++)D===0?T=f.tsjx(m[0].postion[0],m[0].postion[1]):T=f.tsjx(m[D].postion[0],m[D].postion[1]);I.pop(),f._polylines=y.polyline,E.destroy();for(let D=0;D<C.length;D++)f.entities.remove(C[D]);O(o)&&typeof o=="function"&&o(y)},Ki.RIGHT_CLICK),this};Lle.prototype.tsjx=function(o,A){let f=this,m=ee.normalize(ee.subtract(A,o,new ee),new ee),C=new ls(o,m),y=f.scene.globe.pick(C,f.scene);y!=null?(x(y,o,At.GREEN),x(y,A,At.RED)):x(o,A,At.GREEN);function x(v,E,I){let w=f.entities.add({polyline:{positions:[v,E],width:1,material:I,depthFailMaterial:I}});f._resPolylines.push(w)}return!1};Lle.prototype.deleteObject=function(){if(this._points.length>0){this.objectsToExclude=null;for(let o=0;o<this._points.length;o++)this.entities.remove(this._points[o])}if(this._resPolylines.length>0){for(let o=0;o<this._resPolylines.length;o++)this.entities.remove(this._resPolylines[o]);this._resPolylines=[]}};var BAt=Lle;function _h(o,A={}){this._earthCtrl=o,this._viewer=o.coreMap,this._scene=o.coreMap.scene,this.options=Ae(A,{}),this._Tooltip=new gw(o),this._tooltip=this._Tooltip.CreateTooltip(),this._drawColor={point:Ae(this.options.drawColor?.point,At.BLUE),polyline:Ae(this.options.drawColor?.polyline,At.YELLOW),polygon:Ae(this.options.drawColor?.polygon,At.YELLOW.withAlpha(.5))},this.selectDatum=!0,this.onlyTerrain=!0,this.tin=!1,this._volumeTin=[],this.loadingImg=`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`,this.wallArr=[],this.FlattenPolygon=[],this._Apositions=[],this._heightsort=null,this._deepth=100,this._positions=[],this._modelArr=Ae(A.modelArr,[]),this._isFlattening=Ae(A.isFlattening,!0),this.modelCuttingPolygon=null,this.wallImgUrl=Ae(A.wallImgUrl,null),this.bottomImgUrl=Ae(A.bottomImgUrl,null),this.calculate=Ae(A.calculate,!0),this._Loading=Ae(A.loading,!0),this.editPoint=[],this.nowPoint=null,this.hierarchy=[],this._originHeight=null}_h.prototype.removeMeasureFromMap=function(){this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._prevEntity1!==void 0&&(this._viewer.entities.remove(this._prevEntity1),this._prevEntity1=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._volumeTin.forEach(o=>{this._viewer.entities.remove(o)}),this._volumeTin=[],this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=void 0),this.Triangulation=[],this.tinData=void 0,this._tooltip.show(!1)};_h.prototype.removeFromMap=function(){if(this.endEdit(),this.removeMeasureFromMap(),this.wallArr.length>0){for(let o=0;o<this.wallArr.length;o++)this._viewer.entities.remove(this.wallArr[o]);this.wallArr=[]}if(this.FlattenPolygon&&this.FlattenPolygon.length>0){for(let o=0;o<this.FlattenPolygon.length;o++)this._viewer.entities.remove(this.FlattenPolygon[o]);this.FlattenPolygon=[]}this.removeModelCutting()};_h.prototype.deleteObject=_h.prototype.removeFromMap;_h.prototype.startDrawing=function(o={},A){let f=Ae(o.spacing,"auto"),m=this._scene,C=this._tooltip,y=3,x=[],v=[],E=[],I=[],w=[],Q;this._Apositions=o.positions,this._positions=v,this._hierarchy=E,this._heightsort=I,this._degreesArr=w,this._deepth=Ae(o.deepth,100),this._drawColor.point=o.point||this._drawColor.point,this._drawColor.polyline=o.polyline||this._drawColor.polyline,this._drawColor.polygon=o.polygon||this._drawColor.polygon,this.loadingImg=o.loading||this.loadingImg,this.tin=Ae(o.tin,!1),this.onlyTerrain=Ae(o.onlyTerrain,!1),this.selectDatum=Ae(o.selectDatum,!1);let M=this;if(this._mouseHandler&&this._mouseHandler.destroy(),this.loading||this.addLoading(),o.positions){let B=ee.fromDegreesArray(o.positions);for(let T of B)v.push(T);if(!(v.length<y)){for(let T=0;T<o.positions.length;T+=2)w.push([o.positions[T],o.positions[T+1]]);this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:ee.fromDegreesArray(o.positions),material:M._drawColor.polygon,fill:!0}});for(let T=0;T<o.positions.length;T+=2){let D=M._viewer.scene.sampleHeight(new Kt(je.toRadians(o.positions[T]),je.toRadians(o.positions[T+1])));I.push(D),E.push(o.positions[T],o.positions[T+1],D)}this.stopDrawing(f,T=>{A&&A(T)})}}else{let B=new Ur(m.canvas);this._mouseHandler=B,this.removeMeasureFromMap(),this._viewer.container.style.cursor=`url(${globalThis.GEOWORLD_BASE_URL} 'Workers/image/cursor/draw.cur')`;let T;B.setInputAction(function(F){if(F.position!==null){let L=m.camera.getPickRay(F.position),R=m.globe.pick(L,m);if(this._viewer.scene.pick(F.position)){let U=this._viewer.scene.pickPosition(F.position);U&&(R=U)}if(R){let U=Kt.fromCartesian(R),V=je.toDegrees(U.longitude),H=je.toDegrees(U.latitude);if(x.length===0&&(x.push(V,H),w.push([V,H]),v.push(R),Q=R),v.length>=4){let q=Ss.wgs84ToWindowCoordinates(this._viewer.scene,Q);if(q!==void 0){let ie=q.x-F.position.x,Z=q.y-F.position.y;if(ie*ie+Z*Z<16){x.splice(x.length-2,2),v.pop(),this.stopDrawing(A);return}}}x.push(V,H),w.push([V,H]),v.push(R),v.length===2&&!T&&(T=this._viewer.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new Bn(function(){return v},!1),clampToGround:!0,material:M._drawColor.polygon,width:3}})),v.length===y&&(T&&this._viewer.entities.remove(T),this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:new Un(ee.fromDegreesArray(x)),material:M._drawColor.polygon,fill:!0}}),this._prevEntity.polygon.hierarchy=new Bn(()=>new Un(ee.fromDegreesArray(x)),!1))}}}.bind(this),Ki.LEFT_CLICK),B.setInputAction(function(F){let L=F.endPosition;if(L!==null)if(v.length===0)C.showAt(L,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7B2C\u4E00\u4E2A\u70B9");else{let R=m.camera.getPickRay(L),k=m.globe.pick(R,m),U=this._viewer.scene.pick(L),V=!1;if(U){let H=this._viewer.scene.pickPosition(L);H&&(k=H),V=!0}if(k){let H=Kt.fromCartesian(k),q=je.toDegrees(H.longitude),ie=je.toDegrees(H.latitude);if(x.splice(x.length-2,2),w.pop(),v.pop(),x.push(q,ie),w.push([q,ie]),v.push(k),C.showAt(L,"\u53F3\u952E\u7ED3\u675F\u7ED8\u5236"),v.length>=3&&v.length>=4){let Z=Ss.wgs84ToWindowCoordinates(this._viewer.scene,Q);if(Z!==void 0){let oe=Z.x-L.x,ne=Z.y-L.y;oe*oe+ne*ne<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}}.bind(this),Ki.MOUSE_MOVE);let D=null;B.setInputAction(function(F){D=window.setTimeout(()=>{console.log("\u5355\u51FB"),this.end&&this.end()},200)}.bind(this),Ki.RIGHT_CLICK),B.setInputAction(function(F){console.log("\u53CC\u51FB......"),clearTimeout(D)},Ki.LEFT_DOUBLE_CLICK),this.end=F=>{if(this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),M._viewer.container.style.cursor="default",this._tooltip.show(!1),T&&this._viewer.entities.remove(T),this.end=void 0,console.log(w,"?????????"),!(v.length<y)){if(this._prevEntity&&(this._prevEntity.polygon.hierarchy=ee.fromDegreesArray(x)),F==="cancel"){this._prevEntity&&this._viewer.entities.remove(this._prevEntity);return}for(let L=0;L<x.length;L+=2){let R=M._viewer.scene.sampleHeight(new Kt(je.toRadians(x[L]),je.toRadians(x[L+1])));I.push(R),E.push(x[L],x[L+1],R)}this._Apositions=x,this.stopDrawing(f,A)}}}return this};_h.prototype.stopDrawing=function(o,A){let f=this;this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._volumeTin.forEach(m=>{this._viewer.entities.remove(m)}),this._volumeTin=[],this._Loading&&this.isLoading(!0),setTimeout(()=>{f._heightsort.sort(function(T,D){return T-D});let m=this._viewer.entities.add({name:null,id:f._earthCtrl.factory.createUUID(),polygon:{hierarchy:new Bn(function(){return new Un(ee.fromDegreesArrayHeights(f._hierarchy))},!1),material:new z0({image:Ae(f.bottomImgUrl,`${window.SmartEarthRootUrl}Workers/image/bottomplane.jpg`),repeat:new It(1,1)})}});f.FlattenPolygon.push(m),f.originHeight=f._heightsort[0];let C=ee.fromDegreesArrayHeights(f._hierarchy);C.push(C[0]),f._positionsB=C;let y=null,x,v,E,I,w,Q;for(let T=0;T<C.length-1;T++){x=Kt.fromCartesian(C[T]),v=Kt.fromCartesian(C[T+1]),E=je.toDegrees(x.longitude),w=je.toDegrees(x.latitude),I=je.toDegrees(v.longitude),Q=je.toDegrees(v.latitude),y?y=y>v.height?v.height:y:y=x.height>v.height?v.height:x.height;let D=f.getPoint(E,w,I,Q,x.height,v.height),F=[],L=[];f.getHeightsFromLonLat(D.positions,function(R){if(R){F=R;for(let k=0;k<F.length;k++)L.push(f._heightsort[0]-f._deepth);f.drawwall(D.wallJwd,F,L)}})}if(f._baseHeight=f._heightsort[0]-f._deepth,m.polygon.height=f._baseHeight,!this.calculate)return f._isFlattening&&f.modelCutting(),A&&A(!0),this.isLoading(!1);let M=this.computeCutVolume(o,this.onlyTerrain),B=T=>{let D=T.maxHeight,F=T.minHeight;if(this._prevEntity.polygon.height=T.minHeight,this._prevEntity.polygon.heightReference=0,this.selectDatum){let L=()=>{this.addPoint(R=>{this.setDatum(R,k=>{typeof A=="function"&&A({...T,...k}),L()})})};L()}};this.onlyTerrain?M.then(T=>{B(T)}):B(M),f.setDatum(f._baseHeight,T=>{f._isFlattening&&f.modelCutting(),A&&A(T),this._Loading&&this.isLoading(!1)})},100)};_h.prototype.modelCutting=function(){let o=this;if(o._modelCuttingPolygon=rh.fromPositions({positions:ee.fromDegreesArray(o._Apositions),height:o._baseHeight}),o._modelArr.length>0)for(let A of o._modelArr)A.addFlattenPolygon(o._modelCuttingPolygon),A.needUpdateFlatten=!0,A.clipPlaneOfFlatten=!0;else console.info("\u8BF7\u6DFB\u52A0\u6A21\u578B\uFF01")};_h.prototype.removeModelCutting=function(){let o=this;if(o._modelArr.length>0){for(let A of o._modelArr)A.removeFlattenPolygon(o._modelCuttingPolygon);o._modelCuttingPolygon=null,o._modelArr=[]}else console.info("\u8BF7\u6DFB\u52A0\u6A21\u578B\uFF01")};_h.prototype.computeCentroidOfPolygon=function(o){let A=[],f=[],m=0,C=0;for(let v=0;v<o.length;v++){let E=Kt.fromCartesian(o[v]);m+=E.longitude,C+=E.latitude,A.push(E.longitude),f.push(E.latitude)}let y=0,x=0;return y=m/o.length,x=C/o.length,new Kt(y,x)};_h.prototype.edit=function(o,A,f){let m=this,C=m.editPoint,y=m.nowPoint;if(m._earthCtrl.coreMap.scene.globe.depthTestAgainstTerrain=!1,y){for(let E of m.editPoint)E&&(E.show=!0);m.update(y,C,o);return}for(let E=2;E<m._hierarchy.length;E=E+3)m._hierarchy[E]=m.originHeight-m._deepth;m.FlattenPolygon[0]&&m._viewer.entities.remove(m.FlattenPolygon[0]),m.FlattenPolygon=[];let x=this._viewer.entities.add({name:null,id:m._earthCtrl.factory.createUUID(),polygon:{hierarchy:new Un(ee.fromDegreesArrayHeights(m._hierarchy)),material:new z0({image:Ae(m.bottomImgUrl,`${window.SmartEarthRootUrl}Workers/image/bottomplane.jpg`),repeat:new It(1,1)}),perPositionHeight:!0}});m.FlattenPolygon.push(x);let v=m.FlattenPolygon[0].polygon.hierarchy.getValue();for(let E of v.positions){let I=this._viewer.entities.add({id:m._earthCtrl.factory.createUUID(),position:E,point:{color:At.WHITE,pixelSize:12,outlineColor:At.BLACK,outlineWidth:1}});C.push(I)}if(o)if(A){for(let E of C)if(A===E.id){m.nowPoint=E,m.update(E,C,o);return}}else m._earthCtrl.measure.pickObject(null,function(E){let I=E.pickedObject.id;for(let w of C)if(I.id===w.id){m.nowPoint=w,m.update(w,C,o);return}});else f&&f(C)};_h.prototype.update=function(o,A,f){let m=this,C=o.position.getValue(),x=m._scene.globe.ellipsoid.cartesianToCartographic(C),v=je.toDegrees(x.longitude),E=je.toDegrees(x.latitude),I=x.height;o.position.setValue(ee.fromDegrees(v,E,I+f)),m.editPoint=A,m.editPosition=[];let w=[];for(let M of A){let B=M.position.getValue();w.push(B),m.editPosition.push(B)}m.FlattenPolygon[0].polygon.hierarchy=new Bn(function(){return new Un(w)},!0);let Q=m.editPosition;Q.push(Q[0]);for(let M=0;M<Q.length-1;M++){let T=[];for(let D=0;D<=160;D++){let F=ee.lerp(Q[M],Q[M+1],D/160,new ee),L=Kt.fromCartesian(F);T.push(L.height)}m.wallArr[M].wall.minimumHeights.setValue(T)}};_h.prototype.endEdit=function(){let o=this;if(o._earthCtrl.coreMap.scene.globe.depthTestAgainstTerrain=!0,o.editPoint.length>0)for(let A of o.editPoint)A&&(A.show=!1)};_h.prototype.computeCutVolume=function(o,A){let f=this,m=15e3,C=-15e3;o==="auto"&&(o=wi.fromPoints(this._positions).radius/20);let y=this.getPointsInPolygon(this._degreesArr,o,!0),x=Zl.polygon([this._degreesArr]),v=()=>{let{tin:E}=this.tinFromPoints(y,{getArea:!0,polygon:x});this.tinData=E;let I={fill:0,dig:0},w={fill:"\u7ACB\u65B9\u7C73",dig:"\u7ACB\u65B9\u7C73"},Q,M,B,T,D,F={fill:1,dig:1};this.Triangulation=[],E.features.forEach(R=>{if(R.positions){if(this.tin){let U=this._viewer.entities.add({polygon:{hierarchy:new Un(R.positions),material:this._drawColor.polygon,perPositionHeight:!0,outline:!0,outlineColor:At.YELLOW}});this._volumeTin.push(U)}let k=R.geometry.coordinates[0];Q=k[0][2],M=k[1][2],B=k[2][2],D=R.area,this.Triangulation.push({bottomArea:D,height:[Q,M,B]}),T=(Q-m+M-m+B-m)/3,T>0?I.dig=I.dig+D*T*F.dig:I.fill=I.fill-D*T*F.fill,I.dig>1e10&&w.dig==="\u7ACB\u65B9\u7C73"&&(I.dig=I.dig/1e9,w.dig="\u7ACB\u65B9\u5343\u7C73",F.dig=1e-9),I.fill>1e10&&w.fill==="\u7ACB\u65B9\u7C73"&&(I.fill=I.fill/1e9,w.fill="\u7ACB\u65B9\u5343\u7C73",F.fill=1e-9)}});let L=this.computeCentroidOfPolygon(this._positions);return this._volumeLabel=this._viewer.entities.add({position:ee.fromRadians(L.longitude,L.latitude,C),label:{text:`\u6316\u65B9\u4F53\u79EF\uFF1A${I.dig.toFixed(4)}${w.dig}`,pixelOffset:{x:0,y:-30},font:"16px \u5B8B\u4F53",fillColor:At.GOLD,verticalOrigin:bn.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),this._volumeLabel1=this._viewer.entities.add({position:ee.fromRadians(L.longitude,L.latitude,C),label:{text:`\u586B\u65B9\u4F53\u79EF\uFF1A${I.fill.toFixed(4)}${w.fill}`,pixelOffset:{x:0,y:-70},font:"16px \u5B8B\u4F53",fillColor:At.GOLD,verticalOrigin:bn.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),{maxHeight:C,minHeight:m,volume:I,unit:w,spacing:o}};if(A){let E=[];return y.features.forEach(w=>{let Q=w.geometry.coordinates;E.push(Kt.fromDegrees(Q[0],Q[1]))}),vQ(this._viewer.scene.globe.terrainProvider,E).then(w=>(y.features.forEach((Q,M)=>{let B=Q.geometry.coordinates;B[2]=w[M]&&w[M].height?w[M].height:0,C<B[2]&&(C=B[2]),m>B[2]&&(m=B[2])}),v()))}return y.features.forEach(E=>{let I=E.geometry.coordinates,w=new Kt(je.toRadians(I[0]),je.toRadians(I[1]));I[2]=this._viewer.scene.sampleHeight(w)||0,C<I[2]&&(C=I[2]),m>I[2]&&(m=I[2])}),v()};_h.prototype.getPoint=function(o,A,f,m,C,y){let x=this,v=160,E=je.lerp(o,f,1/v)-o,I=je.lerp(A,m,1/v)-A,w=[],Q=[],M=[],B;w.push(o,A),B=ee.fromDegrees(o,A),Q.push(Kt.fromCartesian(B));for(let T=0;T<v;T++){let D=o+(T+1)*E,F=A+(T+1)*I;w.push(D,F),B=ee.fromDegrees(D,F),Q.push(Kt.fromCartesian(B))}return w.push(f,m),B=ee.fromDegrees(f,m),Q.push(Kt.fromCartesian(B)),{wallJwd:w,positions:Q}};_h.prototype.getHeightsFromLonLat=function(o,A){let f=this._viewer,m=[];o.forEach(function(C){m.push(f.scene.sampleHeight(new Kt(C.longitude,C.latitude)))}),typeof A=="function"&&A(m)};_h.prototype.isHaveTerrain=function(){return!!(this._viewer.scene&&this._viewer.scene.terrainProvider&&this._viewer.scene.terrainProvider._layers)};_h.prototype.drawwall=function(o,A,f){let m=this,C=m._viewer.entities.add({wall:{positions:new Bn(function(){return ee.fromDegreesArray(o)},!1),maximumHeights:A,minimumHeights:f}}),y=C.wall;y.material=new z0({image:Ae(m.wallImgUrl,`${window.SmartEarthRootUrl}Workers/image/dzmc.jpg`),repeat:new It(1,1)}),m.wallArr.push(C)};_h.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=this.loadingImg,o.appendChild(A),this.loading=o,this._viewer.container.appendChild(o)};_h.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};_h.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};_h.prototype.addPoint=function(o){this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=null),this._prevEntity1&&(this.addPointHandle=new Ur(this._viewer.scene.canvas),this.addPointHandle.setInputAction(function(A){let f=this._viewer.scene.pick(A.position);if(f&&f.id&&f.id.id===this._prevEntity1.id){let m=this._viewer.scene.pickPosition(A.position);if(m){let C=Kt.fromCartesian(m);this.addPointHandle.destroy(),this.addPointHandle=null,o&&typeof o=="function"&&o(C.height.toFixed(1))}}}.bind(this),Ki.LEFT_CLICK),this.addPointHandle.setInputAction(function(A){let f=this._viewer.scene.pick(A.endPosition);f&&f.id&&f.id.id===this._prevEntity1.id?this._tooltip.showAt(A.endPosition,"\u70B9\u51FB\u4FEE\u6539\u57FA\u51C6\u9762\u9AD8\u5EA6"):this._tooltip.show(!1)}.bind(this),Ki.MOUSE_MOVE))};_h.prototype.showTin=function(o){this.tin=o,this._volumeTin.forEach(A=>{this._viewer.entities.remove(A)}),this._volumeTin=[],o&&this.tinData&&this.tinData.features.forEach(A=>{if(A.positions){let f=this._viewer.entities.add({polygon:{hierarchy:new Un(A.positions),material:this._drawColor.polygon,perPositionHeight:!0,outline:!0,outlineColor:At.YELLOW}});this._volumeTin.push(f)}})};_h.prototype.setDatum=function(o,A){if(this.Triangulation&&this.Triangulation.length>0){let f,m,C,y={fill:0,dig:0},x={fill:"\u7ACB\u65B9\u7C73",dig:"\u7ACB\u65B9\u7C73"},v={fill:1,dig:1};this.Triangulation.forEach(function(E){f=E.bottomArea,m=E.height,C=(m[0]-o+m[1]-o+m[2]-o)/3,C>0?y.dig=y.dig+f*C*v.dig:y.fill=y.fill-f*C*v.fill,y.dig>1e10&&x.dig==="\u7ACB\u65B9\u7C73"&&(y.dig=y.dig/1e9,x.dig="\u7ACB\u65B9\u5343\u7C73",v.dig=1e-9),y.fill>1e10&&x.fill==="\u7ACB\u65B9\u7C73"&&(y.fill=y.fill/1e9,x.fill="\u7ACB\u65B9\u5343\u7C73",v.fill=1e-9)}),this._volumeLabel.label.text=`\u6316\u65B9\u4F53\u79EF\uFF1A${y.dig.toFixed(4)}${x.dig}`,this._volumeLabel1.label.text=`\u586B\u65B9\u4F53\u79EF\uFF1A${y.fill.toFixed(4)}${x.fill}`,this._prevEntity.polygon.height=o,A&&typeof A=="function"&&A({volume:y,unit:x})}};_h.prototype.getPointsInPolygon=function(o,A=50,f=!0){if(o.length<3)return;o.push(o[0]);let m=Zl.lineString(o),C=Zl.bbox(m),y=Zl.pointGrid(C,A,{units:"meters"}),x=Zl.polygon([o]),v=Zl.pointsWithinPolygon(y,x);if(f)for(let E=0;E<o.length-1;E++){let I=Zl.lineString([o[E],o[E+1]]),w={units:"meters"},Q=Zl.length(I,w),M;for(let B=A;;B+=A)if(B<=Q)M=Zl.along(I,B,w),v.features.push(M);else{M=Zl.along(I,Q,w),v.features.push(M);break}}return v};_h.prototype.tinFromPoints=function(o,A={}){let{polygon:f,getArea:m}=A,C=Zl.tin(o),y=0;return C&&C.features&&C.features.forEach(x=>{let v=!0;if(f){let E=Zl.centerOfMass(x);v=Zl.booleanPointInPolygon(E,f)}if(v){let E=x.geometry.coordinates[0],I=[],w=[];for(let Q=0;Q<3;Q++)I.push([E[Q][0],E[Q][1]]),w.push(ee.fromDegrees(E[Q][0],E[Q][1],E[Q][2]));x.positions=w,m&&(x.area=this.getArea(I,w,!0),y+=x.area)}}),{tin:C,area:y}};_h.prototype.getArea=function(o,A,f){if(o.length<3)return;o.push(o[0]);let m=o,C=0,y=Zl.polygon([m]),x;m.length===4?x=[y]:x=Zl.tesselate(y).features;let v,E,I,w;return x.forEach(Q=>{v=Q.geometry.coordinates[0],E=m.findIndex(F=>F.toString()===v[0].toString()),I=m.findIndex(F=>F.toString()===v[1].toString()),w=m.findIndex(F=>F.toString()===v[2].toString());let M=this.getdistance(A[E],A[I]),B=this.getdistance(A[I],A[w]),T=this.getdistance(A[E],A[w]),D=(M+B+T)/2;C+=Math.sqrt(D*((D-M)*(D-B)*(D-T)))}),f||(C<1e6?C=`${C.toFixed(2)}\u5E73\u65B9\u7C73`:C=`${(C/1e6).toFixed(2)}\u5E73\u65B9\u5343\u7C73`),C};_h.prototype.getdistance=function(o,A){let f=Kt.fromCartesian(o),m=Kt.fromCartesian(A),C=new l0;C.setEndPoints(f,m);let y=C.surfaceDistance;return y=Math.sqrt(Math.pow(y,2)+Math.pow(m.height-f.height,2)),y};var wAt=_h;function T2(o,A={}){this._earthCtrl=o,this._viewer=o.coreMap,this._scene=o.coreMap.scene,this.options=Ae(A,{}),this._modelArr=[],this._Apositions=[],this.FlattenPolygon=[],this._Loading=Ae(A.loading,!1),this._bottom=Ae(A.bottom,!1),this.loadingImg=Ae(A.loadingImg,`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`),this._Tooltip=new gw(o),this._tooltip=this._Tooltip.CreateTooltip(),this._positions=[],this._deepth=100,this._drawColor={point:Ae(this.options.drawColor?.point,At.BLUE),polyline:Ae(this.options.drawColor?.polyline,At.YELLOW),polygon:Ae(this.options.drawColor?.polygon,At.YELLOW.withAlpha(.5))}}T2.prototype.removeMeasureFromMap=function(){this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=void 0),this.Triangulation=[],this.tinData=void 0,this._tooltip.show(!1)};T2.prototype.startDrawing=function(o={},A){let f=this._scene,m=this._tooltip,C=3,y,x=[],v=[],E=[],I=[],w=[];this._positions=v,this._hierarchy=E,this._heightsort=I,this._degreesArr=w,this._deepth=Ae(o.deepth,100),this._modelArr=Ae(o.modelArr,[]);let Q=this;if(this._mouseHandler&&this._mouseHandler.destroy(),this.loading||this.addLoading(),o.positions){let M=ee.fromDegreesArray(o.positions);for(let B of M)v.push(B);if(!(v.length<C)){for(let B=0;B<o.positions.length;B+=2)w.push([o.positions[B],o.positions[B+1]]);console.log(v,"\u4F4D\u7F6E\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A"),this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:ee.fromDegreesArray(o.positions),material:Q._drawColor.polygon,fill:!0}});for(let B=0;B<o.positions.length;B+=2){let T=Q._viewer.scene.sampleHeight(new Kt(je.toRadians(o.positions[B]),je.toRadians(o.positions[B+1])));I.push(T),E.push(o.positions[B],o.positions[B+1],T)}this._Apositions=o.positions,this.stopDrawing(B=>{A&&A(B)})}}else{let M=new Ur(f.canvas);this._mouseHandler=M,this.removeMeasureFromMap(),this._viewer.container.style.cursor=`url(${globalThis.GEOWORLD_BASE_URL} 'Workers/image/cursor/draw.cur')`;let B;M.setInputAction(function(T){if(T.position!==null){let D=f.camera.getPickRay(T.position),F=f.globe.pick(D,f);if(this._viewer.scene.pick(T.position)){let R=this._viewer.scene.pickPosition(T.position);R&&(F=R)}if(F){let R=Kt.fromCartesian(F),k=je.toDegrees(R.longitude),U=je.toDegrees(R.latitude);if(x.length===0&&(x.push(k,U),w.push([k,U]),v.push(F),y=F),v.length>=4){let V=Ss.wgs84ToWindowCoordinates(this._viewer.scene,y);if(V!==void 0){let H=V.x-T.position.x,q=V.y-T.position.y;if(H*H+q*q<16){x.splice(x.length-2,2),v.pop(),this.stopDrawing(A);return}}}x.push(k,U),w.push([k,U]),v.push(F),v.length===2&&!B&&(B=this._viewer.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new Bn(function(){return v},!1),clampToGround:!0,material:Q._drawColor.polygon,width:3}})),v.length===C&&(B&&this._viewer.entities.remove(B),this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:new Un(ee.fromDegreesArray(x)),material:Q._drawColor.polygon,fill:!0}}),this._prevEntity.polygon.hierarchy=new Bn(()=>new Un(ee.fromDegreesArray(x)),!1))}}}.bind(this),Ki.LEFT_CLICK),M.setInputAction(function(T){let D=T.endPosition;if(D!==null)if(v.length===0)m.showAt(D,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7B2C\u4E00\u4E2A\u70B9");else{let F=f.camera.getPickRay(D),L=f.globe.pick(F,f),R=this._viewer.scene.pick(D),k=!1;if(R){let U=this._viewer.scene.pickPosition(D);U&&(L=U),k=!0}if(L){let U=Kt.fromCartesian(L),V=je.toDegrees(U.longitude),H=je.toDegrees(U.latitude);if(x.splice(x.length-2,2),w.pop(),v.pop(),x.push(V,H),w.push([V,H]),v.push(L),m.showAt(D,"\u53F3\u952E\u7ED3\u675F\u7ED8\u5236"),v.length>=3&&v.length>=4){let q=Ss.wgs84ToWindowCoordinates(this._viewer.scene,y);if(q!==void 0){let ie=q.x-D.x,Z=q.y-D.y;ie*ie+Z*Z<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}}.bind(this),Ki.MOUSE_MOVE),M.setInputAction(function(T){this.end&&this.end()}.bind(this),Ki.RIGHT_CLICK),this.end=T=>{if(this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),Q._viewer.container.style.cursor="default",this._tooltip.show(!1),B&&this._viewer.entities.remove(B),this.end=void 0,console.log(w,"?????????"),!(v.length<C)){if(this._prevEntity&&(this._prevEntity.polygon.hierarchy=ee.fromDegreesArray(x)),T==="cancel"){this._prevEntity&&this._viewer.entities.remove(this._prevEntity);return}for(let D=0;D<x.length;D+=2){let F=Q._viewer.scene.sampleHeight(new Kt(je.toRadians(x[D]),je.toRadians(x[D+1])));I.push(F),E.push(x[D],x[D+1],F)}this._Apositions=x,this.stopDrawing(A)}}}};T2.prototype.stopDrawing=function(o){let A=this;this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._Loading&&this.isLoading(!0),setTimeout(()=>{A._heightsort.sort(function(m,C){return m-C});let f=null;A._bottom?(f=this._viewer.entities.add({name:null,id:A._earthCtrl.factory.createUUID(),polygon:{hierarchy:new Bn(function(){return new Un(ee.fromDegreesArrayHeights(A._hierarchy))},!1),material:new z0({image:Ae(A.bottomImgUrl,`${window.SmartEarthRootUrl}Workers/image/bottomplane.jpg`),repeat:new It(1,1)})}}),A._baseHeight=A._heightsort[0]-A._deepth,f.polygon.height=A._baseHeight):f=this._viewer.entities.add({name:null,id:A._earthCtrl.factory.createUUID(),polygon:{hierarchy:new Bn(function(){return new Un(ee.fromDegreesArrayHeights(A._hierarchy))},!1),material:At.YELLOW.withAlpha(0)}}),A.FlattenPolygon.push(f),A.modelCutting()})};T2.prototype.modelCutting=function(){let o=this;if(o._modelCuttingPolygon=rh.fromPositions({positions:ee.fromDegreesArray(o._Apositions),height:o._baseHeight}),o._modelArr.length>0)for(let A of o._modelArr)A.addFlattenPolygon(o._modelCuttingPolygon),A.needUpdateFlatten=!0,A.clipPlaneOfFlatten=!0;else console.info("\u8BF7\u6DFB\u52A0\u6A21\u578B\uFF01")};T2.prototype.removeModelCutting=function(){let o=this;if(o._modelArr.length>0){for(let A of o._modelArr)A.removeFlattenPolygon(o._modelCuttingPolygon);o._modelCuttingPolygon=null,o._modelArr=[]}};T2.prototype.removeFromMap=function(){if(this.removeMeasureFromMap(),this.FlattenPolygon&&this.FlattenPolygon.length>0){for(let o=0;o<this.FlattenPolygon.length;o++)this._viewer.entities.remove(this.FlattenPolygon[o]);this.FlattenPolygon=[]}this.removeModelCutting()};T2.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=this.loadingImg,o.appendChild(A),this.loading=o,this._viewer.container.appendChild(o)};T2.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};T2.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};var bAt=T2;function M2(o,A={}){this._earthCtrl=o,this._viewer=o.coreMap,this._scene=o.coreMap.scene,this.options=Ae(A,{}),this._Apositions=[],this.FlattenPolygon=[],this._terrainFlatten=new IN(o.coreMap.scene),this._Loading=Ae(A.loading,!1),this._bottom=Ae(A.bottom,!1),this.loadingImg=Ae(A.loadingImg,`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`),this._Tooltip=new gw(o),this._tooltip=this._Tooltip.CreateTooltip(),this._positions=[],this._deepth=10,this._drawColor={point:Ae(this.options.drawColor?.point,At.BLUE),polyline:Ae(this.options.drawColor?.polyline,At.YELLOW),polygon:Ae(this.options.drawColor?.polygon,At.YELLOW.withAlpha(.5))}}M2.prototype.removeMeasureFromMap=function(){this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=void 0),this.Triangulation=[],this.tinData=void 0,this._tooltip.show(!1)};M2.prototype.startDrawing=function(o={},A){let f=this._scene,m=this._tooltip,C=3,y,x=[],v=[],E=[],I=[],w=[];this._positions=v,this._hierarchy=E,this._heightsort=I,this._degreesArr=w,this._deepth=Ae(o.deepth,100);let Q=this;if(this._mouseHandler&&this._mouseHandler.destroy(),this.loading||this.addLoading(),o.positions){let M=ee.fromDegreesArray(o.positions);for(let B of M)v.push(B);if(!(v.length<C)){for(let B=0;B<o.positions.length;B+=2)w.push([o.positions[B],o.positions[B+1]]);this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:ee.fromDegreesArray(o.positions),material:Q._drawColor.polygon,fill:!0}});for(let B=0;B<o.positions.length;B+=2){let T=Q._viewer.scene.sampleHeight(new Kt(je.toRadians(o.positions[B]),je.toRadians(o.positions[B+1])));I.push(T),E.push(o.positions[B],o.positions[B+1],T)}this._Apositions=o.positions,this.stopDrawing(B=>{A&&A(B)})}}else{let M=new Ur(f.canvas);this._mouseHandler=M,this.removeMeasureFromMap(),this._viewer.container.style.cursor=`url(${globalThis.GEOWORLD_BASE_URL} 'Workers/image/cursor/draw.cur')`;let B;M.setInputAction(function(T){if(T.position!==null){let D=f.camera.getPickRay(T.position),F=f.globe.pick(D,f);if(this._viewer.scene.pick(T.position)){let R=this._viewer.scene.pickPosition(T.position);R&&(F=R)}if(F){let R=Kt.fromCartesian(F),k=je.toDegrees(R.longitude),U=je.toDegrees(R.latitude);if(x.length===0&&(x.push(k,U),w.push([k,U]),v.push(F),y=F),v.length>=4){let V=Ss.wgs84ToWindowCoordinates(this._viewer.scene,y);if(V!==void 0){let H=V.x-T.position.x,q=V.y-T.position.y;if(H*H+q*q<16){x.splice(x.length-2,2),v.pop(),this.stopDrawing(A);return}}}x.push(k,U),w.push([k,U]),v.push(F),v.length===2&&!B&&(B=this._viewer.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new Bn(function(){return v},!1),clampToGround:!0,material:Q._drawColor.polygon,width:3}})),v.length===C&&(B&&this._viewer.entities.remove(B),this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:new Un(ee.fromDegreesArray(x)),material:Q._drawColor.polygon,fill:!0}}),this._prevEntity.polygon.hierarchy=new Bn(()=>new Un(ee.fromDegreesArray(x)),!1))}}}.bind(this),Ki.LEFT_CLICK),M.setInputAction(function(T){let D=T.endPosition;if(D!==null)if(v.length===0)m.showAt(D,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7B2C\u4E00\u4E2A\u70B9");else{let F=f.camera.getPickRay(D),L=f.globe.pick(F,f),R=this._viewer.scene.pick(D),k=!1;if(R){let U=this._viewer.scene.pickPosition(D);U&&(L=U),k=!0}if(L){let U=Kt.fromCartesian(L),V=je.toDegrees(U.longitude),H=je.toDegrees(U.latitude);if(x.splice(x.length-2,2),w.pop(),v.pop(),x.push(V,H),w.push([V,H]),v.push(L),m.showAt(D,"\u53F3\u952E\u7ED3\u675F\u7ED8\u5236"),v.length>=3&&v.length>=4){let q=Ss.wgs84ToWindowCoordinates(this._viewer.scene,y);if(q!==void 0){let ie=q.x-D.x,Z=q.y-D.y;ie*ie+Z*Z<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}}.bind(this),Ki.MOUSE_MOVE),M.setInputAction(function(T){this.end&&this.end()}.bind(this),Ki.RIGHT_CLICK),this.end=T=>{if(this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),Q._viewer.container.style.cursor="default",this._tooltip.show(!1),B&&this._viewer.entities.remove(B),this.end=void 0,console.log(w,"?????????"),!(v.length<C)){if(this._prevEntity&&(this._prevEntity.polygon.hierarchy=ee.fromDegreesArray(x)),T==="cancel"){this._prevEntity&&this._viewer.entities.remove(this._prevEntity);return}for(let D=0;D<x.length;D+=2){let F=Q._viewer.scene.sampleHeight(new Kt(je.toRadians(x[D]),je.toRadians(x[D+1])));I.push(F),E.push(x[D],x[D+1],F)}this._Apositions=x,this.stopDrawing(A)}}}};M2.prototype.stopDrawing=function(o){let A=this;this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._Loading&&this.isLoading(!0),setTimeout(()=>{A._heightsort.sort(function(C,y){return C-y});let f=null;A._bottom?(f=this._viewer.entities.add({name:null,id:A._earthCtrl.factory.createUUID(),polygon:{hierarchy:new Bn(function(){return new Un(ee.fromDegreesArrayHeights(A._hierarchy))},!1),material:new z0({image:Ae(A.bottomImgUrl,`${window.SmartEarthRootUrl}Workers/image/bottomplane.jpg`),repeat:new It(1,1)})}}),A._baseHeight=A._heightsort[0]-A._deepth,f.polygon.height=A._baseHeight):f=this._viewer.entities.add({name:null,id:A._earthCtrl.factory.createUUID(),polygon:{hierarchy:new Bn(function(){return new Un(ee.fromDegreesArrayHeights(A._hierarchy))},!1),material:At.YELLOW.withAlpha(0)}}),A.FlattenPolygon.push(f);let m=[];A._baseHeight=A._heightsort[0]-A._deepth;for(let C=0;C<A._hierarchy.length;C+=3)m.push(A._hierarchy[C],A._hierarchy[C+1],A._baseHeight);console.log(m,"\u4F4D\u7F6E\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A"),A.terrainCutting(m)})};M2.prototype.terrainCutting=function(o){let A=this;A._terrainFlatten.addPolygon(o),A._terrainFlatten.update(),A._terrainFlatten.clipPlaneOfFlatten=!0};M2.prototype.removeTerrainCutting=function(){this._terrainFlatten.clearPolygon()};M2.prototype.removeFromMap=function(){if(this.removeMeasureFromMap(),this.FlattenPolygon&&this.FlattenPolygon.length>0){for(let o=0;o<this.FlattenPolygon.length;o++)this._viewer.entities.remove(this.FlattenPolygon[o]);this.FlattenPolygon=[]}this.removeTerrainCutting()};M2.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=this.loadingImg,o.appendChild(A),this.loading=o,this._viewer.container.appendChild(o)};M2.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};M2.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};var QAt=M2;function pw(o,A={}){this._earthCtrl=o,this._terrainFlatten=new IN(this._earthCtrl.coreMap.scene),this._viewer=o.coreMap,this._scene=o.coreMap.scene,this.options=Ae(A,{}),this._Tooltip=new gw(o),this._tooltip=this._Tooltip.CreateTooltip(),this._drawColor={point:Ae(this.options.drawColor?.point,At.BLUE),polyline:Ae(this.options.drawColor?.polyline,At.YELLOW),polygon:Ae(this.options.drawColor?.polygon,At.YELLOW.withAlpha(.5))},this.loadingImg=`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`,this.wallArr=[],this.FlattenPolygon=[],this._Apositions=[],this._heightsort=null,this._deepth=100,this._positions=[],this._modelArr=Ae(A.modelArr,[]),this._isFlattening=Ae(A.isFlattening,!0),this.modelCuttingPolygon=null,this.wallImgUrl=Ae(A.wallImgUrl,null),this.bottomImgUrl=Ae(A.bottomImgUrl,null),this._Loading=Ae(A.loading,!0)}pw.prototype.removeMeasureFromMap=function(){this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=void 0),this.Triangulation=[],this.tinData=void 0,this._tooltip.show(!1)};pw.prototype.removeFromMap=function(){if(this.removeMeasureFromMap(),this.wallArr.length>0){for(let o=0;o<this.wallArr.length;o++)this._viewer.entities.remove(this.wallArr[o]);this.wallArr=[]}if(this.FlattenPolygon&&this.FlattenPolygon.length>0){for(let o=0;o<this.FlattenPolygon.length;o++)this._viewer.entities.remove(this.FlattenPolygon[o]);this.FlattenPolygon=[]}this.removeModelCutting()};pw.prototype.deleteObject=pw.prototype.removeFromMap;pw.prototype.startDrawing=function(o={},A){let f=Ae(o.spacing,"auto"),m=this._scene,C=this._tooltip,y=3,x=this._positions,v=[],E;this._Apositions=o.positions,this._heightsort=v,this._deepth=Ae(o.deepth,100),this._sampleStep=Ae(o.sampleStep,100),this._maxSampleCount=Ae(o.maxSampleCount,200),this._drawColor.point=o.point||this._drawColor.point,this._drawColor.polyline=o.polyline||this._drawColor.polyline,this._drawColor.polygon=o.polygon||this._drawColor.polygon,this.loadingImg=o.loading||this.loadingImg;let I=this;if(this._mouseHandler&&this._mouseHandler.destroy(),this.loading||this.addLoading(),!o.positions){let w=new Ur(m.canvas);this._mouseHandler=w,this.removeMeasureFromMap(),this._viewer.container.style.cursor=`url(${globalThis.GEOWORLD_BASE_URL} 'Assets/image/cursor/draw.cur')`;let Q;w.setInputAction(function(B){if(B.position!==null){let T=this._viewer.scene.pickPosition(B.position);if(T){let D=Kt.fromCartesian(T);if(x.length===0&&(x.push(D),E=T),x.length>=4){let F=Ss.wgs84ToWindowCoordinates(this._viewer.scene,E);if(F!==void 0){let L=F.x-B.position.x,R=F.y-B.position.y;if(L*L+R*R<16){x.splice(x.length-2,2),this.stopDrawing(A);return}}}x.push(D),x.length===2&&!Q&&(Q=this._viewer.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new Bn(function(){let F=[];for(let L=0;L<x.length;L++){let R=x[L];F.push(R.longitude,R.latitude,R.height)}return ee.fromRadiansArrayHeights(F)},!1),clampToGround:!1,material:I._drawColor.polygon,width:3}})),x.length===y&&(Q&&this._viewer.entities.remove(Q),this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:new Bn(()=>{let F=[];for(let L=0;L<x.length;L++){let R=x[L];F.push(R.longitude,R.latitude,R.height)}return new Un(ee.fromRadiansArrayHeights(F))},!1),material:I._drawColor.polygon,fill:!0}}))}}}.bind(this),Ki.LEFT_CLICK),w.setInputAction(function(B){let T=B.endPosition;if(T!==null)if(x.length===0)C.showAt(T,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7B2C\u4E00\u4E2A\u70B9");else{let D=this._viewer.scene.pickPosition(T);if(D){let F=Kt.fromCartesian(D);if(x.splice(x.length-1,1),x.push(F),C.showAt(T,"\u53F3\u952E\u7ED3\u675F\u7ED8\u5236"),x.length>=3&&x.length>=4){let L=Ss.wgs84ToWindowCoordinates(this._viewer.scene,E);if(L!==void 0){let R=L.x-T.x,k=L.y-T.y;R*R+k*k<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}}.bind(this),Ki.MOUSE_MOVE);let M=null;w.setInputAction(function(B){M=window.setTimeout(()=>{console.log("\u5355\u51FB"),this.end&&this.end()},200)}.bind(this),Ki.RIGHT_CLICK),w.setInputAction(function(B){console.log("\u53CC\u51FB......"),clearTimeout(M)},Ki.LEFT_DOUBLE_CLICK),this.end=B=>{if(this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),I._viewer.container.style.cursor="default",this._tooltip.show(!1),Q&&this._viewer.entities.remove(Q),this.end=void 0,!(x.length<y)){if(this._prevEntity&&this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0,B==="cancel")return;for(let T=0;T<x.length;T+=2){let D=x[T].height;v.push(D)}this._Apositions=x,this.stopDrawing(f,A)}}}return this};function TLi(o,A,f){let m=je.lerp(o.longitude,A.longitude,1/f)-o.longitude,C=je.lerp(o.latitude,A.latitude,1/f)-o.latitude,y=[];y.push(o);for(let x=0;x<f;x++){let v=o.longitude+(x+1)*m,E=o.latitude+(x+1)*C;y.push(new Kt(v,E))}return y.push(A),y}function MLi(o,A,f,m,C){let y=[];A.forEach(function(x){let v=Kt.toCartesian(new Kt(x.longitude,x.latitude,m)),E=Kt.toCartesian(new Kt(x.longitude,x.latitude,f)),I=ee.normalize(ee.subtract(E,v,new ee),new ee),w=new ls(v,I),Q=null,M=[],B=o.scene.drillPickFromRay(w,1,M);o.scene.globe.show=!1,B.length>0&&!B[0].object&&B[0].position?(Q=o.scene.drillPickFromRay(w,100,M),Q.unshift(B[0])):Q=o.scene.drillPickFromRay(w,100,M),o.scene.globe.show=!0,y.push(Q)}),typeof C=="function"&&C(y)}function PLi(o,A,f){for(let y=0;y<o.length;y++){let x=o[y];for(let v=0;v<x.length;v++){let E=x[v].position,I=Kt.fromCartesian(E);if(I.height<A){x.splice(v,x.length-v);let w=ee.fromRadians(I.latitude,I.longitude,A);x.push({object:null,position:w});break}}{let v=x[x.length-1].position,E=Kt.fromCartesian(v);if(Math.abs(E.height-A)>.01){let I=ee.fromRadians(E.latitude,E.longitude,A);x.push({object:null,position:I})}}{let v=x[x.length-1].position,E=Kt.fromCartesian(v);console.log("di",E.height)}}for(let y=0;y<o.length;y++){let x=o[y],v=x[x.length-1];f.push(v.position)}let m=0;o.forEach(function(y){m=m<y.length?y.length:m}),o.forEach(function(y){if(m-y.length>0){let v=y.length;y.length=m,y.fill(null,v,y.length)}});let C=[];for(let y=0;y<m-1;y++){let x=[],v=[];for(let E=0;E<o.length;E++){let I=o[E][y],w=o[E][y+1];I&&w&&(x.push(I),v.push(w))}C.push({ups:x,bottoms:v})}return C}pw.prototype.stopDrawing=function(o,A){let f=this;this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._Loading&&this.isLoading(!0);let m=this._positions,C=this._viewer,y=this.wallArr,x=this._deepth,v=this._sampleStep,E=this._maxSampleCount;m.push(m[0]);let I=0;for(let w=0;w<m.length-1;w++){let Q=ee.fromRadians(m[w].longitude,m[w].latitude,m[w].height),M=ee.fromRadians(m[w+1].longitude,m[w+1].latitude,m[w+1].height),T=ee.distance(M,Q)/v;I=I<T?T:I}I=E<I?E:I,I=260,setTimeout(()=>{f._heightsort.sort(function(D,F){return D-F});let w=f._heightsort[0]+2e3,Q=f._heightsort[0]-2e3,M=[];for(let D=0;D<m.length-1;D++){let F=m[D],L=m[D+1],R=TLi(F,L,I);MLi(C,R,Q,w,function(k){let U=PLi(k,x,M);for(let V=0;V<U.length;V++){let H=U[V];y.push(RLi(C,H,V))}})}let B=[];for(let D=0;D<m.length;D++){let F=m[D];B.push(F.longitude,F.latitude,x)}let T=C.entities.add({polygon:{hierarchy:{positions:ee.fromRadiansArrayHeights(B)},perPositionHeight:!0,granularity:je.RADIANS_PER_DEGREE*100,material:new z0({image:`${globalThis.GEOWORLD_BASE_URL}Workers/image/bottomplane.jpg`,repeat:new It(1,1)}),fill:!0}});return y.push(T),f._isFlattening&&f.modelCutting(),A&&A(!0),this.isLoading(!1)},20)};pw.prototype.modelCutting=function(){let o=this,A=this._deepth,f=this._positions,m=[],C=[];for(let y=0;y<f.length;y++){let x=f[y];m.push(x.longitude,x.latitude,x.height-10),C.push(je.toDegrees(x.longitude),je.toDegrees(x.latitude),x.height-10)}if(o._modelCuttingPolygon=rh.fromPositions({positions:ee.fromRadiansArrayHeights(m),height:A-10}),o._terrainFlatten.addPolygon(C),o._terrainFlatten.update(),o._terrainFlatten.clipPlaneOfFlatten=!0,o._modelArr.length>0)for(let y of o._modelArr)y.addFlattenPolygon(o._modelCuttingPolygon),y.needUpdateFlatten=!0,y.clipPlaneOfFlatten=!0;else console.info("\u8BF7\u6DFB\u52A0\u6A21\u578B\uFF01")};pw.prototype.removeModelCutting=function(){let o=this;if(o._modelArr.length>0){for(let A of o._modelArr)A.removeFlattenPolygon(o._modelCuttingPolygon);o._modelCuttingPolygon=null,o._modelArr=[],o._terrainFlatten.clearPolygon(),o._terrainFlatten.clipPlaneOfFlatten=!1}else console.info("\u8BF7\u6DFB\u52A0\u6A21\u578B\uFF01")};function RLi(o,A,f){let m=[],C=[];for(let I=0;I<A.ups.length;I++){let w=A.ups[I];m.push(w.position);let Q=Kt.fromCartesian(w.position);C.push(Q.height)}let y=[];for(let I=0;I<A.bottoms.length;I++){let w=A.bottoms[I],Q=Kt.fromCartesian(w.position);y.push(Q.height)}let x=`${globalThis.GEOWORLD_BASE_URL}Workers/image/MTY0001.jpg`,v=`${globalThis.GEOWORLD_BASE_URL}Workers/image/MTY0002.jpg`,E=o.entities.add({wall:{positions:m,material:new z0({image:f%2?x:v,repeat:new It(.01,.01)}),maximumHeights:C,minimumHeights:y,granularity:je.RADIANS_PER_DEGREE*100}});return E.show=!0,E}pw.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=this.loadingImg,o.appendChild(A),this.loading=o,this._viewer.container.appendChild(o)};pw.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};pw.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};var SAt=pw;function id(o){this._earthCtrl=o,this._coreMap=o.coreMap,this.tools=[],this.vols=[],this.saveResult=!1}id.prototype.getDistanceSpace=function(o){this.saveResult===!1&&this.deleteObject(),this._tool=new NW(this._earthCtrl),this._tool.spaceDistance(o),this.tools.push(this._tool)};id.prototype.getDistanceHorizontal=function(o){this.saveResult===!1&&this.deleteObject(),this._tool=new NW(this._earthCtrl),this._tool.horizontalDistance(o),this.tools.push(this._tool)};id.prototype.deleteObject=function(){O(this._tool)&&this._tool.deleteObject(),this.saveResult===!1&&this.tools.pop()};id.prototype.deleteAll=function(){this.tools.forEach(function(o){o.deleteObject()}),this.vols.forEach(function(o){o.cleanUp()}),this._earthCtrl.measure.tools.forEach(function(o){o.clearResult()}),this.tools=[],this.vols=[],this._earthCtrl.measure.tools=[]};id.prototype.saveResults=function(o){this.saveResult=o};id.prototype.getPlaneArea=function(o){this.saveResult===!1&&this.deleteObject(),this._tool=new NW(this._earthCtrl),this._tool.getPlaneArea(o),this.tools.push(this._tool)};id.prototype.getSurfaceArea3d=function(o){this.saveResult===!1&&this.deleteObject(),this._tool=new NW(this._earthCtrl),this._tool.getSurfaceArea3d(o),this.tools.push(this._tool)};id.prototype.volumetric=function(o){this.saveResult===!1&&this.removeVolumetric(),this._vol=new Ile(this._earthCtrl),this._vol.startDrawing(o),this.vols.push(this._vol)};id.prototype.removeVolumetric=function(o){O(this._vol)&&this.vols.forEach(function(A){A.cleanUp()})};id.prototype.lineOfSight=function(o){this._tool=new BAt(this._earthCtrl),this._tool.createLineOfSight(o),this.tools.push(this._tool)};id.prototype.createViewShed=function(o){return new Ele(this._earthCtrl,o)};id.prototype.createSubmergence=function(o){return new _le(this._earthCtrl,o)};id.prototype.createProfile=function(o){return new Ble(this._earthCtrl,o)};id.prototype.createBufferAnalysis=function(o){return new Yre(this._earthCtrl,o)};id.prototype.createSkyline=function(o){return new ble(this._earthCtrl,o)};id.prototype.createCurtainContrast=function(o){return new xAt(this._earthCtrl,o)};id.prototype.createRestrictTheHeight=function(o){return new Sle(this._earthCtrl,o)};id.prototype.createModifyMesh=function(o,A){return new Dle(this._earthCtrl).addClipping(o,A)};id.prototype.createTerrainModifier=function(o){return new Tle(this._earthCtrl,o)};id.prototype.createTerrainExcavation=function(o){return new Rle(this._earthCtrl,o)};id.prototype.createExcavationAndFillAnalysis=function(o){return new Ple(this._earthCtrl,o)};id.prototype.createVolumetricMeasure=function(o){return new _At(this._earthCtrl,o)};id.prototype.createModelVolumetric=function(o){return new wAt(this._earthCtrl,o)};id.prototype.createModelCutting=function(o){return new bAt(this._earthCtrl,o)};id.prototype.createTerrainCutting=function(o){return new QAt(this._earthCtrl,o)};id.prototype.createModelSection=function(o){return new SAt(this._earthCtrl,o)};var Fle=id;function Nle(o,A){if(this._earthCtrl=o,!O(A.flagHtml))throw new Ui("flagDiv is required.");this._flagHtml=A.flagHtml,this._options=Ae(A,Ae.EMAIL),this._circleRadius=Ae(A.circleRadius,10),this._lon=Ae(A.lon,121),this._lat=Ae(A.lat,31),this._height=Ae(A.height,0),this._show=Ae(A.show,!0),this._flagScale=Ae(A.flagScale,4),this._circleColor=Ae(A.circleColor,At.RED),this._cylinderColor=Ae(A.cylinderColor,At.YELLOWGREEN),this._duration=Ae(A.duration,2e3),this._gradient=Ae(A.gradient,2),this._count=Ae(A.count,2),this._canvasZoom=Ae(A.canvasZoom,10),this._circleEntity=void 0,this._cylinderEntity=void 0,this._lineEntity=void 0,this._htmlPlaneEntity=void 0,this._linePlaneEntity=void 0,this._flagDiv=document.createElement("div"),this._flagDiv.style.opacity="0.7",this._flagDiv.style.margin="0",this._flagDiv.style.padding="0",this._flagDiv.id=Ae(A.id,Vu()),this._flagDiv.innerHTML=this._flagHtml,this._show&&this.addToMap()}Nle.prototype.removeFromMap=function(){O(this._circleEntity)&&(this._earthCtrl.entities.remove(this._circleEntity),this._circleEntity=void 0),O(this._cylinderEntity)&&(this._earthCtrl.entities.remove(this._cylinderEntity),this._cylinderEntity=void 0),O(this._lineEntity)&&(this._earthCtrl.entities.remove(this._lineEntity),this._lineEntity=void 0),O(this._linePlaneEntity)&&(this._earthCtrl.entities.remove(this._linePlaneEntity),this._linePlaneEntity=void 0),O(this._htmlPlaneEntity)&&(this._earthCtrl.entities.remove(this._htmlPlaneEntity),this._htmlPlaneEntity=void 0)};Nle.prototype.addToMap=function(){let o=this,A=0,f=2,m,C=ee.fromDegrees(o._lon,o._lat,o._height);if(O(o._circleEntity)||(o._circleEntity=o._earthCtrl.entities.add({position:C,ellipse:{height:o._height,semiMinorAxis:o._circleRadius,semiMajorAxis:o._circleRadius,material:new Z8({duration:o._duration,gradient:o._gradient,color:o._circleColor,count:o._count})}})),!O(o._cylinderEntity)){let v=o._circleRadius*2/5,E=o._circleRadius*3/4;m=dQ.changeCartesian3Height(C,E/2),o._cylinderEntity=o._earthCtrl.entities.add({position:m,cylinder:{length:E,topRadius:v,bottomRadius:v,fill:!0,outline:!1,material:o._cylinderColor}})}if(O(o._lineEntity)||(A=o._circleRadius*o._flagScale+o._height,o._lineEntity=o._earthCtrl.entities.add({polyline:{width:f,positions:ee.fromDegreesArrayHeights([o._lon,o._lat,o._height,o._lon,o._lat,A]),material:o._cylinderColor}})),!O(o._htmlPlaneEntity)){A=o._circleRadius*o._flagScale;let v=A/5,E=v*3,I=A-v/2,w=4*f,Q=new ee(w/2,0,I),M=dQ.changeCartesian3ByScalar(C,Q);this._linePlaneEntity=o._earthCtrl.entities.add({position:M,plane:{plane:new Wa(ee.UNIT_Y,0),dimensions:new It(w,v),material:o._cylinderColor}});let B=new ee(E/2+w,0,I);m=dQ.changeCartesian3ByScalar(C,B);let T=o._flagDiv,D=o._canvasZoom,F=document.createElement("canvas");F.width=10*v/E*D,F.height=10*D,lH.drawDocument(T,F,{zoom:D}).then(function(L){o._htmlPlaneEntity=o._earthCtrl.entities.add({position:new Bn(y,!1),plane:{plane:new Bn(x,!0),dimensions:new It(E,v),material:new z0({image:L.image,transparent:!0})}})},function(L){console.info(L)})}function y(){return m}function x(){let v=new ee;return v=ee.negate(ee.UNIT_Y,v),new Wa(v,0)}};Object.defineProperties(Nle.prototype,{});var DAt=Nle;function kle(o,A){this._earthCtrl=o,this._scene=o.coreMap.scene,this._options=O(A,Ae.EMPTY_OBJECT),this._color=Ae(A.color,At.RED),this._lon=Ae(A.lon,121),this._lat=Ae(A.lat,31),this._height=Ae(A.height,0),this._statistics=Ae(A.statisticData,1e3),this._radius=Ae(A.radius,100),this._duration=Ae(A.duration,2e3),this._gradient=Ae(A.gradient,2),this._count=Ae(A.count,2),this._scale=Ae(A.dataScale,1),this._show=Ae(A.show,!0),this._billboardWidthRatio=Ae(A.billboardWidthRatio,1.2),this._billboardHeightRatio=Ae(A.billboardHeightRatio,2.4),this._prefix=Ae(A.prefix,""),this._scaleByDistance=Ae(A.scaleByDistance,new To(1500,3,15e3,.1)),this._topFillColor=Ae(A.topFillColor,At.fromCssColorString("#323232")),this._circleEntity=void 0,this._cylinderEntity=void 0,this._billboardEntity=void 0,this._position=ee.fromDegrees(this._lon,this._lat,this._height),this._show&&this.addToMap()}var RN=new ee;kle.prototype.addToMap=function(){let o=this;if(O(o._circleEntity)||(o._circleEntity=o._earthCtrl.entities.add({position:o._position,ellipse:{height:o._height,semiMinorAxis:o._radius,semiMajorAxis:o._radius,material:new Z8({duration:o._duration,gradient:o._gradient,color:o._color,count:o._count})}})),!O(o._cylinderEntity)){RN=ee.clone(o._position,RN);let A=o._statistics*o._scale,f=Vn.eastNorthUpToFixedFrame(RN),m=new ee(0,0,A/2);Xe.multiplyByPoint(f,m,RN),o._cylinderEntity=o._earthCtrl.entities.add({position:RN,cylinder:{length:A,topRadius:o._radius/10,bottomRadius:o._radius/10,fill:!0,outline:!1,material:o._color}})}if(!O(o._billboardEntity)){RN=ee.clone(o._position,RN);let A=o._cylinderEntity.cylinder.length._value,f=Kt.fromCartesian(RN),m=ee.fromRadians(f.longitude,f.latitude,f.height+A);o._billboardEntity=o._earthCtrl.entities.add({position:m,billboard:{scaleByDistance:o._scaleByDistance,verticalOrigin:bn.BOTTOM,width:o._radius/o._billboardWidthRatio,height:o._radius/o._billboardHeightRatio,image:NLi(o._color,o._topFillColor,o._prefix+o._statistics,o._radius).toDataURL()}})}};kle.prototype.removeFromMap=function(){O(this._cylinderEntity)&&(this._earthCtrl.entities.remove(this._cylinderEntity),this._cylinderEntity=void 0),O(this._circleEntity)&&(this._earthCtrl.entities.remove(this._circleEntity),this._circleEntity=void 0),O(this._billboardEntity)&&(this._earthCtrl.entities.remove(this._billboardEntity),this._billboardEntity=void 0)};function LLi(o,A,f,m){o.save(),o.strokeStyle="rgba(0,0,0,0)",o.scale(m/150,m/100),o.save(),o.fillStyle=A.toCssColorString(),o.lineWidth=4,o.beginPath(),o.moveTo(77.8,82.1),o.lineTo(64.6,69),o.lineTo(23.8,69),o.bezierCurveTo(20.8,69,18.3,66.5,18.3,63.5),o.lineTo(18.3,22.5),o.bezierCurveTo(18.3,19.5,20.8,17,23.8,17),o.lineTo(131.8,17),o.bezierCurveTo(134.8,17,137.3,19.5,137.3,22.5),o.lineTo(137.3,63.5),o.bezierCurveTo(137.3,66.5,134.8,69,131.8,69),o.lineTo(90.9,69),o.lineTo(77.8,82.1),o.closePath(),o.moveTo(23.8,18),o.bezierCurveTo(21.3,18,19.3,20,19.3,22.5),o.lineTo(19.3,63.5),o.bezierCurveTo(19.3,66,21.3,68,23.8,68),o.lineTo(65,68),o.lineTo(77.7,80.7),o.lineTo(90.5,68),o.lineTo(131.8,68),o.bezierCurveTo(134.3,68,136.3,66,136.3,63.5),o.lineTo(136.3,22.5),o.bezierCurveTo(136.3,20,134.3,18,131.8,18),o.lineTo(23.8,18),o.closePath(),o.fill(),o.stroke(),o.restore(),o.save(),o.fillStyle=f.toCssColorString(),o.beginPath(),o.moveTo(131.8,18),o.lineTo(23.80000000000001,18),o.bezierCurveTo(21.30000000000001,18,19.30000000000001,20,19.30000000000001,22.5),o.lineTo(19.30000000000001,63.5),o.bezierCurveTo(19.30000000000001,66,21.30000000000001,68,23.80000000000001,68),o.lineTo(65,68),o.lineTo(77.7,80.7),o.lineTo(90.5,68),o.lineTo(131.8,68),o.bezierCurveTo(134.3,68,136.3,66,136.3,63.5),o.lineTo(136.3,22.5),o.bezierCurveTo(136.3,20,134.2,18,131.8,18),o.closePath(),o.fill(),o.stroke(),o.restore(),o.restore()}function FLi(o,A,f){let m=f/1.4,C=m,y=m;A.width>A.height?y=m*(A.height/A.width):A.width<A.height&&(C=m*(A.width/A.height));let x=f/150*8,v=Math.round((f-C+x)/2),E=Math.round((5/6*f-y)/2);o.drawImage(A,v,E,C,y)}function NLi(o,A,f,m){let C=document.createElement("canvas");C.width=m,C.height=m;let y=C.getContext("2d");LLi(y,o,A,m);let x=m,v=N5(f,{font:`bold ${x}pt Microsoft YaHei`,fillColor:o});return FLi(y,v,x),C}Object.defineProperties(kle.prototype,{billboard:{get:function(){return this._billboardEntity}},cylinder:{get:function(){return this._cylinderEntity}},circle:{get:function(){return this._circleEntity}},show:{get:function(){return this._show},set:function(o){O(this._billboardEntity)&&(this._billboardEntity.show=o),O(this._cylinderEntity)&&(this._cylinderEntity.show=o),O(this._circleEntity)&&(this._circleEntity.show=o)}}});var TAt=kle;function dMe(o,A){if(this._earthCtrl=o,this._scene=o.coreMap.scene,this._options=Ae(A,Ae.EMPTY_OBJECT),this._color=Ae(A.color,At.RED),this._lon=Ae(A.lon,121),this._lat=Ae(A.lat,31),this._height=Ae(A.height,0),this._show=Ae(A.show,!0),this._containerWidth=Ae(A.containerWidth,200),this._containerHeight=Ae(A.containerHeight,200),this._containerColor=Ae(A.cylinderColor,At.YELLOWGREEN),this._canvasZoom=Ae(A.canvasZoom,10),this._scaleByDistance=Ae(A.scaleByDistance,new To(1500,3,15e3,.1)),this._tipsHtml=A.tipsHtml,this._tipsEntity=void 0,this._tipsDiv=document.createElement("div"),this._tipsDiv.style.opacity="0.7",this._tipsDiv.style.margin="0",this._tipsDiv.style.padding="0",this._tipsDiv.id=Ae(A.id,Vu()),this._tipsDiv.innerHTML=this._tipsHtml,!O(A.tipsHtml))throw new Ui("tipsHtml is required.");this.addToMap()}dMe.prototype.removeFromMap=function(){O(this._tipsEntity)&&(this._earthCtrl.entities.remove(this._tipsEntity),this._tipsEntity=void 0),O(this._tipsDiv)&&(this._earthCtrl.entities.remove(this._tipsDiv),this._tipsDiv=void 0)};dMe.prototype.addToMap=function(){let o=this,A=ee.fromDegrees(o._lon,o._lat,o._height);if(!O(o._tipsEntity)){let m=o._containerHeight,C=o._containerWidth,y=o._canvasZoom,x=o._tipsDiv,v=document.createElement("canvas");v.width=C,v.height=m,lH.drawDocument(x,v,{zoom:y}).then(function(E){o._tipsEntity=o._earthCtrl.entities.add({position:new Bn(f,!1),billboard:{scaleByDistance:o._scaleByDistance,verticalOrigin:bn.BOTTOM,width:C,height:m,image:E.image.src}})},function(E){console.info(E)})}function f(){return A}};var MAt=dMe;function WO(o,A){this._earthCtrl=o,this._scene=o.coreMap.scene,this._options=Ae(A,Ae.EMPTY_OBJECT),this.element=document.createElement("div"),this._html=Ae(A.html,""),this._lon=Ae(A.lon,121),this._lat=Ae(A.lat,31),this._height=Ae(A.height,10),this._show=Ae(A.show,!0),this._removeHandler=void 0,this._pos=void 0,this._position=void 0,this._c=void 0,this._changedC=void 0,this._point=void 0,this._parameter=A,this._rtti="GwScreenDialog",this.isInit=!1,this.isInit===!1&&this.addToMap()}WO.prototype.setHtml=function(o){this.element.innerHTML=o};WO.prototype.setShow=function(o){if(!this.isInit)return 0;this.element.style.display=o?"block":"none"};WO.prototype.showAt=function(){if(!this.isInit)return 0;this._position&&(this._pos=Ss.wgs84ToWindowCoordinates(this._scene,this._position),this._pos&&(this.element.style.left=`${this._pos.x}px`,this.element.style.top=`${this._pos.y}px`))};WO.prototype.removeFromMap=function(){this.element.remove(),this.isInit=!1};WO.prototype.addToMap=function(){if(this.isInit)return 0;nA(".map-widget",this.element),this.element.innerHTML=this._html,this.element.style.position="absolute",this.isInit=!0,this._position=ee.fromDegrees(this._lon,this._lat,this._height),this.showAt(),this._c=new It(this._pos.x,this._pos.y);let o=this;this._scene.camera.moveStart.addEventListener(function(){o._removeHandler=o._scene.postRender.addEventListener(function(){if(o._c){let A=new L5(Di.WGS84,o._earthCtrl.camera._camera.position);A&&o._position&&(A.isPointVisible(o._position)===!1?o.setShow(!1):(o._show===!0&&o.setShow(!0),o._changedC=Ss.wgs84ToWindowCoordinates(o._scene,o._position),o._changedC?(o._c=o._changedC,o.showAt()):o.setShow(!1)))}})}),this._scene.camera.moveEnd.addEventListener(function(){o._removeHandler&&o._removeHandler.call()})};Object.defineProperties(WO.prototype,{show:{get:function(){return this._show},set:function(o){this._show!==o&&(this._show=o,this.setShow(o))}},html:{get:function(){return this._html},set:function(o){this._html!==o&&(this._html=o,this.setHtml(o))}},lon:{get:function(){return this._lon},set:function(o){this._lon!==o&&(this._lon=o,this._position=ee.fromDegrees(this._lon,this._lat,this._height),this.showAt())}},lat:{get:function(){return this._lat},set:function(o){this._lat!==o&&(this._lat=o,this._position=ee.fromDegrees(this._lon,this._lat,this._height),this.showAt())}},height:{get:function(){return this._height},set:function(o){this._height!==o&&(this._height=o,this._position=ee.fromDegrees(this._lon,this._lat,this._height),this.showAt())}}});var PAt=WO;function OW(o){this._earthCtrl=o,this._coreMap=o.coreMap}OW.prototype.createStatisticFlag=function(o){return new DAt(this._earthCtrl,o)};OW.prototype.createStatisticCylinder=function(o){return new TAt(this._earthCtrl,o)};OW.prototype.createTipsContainer=function(o){return new MAt(this._earthCtrl,o)};OW.prototype.createScreenDialog=function(o){return new PAt(this._earthCtrl,o)};var RAt=OW;function Ole(){var o=["getKeyRecoveryParam","curveType","Input not Buffer","map","_ipad","b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef","setAutoPadding","rejected",'{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}',"dir","transform","ERR_UNKNOWN_ENCODING","mulf","Apr","_verify2","tmp","EncoderBuffer","password","raw","isBoxedPrimitive","onRuntimeInitialized","seqof","addn","sqlite3_bind_double","sum32_5","000000000000000000","bufferedRequest","non-byte EncoderBuffer value","set","ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","_countBits","assign","publicKey","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758","privateExponent","fired","root","isString","invalid sig","WeakMap","modulus must be greater than 1","_sqlite3_result_int64","-e4437ed6010e88286f547fa90abfe4c3","onend","modelDbModelIdList","The argument '","5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b","save","arrayBufferBlockCount","sum64_5_hi","notStrictEqual","sqlite3_column_blob","entry","c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","utf8","c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","readableListening","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865","/dev/stdin","clock","Password","codes","exitKey","a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","SetModelStoreyTransform","fromRed works only with numbers in reduction context","callbackify","e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","worldDirection","494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","byteLength","spread","kdeparams","canvas","7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","_final","not ","createDecipher","chdir","6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c","[object HTMLCollection]","_sqlite3_changes","dataStoreArrayBuffer","Trace","shim","isArgumentsObject","'name' must be a string","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58","isBuf","falling back to ArrayBuffer instantiation","Index out of range","call","[object Object]","emitter","tagged","rsa",'Failed to peek tag: "',"content","Attempt to access memory outside buffer bounds","eject","ERR_FR_TOO_MANY_REDIRECTS","exists","da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","pipe","String","boolean","Rand","_decodeTag","getHighWaterMark","3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","ERR_BUFFER_OUT_OF_BOUNDS","getCiphers","callee","2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06","serialNumber","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc","tinv","ineg","bool","0x8000000000000000","%Object.getOwnPropertyDescriptor%","00000000000000000","sync","maj32",". Build with -s ASSERTIONS=1 for more info.","0x7fffffffffffffff","search","iterator","readInt16LE","0000000000000","ECONNABORTED","join32","d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","imuln","zeroBits","acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","mtime","setRequestHeader","Instance","9333177ztxjEH","imul","worldUp","\x1B[31m"," [Function","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3","utils","toNumber","Number","heartbeat","ended","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375","isNull","stream","ixor","_importPublic","da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","outSize","path=","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589","hmacStrength","trying to set auth tag in unsupported state","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d","fillLast",'"buf" argument must be a Buffer or Uint8Array',"Jul","fromSecret","ETIMEDOUT","content-length","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e","notStrictEqualObject","aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","746590PyDowD","subjectPrivateKey","emitClose","writing","_secret","___errno_location"," ** ","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8","Number is too big","Function","_decode"," and <= ","4446261rhToce","RDNSequence","shift","numstr","oneC","Cancel","readingMore","BasePoint","52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","simpleSieve","getDivisor","charstr","a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","_events","SaveShell","Premature close","/dev/shm","176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ms exceeded","_sqlite3_open",'" argument must be of type number. Received type ',"recoveryParam","HEAP32","00000000000000000000000","onlyShowShells","persEnc","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8","revBin","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573","config","des-ede3","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e","allowHalfOpen","Not implemented yet","copy","computeSecret","Cipher","d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","handlers","Digest already called",`
`}Object.defineProperties(dAt.prototype,{parameter:{get:function(){return this._parameter}},show:{get:function(){return this._pps!==null},set:function(o){o?ELi(this):ILi(this)}},maxHeight:{get:function(){return this._maxHeight},set:function(o){this._maxHeight=o}},minHeight:{get:function(){return this._minHeight},set:function(o){this._minHeight=o}}});var zO=dAt;function xy(o,A){this._earthCtrl=o,this._coreMap=o.coreMap,this._minHeight=Ae(A.minHeight,0),this._maxHeight=Ae(A.maxHeight,0),this._extrudedHeight=Ae(A.extrudedHeight,0),this.shapeTool=void 0,this._speed=Ae(A.speed,1),this._baseWaterColor=Ae(A.baseWaterColor,new At(.2,.3,.6,.5)),this._waterFrequency=Ae(A.waterFrequency,1e3),this._animationSpeed=Ae(A.animationSpeed,.01),this._amplitude=Ae(A.amplitude,10),this._isPolygon=Ae(A.isPolygon,!0),this.eventHelper=new Mx,this._nowHeight=null,this._height=Ae(A.height,void 0),this._type=Ae(A.type,"up")}xy.prototype.drawPolygon=function(o){let A=this;this.shapeTool=A._earthCtrl.shapeTool.createDrawShapeTool(function(f){A.setPolygon({positions:f.result}),o&&o(A)})};xy.prototype.setPolygon=function(o){this.positions=o.positions;let A=this,f=A.computePolygonHeightRange(this.positions);A._minHeight=f.minHeight,A._maxHeight=f.maxHeight,A._extrudedHeight=A._minHeight};xy.prototype.computePolygonHeightRange=function(o){let A=[],f=this._earthCtrl.coreMap;for(let D=0;D<o.length;D++)A.push(o[D].clone());let m,C,y,x,v,E,I,w=0,Q=9999,M=Math.PI/Math.pow(2,11)/64,B=new rh.fromPositions({positions:A,vertexFormat:za.FLAT_VERTEX_FORMAT,granularity:M}),T=new rh.createGeometry(B);for(let D=0;D<T.indices.length;D+=3)m=T.indices[D],C=T.indices[D+1],y=T.indices[D+2],I=new ee(T.attributes.position.values[3*m],T.attributes.position.values[3*m+1],T.attributes.position.values[3*m+2]),(x=f.scene.globe.getHeight(Kt.fromCartesian(I)))<Q&&(Q=x),w<x&&(w=x),I=new ee(T.attributes.position.values[3*C],T.attributes.position.values[3*C+1],T.attributes.position.values[3*C+2]),(v=f.scene.globe.getHeight(Kt.fromCartesian(I)))<Q&&(Q=v),w<v&&(w=v),I=new ee(T.attributes.position.values[3*y],T.attributes.position.values[3*y+1],T.attributes.position.values[3*y+2]),(E=f.scene.globe.getHeight(Kt.fromCartesian(I)))<Q&&(Q=E),w<E&&(w=E);return{maxHeight:w,minHeight:Q}};xy.prototype.removeFromMap=function(){this._isPolygon?O(this.primitive)&&(this.removePrimitive(),this._extrudedHeight=this.minHeight,this.primitive=null):O(this.flood)&&(this.flood.show=!1),this.eventHelper&&this.eventHelper.removeAll(),this.shapeTool&&this.shapeTool.removeFromMap()};xy.prototype._onTick=function(){let o=this;o._type==="up"?o._extrudedHeight>=o._maxHeight?(o._extrudedHeight=o._maxHeight,o._nowHeight=o._extrudedHeight,o.eventHelper.removeAll()):(o._isPolygon?o.removePrimitive():O(o.flood)||(o.flood=new zO(o._earthCtrl,{minHeight:o.minHeight,maxHeight:o._extrudedHeight,positions:o.positions}),o.flood.show=!0),o._extrudedHeight+=o._speed,o._isPolygon?o.addPrimitive():o.flood.maxHeight=o._extrudedHeight):o._type==="down"&&(o._extrudedHeight<=o._minHeight?(o._extrudedHeight=o._minHeight,o._nowHeight=o._extrudedHeight,o.eventHelper.removeAll()):(o._isPolygon?o.removePrimitive():O(o.flood)||(o.flood=new zO(o._earthCtrl,{minHeight:o.minHeight,maxHeight:o._extrudedHeight,positions:o.positions}),o.flood.show=!0),o._extrudedHeight-=o._speed,o._isPolygon?o.addPrimitive():o.flood.maxHeight=o._extrudedHeight))};xy.prototype._onTickNext=function(){let o=this;o._nowHeight?o._type==="up"?o._extrudedHeight>=o._nowHeight+o._height?(o._extrudedHeight=o._nowHeight+o._height,o._nowHeight=o._extrudedHeight,o.eventHelper.removeAll()):(o._isPolygon?o.removePrimitive():O(o.flood)||(o.flood=new zO(o._earthCtrl,{minHeight:o.minHeight,maxHeight:o._extrudedHeight,positions:o.positions}),o.flood.show=!0),o._extrudedHeight+=o._speed,o._isPolygon?o.addPrimitive():o.flood.maxHeight=o._extrudedHeight):o._type==="down"&&(o._extrudedHeight<=o._nowHeight-o._height?(o._extrudedHeight=o._nowHeight-o._height,o._nowHeight=o._extrudedHeight,o.eventHelper.removeAll()):(o._isPolygon?o.removePrimitive():O(o.flood)||(o.flood=new zO(o._earthCtrl,{minHeight:o.minHeight,maxHeight:o._extrudedHeight,positions:o.positions}),o.flood.show=!0),o._extrudedHeight-=o._speed,o._isPolygon?o.addPrimitive():o.flood.maxHeight=o._extrudedHeight)):o._type==="up"?o._extrudedHeight>=o._minHeight+o._height?(o._extrudedHeight=o._minHeight+o._height,o._nowHeight=o._extrudedHeight,o.eventHelper.removeAll()):(o._isPolygon?o.removePrimitive():O(o.flood)||(o.flood=new zO(o._earthCtrl,{minHeight:o.minHeight,maxHeight:o._extrudedHeight,positions:o.positions}),o.flood.show=!0),o._extrudedHeight+=o._speed,o._isPolygon?o.addPrimitive():o.flood.maxHeight=o._extrudedHeight):o._type==="down"&&(o._extrudedHeight<=o._maxHeight-o._height?(o._extrudedHeight=o._maxHeight-o._height,o._nowHeight=o._extrudedHeight,o.eventHelper.removeAll()):(o._isPolygon?o.removePrimitive():O(o.flood)||(o.flood=new zO(o._earthCtrl,{minHeight:o.minHeight,maxHeight:o._extrudedHeight,positions:o.positions}),o.flood.show=!0),o._extrudedHeight-=o._speed,o._isPolygon?o.addPrimitive():o.flood.maxHeight=o._extrudedHeight))};xy.prototype.removePrimitive=function(){O(this.primitive)&&this._earthCtrl.primitives.remove(this.primitive)};xy.prototype.polygonAnalysis=function(){let o=this;O(o.shapeTool)&&(o.shapeTool.removeFromMap(),o.shapeTool=void 0),o._height?o.eventHelper.add(o._earthCtrl.coreMap.clock.onTick,xy.prototype._onTickNext,this):o.eventHelper.add(o._earthCtrl.coreMap.clock.onTick,xy.prototype._onTick,this);let A={};A.normalMap=`${globalThis.GEOWORLD_BASE_URL}Assets/Images/waterNormals.jpg`,A.baseWaterColor=o.baseWaterColor,A.frequency=o.waterFrequency,A.animationSpeed=o.animationSpeed,A.amplitude=o.amplitude;let f=new ss({fabric:{type:"Water",uniforms:A}});f.update(o._earthCtrl.coreMap.scene.context),o.primitiveAppearance=new MY({material:f,fragmentShaderSource:PY})};xy.prototype.postAnalysis=function(){let o=this;O(o.shapeTool)&&(o.shapeTool.removeFromMap(),o.shapeTool=void 0),o._height?o.eventHelper.add(o._earthCtrl.coreMap.clock.onTick,xy.prototype._onTickNext,this):o.eventHelper.add(o._earthCtrl.coreMap.clock.onTick,xy.prototype._onTick,this)};xy.prototype.addPrimitive=function(){let o=this;o.primitive=o._earthCtrl.primitives.add(new $a({geometryInstances:new co({geometry:rh.fromPositions({positions:o.positions,extrudedHeight:o._extrudedHeight})}),asynchronous:!1,appearance:o.primitiveAppearance}))};xy.prototype.startAnalysis=function(){let o=this;setTimeout(()=>{o._isPolygon?o.polygonAnalysis():o.postAnalysis()},100)};Object.defineProperties(xy.prototype,{isPolygon:{get:function(){return this._isPolygon}},minHeight:{set:function(o){this._minHeight=o},get:function(){return this._minHeight}},maxHeight:{set:function(o){this._maxHeight=o},get:function(){return this._maxHeight}},speed:{set:function(o){this._speed=o},get:function(){return this._speed}},baseWaterColor:{set:function(o){this._baseWaterColor=o},get:function(){return this._baseWaterColor}},waterFrequency:{set:function(o){this._waterFrequency=o},get:function(){return this._waterFrequency}},animationSpeed:{set:function(o){this._animationSpeed=o},get:function(){return this._animationSpeed}},amplitude:{set:function(o){this._amplitude=o},get:function(){return this._amplitude}},height:{set:function(o){this._height=o,this.postAnalysis()},get:function(){return this._height}},type:{set:function(o){this._type=o},get:function(){return this._type}}});var _le=xy;function KO(o,A){this._earthCtrl=o,this._coreMap=o.coreMap,this.shapeTool=void 0,this.positions=void 0,this.echarts=void 0,this.mCallback=Ae(A.callback,void 0),this.defaultChart=Ae(A.defaultChart,!0),this.step=Ae(A.step,20),this.image=A.image,this.echarstView=A.echartsView,this.echartsParentView=A.echartsParentView,this.billboard=void 0,this.minHeight=0,this.maxHeight=0,this.profile={arrHB:[],arrPoint:[],arrLX:[],points:[],distance:0}}KO.prototype.drawPolyLine=function(){let o=this;this.shapeTool=o._earthCtrl.shapeTool.createDrawShapeTool(function(A){o.setPolyline({positions:A.result})},"polyline")};KO.prototype.setPolyline=function(o){this.positions=o.positions};KO.prototype.startAnalysis=function(){if(!this.positions)return console.info("\u8BF7\u5148\u7ED8\u5236\u5256\u9762\u7EBF\uFF01");if(this.positions.length>1){this.profile.arrLX.push(0);for(let A=0;A<this.positions.length-1;A++){let f=this.positions[A],m=this.positions[A+1];this.profile2PointAnalysis(f,m)}this.processHeight();let o=this.profile;this.defaultChart&&wLi(this,o),O(this.mCallback)&&this.mCallback(o),this.positions=void 0}};KO.prototype.processHeight=function(){let o=this;if(!(o.profile.arrHB.length<=0)){o.minHeight=o.maxHeight=o.profile.arrHB[0];for(let A=1;A<o.profile.arrHB.length;A++){let f=o.profile.arrHB[A];f>o.maxHeight?o.maxHeight=f:f<o.minHeight&&(o.minHeight=f)}o.minHeight=parseInt(o.minHeight/100)*100;for(let A=0;A<o.profile.arrHB.length;A++){let f=o.profile.arrHB[A];o.profile.arrHB[A]=f-o.minHeight}}};var BLi=new ee;KO.prototype.profile2PointAnalysis=function(o,A){let f=this,m=ee.distance(o,A),C=parseInt(m/f.step),y=Kt.fromCartesian(o),x=Kt.fromCartesian(A);f.positions.length>2&&f.profile.arrLX.length>1&&f.profile.arrLX.push(f.profile.arrLX[f.profile.arrLX.length-1]+aMe(f.profile.points[f.profile.points.length-1],y)),f.profile.points.push(y),f.profile.arrPoint.push(oMe(o)),f.profile.arrHB.push(y.height);let v=f.profile.arrLX.length-1;console.info(v);for(let E=1;E<C;E++){let I=ee.lerp(o,A,E/C,BLi),w=Kt.fromCartesian(I),Q=f._coreMap.scene.globe.getHeight(w);w.height=Q;let M=aMe(f.profile.points[v+E-1],w);f.profile.distance=f.profile.distance+M,f.profile.points.push(w),f.profile.arrLX.push(f.profile.arrLX[v+E-1]+M),f.profile.arrPoint.push(oMe(I)),f.profile.arrHB.push(Q)}return f.profile.points.push(x),f.profile.arrLX.push(f.profile.arrLX[f.profile.arrLX.length-1]+aMe(f.profile.points[f.profile.points.length-1],x)),f.profile.arrPoint.push(oMe(A)),f.profile.arrHB.push(x.height),f.profile};function mAt(o,A){let f=document.getElementById(o);f.style.display=A?"block":"none"}var fAt;function wLi(o,A){if(A!==null&&A.arrPoint!==null){mAt(o.echartsParentView,!0),O(o.echarts)||(o.echarts=Nb.init(document.getElementById(o.echarstView),"dark"));let f=A.arrPoint,m={grid:{left:10,right:10,bottom:10,containLabel:!0},dataZoom:[{type:"inside",throttle:50}],tooltip:{trigger:"axis",formatter:function(C){let y="";if(C.length===0)return y;let x=f[C[0].dataIndex],v=C[0].value+o.minHeight;return fAt=new ee.fromDegrees(x.x,x.y,v),O(o.billboard)||(o.billboard=o._earthCtrl.entities.add({name:"profile_billboard",position:new Bn(function(){return fAt},!1),billboard:{verticalOrigin:bn.BOTTOM,image:o.image,iconWidth:8,iconHeight:8,scale:.5}})),o.billboard.show||(o.billboard.show=!0),y+=`\u6240\u5728\u4F4D\u7F6E&nbsp;${pAt(x.x)},${pAt(x.y)}<br />\u8DDD\u8D77\u70B9&nbsp;<label>${gAt(C[0].axisValue)}</label><br />${C[0].seriesName}&nbsp;<label style='color:${C[0].color};'>${gAt(v)}</label><br />`}},xAxis:[{name:"\u884C\u7A0B",type:"category",boundaryGap:!1,axisLine:{show:!1},axisLabel:{show:!1},data:A.arrLX}],yAxis:[{type:"value",axisLabel:{formatter:function(C){return`${C+o.minHeight}\u7C73`}}}],series:[{name:"\u9AD8\u7A0B\u503C",type:"line",smooth:!0,symbol:"none",sampling:"average",itemStyle:{normal:{color:"rgb(255, 70, 131)"}},areaStyle:{normal:{color:new Nb.graphic.LinearGradient(0,0,0,1,[{offset:0,color:"rgb(255, 158, 68)"},{offset:1,color:"rgb(255, 70, 131)"}])}},data:A.arrHB}]};o.echarts.setOption(m)}}function gAt(o,A){if(o===null)return"";o=Number(o),(A===null||A==="auto")&&(o<1e3?A="m":A="km");let f="";switch(A){default:case"m":f=`${o.toFixed(2)}\u7C73`;break;case"km":f=`${(o*.001).toFixed(2)}\u516C\u91CC`;break;case"mile":f=`${(o*54e-5).toFixed(2)}\u6D77\u91CC`;break;case"zhang":f=`${(o*.3).toFixed(2)}\u4E08`;break}return f}function pAt(o){let A=o.toString();return A.slice(0,A.indexOf(".")+3)}function oMe(o){let A=Kt.fromCartesian(o),f=je.toDegrees(A.longitude),m=je.toDegrees(A.latitude),C=A.height;return{x:f,y:m,z:C}}function aMe(o,A){let f=new l0;f.setEndPoints(o,A);let m=f.surfaceDistance;return m=Math.sqrt(Math.pow(m,2)+Math.pow(A.height-o.height,2)),m}KO.prototype.removeFromMap=function(){let o=this;O(o.shapeTool)&&(o.shapeTool.removeFromMap(),o.shapeTool=void 0),O(o.billboard)&&(o._earthCtrl.entities.remove(o.billboard),o.billboard=void 0),mAt(o.echartsParentView,!1)};var Ble=KO;function wle(o,A){this._earthCtrl=o,this._coreMap=o.coreMap,this._skylineColor=Ae(A.color,At.RED.withAlpha(1)),this._postProccessStage=null,this._postProcessStages=this._coreMap.scene.postProcessStages,this._width=Ae(A.width,1),this._edgeDetection=bv.createEdgeDetectionStage({width:this._width||1}),this.addToMap()}wle.prototype.addToMap=function(){this.removeFromMap();let o=new va({name:"czm_skylinetemp",fragmentShader:"uniform sampler2D colorTexture;uniform sampler2D depthTexture;varying vec2 v_textureCoordinates;void main(void){float depth = czm_readDepth(depthTexture, v_textureCoordinates);vec4 color = texture2D(colorTexture, v_textureCoordinates);if(depth<1.0 - 0.000001){gl_FragColor = color;}else{gl_FragColor = vec4(1.0,0.0,0.0,1.0);}}"}),A=new va({name:"czm_skylinetemp1",fragmentShader:"uniform sampler2D colorTexture;uniform sampler2D redTexture;uniform sampler2D silhouetteTexture;uniform vec4 skylineColor;varying vec2 v_textureCoordinates;void main(void){vec4 redcolor=texture2D(redTexture, v_textureCoordinates);vec4 silhouetteColor = texture2D(silhouetteTexture, v_textureCoordinates);vec4 color = texture2D(colorTexture, v_textureCoordinates);if(redcolor.r == 1.0){gl_FragColor = mix(color, skylineColor, silhouetteColor.a);}else{gl_FragColor = color;}}",uniforms:{redTexture:o.name,silhouetteTexture:this._edgeDetection.name,skylineColor:this._skylineColor}});this._postProccessStage=new CC({name:"czm_skyline",stages:[this._edgeDetection,o,A],inputPreviousStageTexture:!1,uniforms:this._edgeDetection.uniforms}),this._postProcessStages.add(this._postProccessStage)};wle.prototype.removeFromMap=function(){this._postProccessStage&&(this._earthCtrl.coreMap.scene.postProcessStages.remove(this._postProccessStage),this._postProccessStage=null)};Object.defineProperties(wle.prototype,{});var ble=wle;function Qle(o,A){this._earthCtrl=o,this._coreMap=o.coreMap,this.leftIndex=void 0,this.rightIndex=void 0,this.addToMap(A.leftIndex,A.rightIndex)}var YO={dragStartX:0,_scene:void 0};Qle.prototype.addToMap=function(o,A){document.getElementById("slider")&&this.clear();let m=this._coreMap.imageryLayers,C=this._coreMap.scene;YO._scene=C;let y=this._coreMap.container,x=document.createElement("div");x.id="slider",x.style.position="absolute",x.style.cursor="e-resize",x.style.top=0,x.style.backgroundColor="#D3D3D3",x.style.width="8px",x.style.height="100%",x.style.zIndex="1000",y.appendChild(x);let v=m.get(o),E=m.get(A);this.leftIndex=o,this.rightIndex=A,v.splitDirection=uI.LEFT,E.splitDirection=uI.RIGHT;let I=document.getElementById("slider");C.splitPosition=I.offsetLeft/I.parentElement.offsetWidth,I.addEventListener("mousedown",yAt,!1),window.addEventListener("mouseup",CAt,!1),I.style.left="50%",YO._scene.splitPosition=.5};function CAt(){window.removeEventListener("mousemove",sMe,!1)}function yAt(o){let A=document.getElementById("slider");YO.dragStartX=o.clientX-A.offsetLeft,window.addEventListener("mousemove",sMe,!1)}function sMe(o){let A=document.getElementById("slider"),f=(o.clientX-YO.dragStartX)/A.parentElement.offsetWidth;A.style.left=`${100*f}%`,YO._scene.splitPosition=f}Qle.prototype.removeFromMap=function(){let o=document.getElementById("slider");if(o){YO._scene.splitPosition="0%",o.removeEventListener("mousedown",yAt,!1),window.removeEventListener("mouseup",CAt,!1),window.removeEventListener("mousemove",sMe,!1),o.remove();let A=this._coreMap.imageryLayers,f=A.get(this.leftIndex),m=A.get(this.rightIndex);f.splitDirection=uI.NONE,m.splitDirection=uI.NONE,YO._scene=void 0}};Object.defineProperties(Qle.prototype,{});var xAt=Qle;function kW(o,A){this._earthCtrl=o,this._coreMap=o.coreMap,this.color=Ae(A.color,At.RED.withAlpha(.5)),this.positions=A.positions,this.baseHeight=Ae(A.baseHeight,0),this._height=Ae(A.height,0),this.extrudedHeight=Ae(A.extrudedHeight,1e4),this.limitHeightPrimitive=null,this.addToMap()}kW.prototype.addToMap=function(){if(this.removeFromMap(),!this.positions)return;let o=ee.fromDegreesArray(this.positions),A=new co({geometry:new rh({polygonHierarchy:new Un(o),height:this.baseHeight,extrudedHeight:this.baseHeight+this.extrudedHeight}),attributes:{color:Yo.fromColor(this.color)}});this.limitHeightPrimitive=this._coreMap.scene.primitives.add(new s6({geometryInstances:A,releaseGeometryInstances:!1,classificationType:Gu.CESIUM_3D_TILE}))};kW.prototype.changeHeight=function(o){!this.limitHeightPrimitive||(console.log("?!?!?!",this.limitHeightPrimitive),this.limitHeightPrimitive.readyPromise.then(A=>{let f=Kt.fromCartesian(this.limitHeightPrimitive._primitive._boundingSpheres[0].center);console.log("???",f);let m=ee.fromRadians(f.longitude,f.latitude,this.baseHeight),C=ee.fromRadians(f.longitude,f.latitude,this.baseHeight+o),y=ee.subtract(C,m,new ee);console.log("!!!!",this.limitHeightPrimitive._primitive.modelMatrix),this.limitHeightPrimitive._primitive.modelMatrix=Xe.setTranslation(Xe.IDENTITY,y,new Xe),this.baseHeight=this.baseHeight+o}))};kW.prototype.removeFromMap=function(){this.limitHeightPrimitive&&(this._coreMap.scene.primitives.remove(this.limitHeightPrimitive),this.limitHeightPrimitive=void 0)};Object.defineProperties(kW.prototype,{});var Sle=kW;function vAt(o){this._earthCtrl=o}vAt.prototype.toDegrees=function(o){let A=Kt.fromCartesian(o);return{lon:je.toDegrees(A.longitude),lat:je.toDegrees(A.latitude),height:A.height}};var EAt=vAt;function JO(o){this._viewer=o.coreMap,this._trans=new EAt}JO.prototype.addClipping=function(o,A={}){if(this.remove(),A.type==="polygon"){let f=A.positions,m=[];f.forEach(v=>{m.push(this._trans.toDegrees(v))}),m.push(m[0]);let C;A.isInner?C=this.isClockWise(m):C=!this.isClockWise(m),C&&m.reverse();let y=[],x=this.getInverseTransform(o);for(let v=0;v<m.length-1;v++){let E=this.createPlane(m[v],m[v+1],x);y.push(E)}o.clippingPlanes=new rB({planes:y,unionClippingRegions:!A.isInner})}return this.item=o,this};JO.prototype.getInverseTransform=function(o){let A,f=o.root.transform;return f&&f.equals(Xe.IDENTITY)||!f?A=Vn.eastNorthUpToFixedFrame(o.boundingSphere.center):A=Xe.fromArray(o.root.transform),Xe.inverseTransformation(A,new Xe)};JO.prototype.getOriginCoordinateSystemPoint=function(o,A){let f=ee.fromDegrees(o.lon,o.lat);return Xe.multiplyByPoint(A,f,new ee(0,0,0))};JO.prototype.createPlane=function(o,A,f){let m=this.getOriginCoordinateSystemPoint(o,f),C=this.getOriginCoordinateSystemPoint(A,f),y=new ee(0,0,1),x=ee.subtract(C,m,new ee),v=ee.cross(x,y,new ee);v=ee.normalize(v,v);let E=Wa.fromPointNormal(m,v);return kM.fromPlane(E)};JO.prototype.isClockWise=function(o){if(o.length<3)return null;o[0]===o[o.length-1]&&(o=o.slice(0,o.length-1));let A={i:-1,val:90};for(let E=0;E<o.length;E++){let{lat:I}=o[E];I<A.val&&(A.val=I,A.i=E)}let f=(A.i+o.length-1)%o.length,m=A.i,C=(A.i+1)%o.length,y={lat:o[m].lat-o[f].lat,lon:o[m].lon-o[f].lon},x={lat:o[C].lat-o[m].lat,lon:o[C].lon-o[m].lon},v=x.lon*y.lat-y.lon*x.lat;return v===0?o[C].lon<o[f].lon:v>0};JO.prototype.remove=function(){this.item&&this.item.clippingPlanes&&this.item.clippingPlanes.removeAll(),this.item&&(this.item.clippingPlanes=void 0)};var Dle=JO;var lMe;function uMe(o,A){this._viewer=o.coreMap,lMe=o.coreMap,this.createTerrainModifier(A.name,A.polygon,A.altitude)}uMe.prototype.findDirectParent=function(o){try{let A=[];if(o.width===Math.PI)return null;for(let f=0;f<lMe.scene.globe._surface._tilesToRender.length;f++){let m=lMe.scene.globe._surface._tilesToRender[f],C=m._rectangle;Si.intersection(C,o)&&A.push(m)}return A}catch(A){console.log(A)}return null};uMe.prototype.createTerrainModifier=function(o,A,f){let m=A.length,C=new Array(m);C.fill(f);let y=Vu(),x=Date.now(),v=Si.fromCartesianArray(A),E=this.findDirectParent(v);this._viewer.terrainProvider&&this._viewer.terrainProvider._modifyTerrainObjects===void 0&&(this._viewer.terrainProvider._modifyTerrainObjects=[]);let I=this._viewer,w={id:y,name:o,show:!0,rectangle:v,vertices:A,heights:C,timeStamp:x,remove:function(){if(I.terrainProvider&&I.terrainProvider._modifyTerrainObjects)for(let Q=I.terrainProvider._modifyTerrainObjects.length-1;Q>=0;Q--)I.terrainProvider._modifyTerrainObjects[Q].id===y&&I.terrainProvider._modifyTerrainObjects.splice(Q,1);if(E)try{for(let Q=0;Q<E.length;Q++)try{E[Q]._parent.freeResources()}catch(M){console.log(M)}}catch(Q){console.log(Q)}}};if(this._viewer.terrainProvider._modifyTerrainObjects.push(w),E)try{for(let Q=0;Q<E.length;Q++)try{E[Q]._parent.freeResources()}catch(M){console.log(M)}}catch(Q){console.log(Q)}return w};var Tle=uMe;var YH;function cMe(o){this._earthCtrl=o,this.Viewer=o.coreMap,YH=o.coreMap}cMe.prototype.CreateTooltip=function(o={},A,f){let m,C,y,x,v;typeof o=="object"&&(m=o),m&&m.origin?(m.origin==="center"&&(C=15,y=-12),m.origin==="top"&&(C=15,y=-44),m.origin==="bottom"&&(C=15,y=20)):(C=15,y=20),m&&m.color?(m.color==="white"&&(x="background: rgba(255, 255, 255, 0.8);color: black;"),m.color==="black"&&(x="background: rgba(0, 0, 0, 0.5);color: white;"),m.color==="yellow"&&(x="color: black;background-color: #ffcc33;border: 1px solid white;")):x="background: rgba(0, 0, 0, 0.5);color: white;",m&&m.id?v=`toolTip${m.id}`:v="toolTip";let E=document.getElementById(v);if(!E){let I=document.createElement("div");nA(".map-widget",I);let w=`<div id="${v}" style="display: none;pointer-events: none;position: absolute;z-index: 1000;opacity: 0.8;border-radius: 4px;padding: 4px 8px;white-space: nowrap;font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px;${x}"></div>`;nA(".map-widget",w),E=document.getElementById(v)}return f?(E.innerHTML=o,E.style.left=`${A.x+C}px`,E.style.top=`${A.y+y}px`,E.style.display="block"):E.style.display="none",{tooltip:E,style:m,showAt:function(I,w){this.tooltip.innerHTML=w,this.style&&this.style.origin?(this.style.origin==="center"&&(C=15,y=-this.tooltip.offsetHeight/2),this.style.origin==="top"&&(C=15,y=-this.tooltip.offsetHeight-20),this.style.origin==="bottom"&&(C=15,y=20)):(C=15,y=-this.tooltip.offsetHeight/2),this.tooltip.style.left=`${I.x+C}px`,this.tooltip.style.top=`${I.y+y}px`,this.tooltip.style.display="block"},show:function(I){I?this.tooltip.style.display="block":this.tooltip.style.display="none"}}};cMe.prototype.CreateResultTooltip=function(o={}){let A,f,m,C=o.id?`resultToolTip${o.id}`:"resultToolTip",y=document.getElementById(C);if(o.color?(o.color==="white"&&(m="background: rgba(255, 255, 255, 0.8);color: black;"),o.color==="black"&&(m="background: rgba(0, 0, 0, 0.5);color: white;"),o.color==="blue"&&(m="background: rgba(48, 119, 221);color: white;"),o.color==="yellow"&&(m="color: black;background-color: #ffcc33;border: 1px solid white;")):m="color: black;background-color: #ffcc33;border: 1px solid white;",!y){let Q=`<div id="${C}" class="resultToolTip" style="display: none;pointer-events: none;position: absolute;z-index: 1000;opacity: 0.8;border-radius: 4px;padding: 4px 8px;white-space: nowrap;font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px;${m}"></div>`;nA(".map-widget",Q),y=document.getElementById(C)}let x=o.addX||0,v=o.addY||0,E,I=this;function w(){if(E){if(o.far!==void 0||o.near!==void 0){let M=I.getPointToCameraDistance(YH,E);if(M>o.far){y.style.display="none";return}else if(M<o.near){y.style.display="none";return}y.style.display="block"}let Q=YH.scene.cartesianToCanvasCoordinates(E);if(!Q)return;A=-y.offsetWidth/2+x,f=-y.offsetHeight+v,y.style.left=`${Q.x+A}px`,y.style.top=`${Q.y+f}px`}}return YH.clock.onTick.addEventListener(w),{tooltip:y,position:E,showAt:function(Q,M){if(this.tooltip.innerHTML=M,this.tooltip.style.display="block",this.position=Q,E=Q,E){let B=YH.scene.cartesianToCanvasCoordinates(E);if(!B)return;A=-this.tooltip.offsetWidth/2+x,f=-this.tooltip.offsetHeight+v,this.tooltip.style.left=`${B.x+A}px`,this.tooltip.style.top=`${B.y+f}px`}},show:function(Q){Q?(this.tooltip.style.display="block",E=this.position):(this.tooltip.style.display="none",E=void 0)},destroy(){YH.clock.onTick.removeEventListener(w),y.remove()}}};var gw=cMe;var AMe=class{constructor(){this.minHeight=Number.MAX_VALUE,this.maxHeight=Number.MIN_VALUE,this.cutVolume=0,this.fillVolume=0,this.baseArea=0}},hMe=class{constructor(){this.minHeight=Number.MAX_VALUE,this.maxHeight=Number.MIN_VALUE,this.avgHeight=0,this.baseArea=0}};function Mle(o,A){this._earthCtrl=o,this._viewer=o.coreMap,this.baseHeight=Ae(A.baseHeight,0),this.options=A}Mle.prototype.start=function(){let o=this.options.positions,A=this.options.countBase,f=this.options.basePositions,m=this.options.baseHeight,C=new AMe,y=[];o.forEach(Q=>{let M=Kt.fromCartesian(Q);this.baseHeight=Math.min(M.height,Ae(m,this.baseHeight)),y.push(Ss.wgs84ToWindowCoordinates(this._viewer.scene,Q))});let x=bLi(y),v=Zl.randomPoint(100,{bbox:[x[0],x[1],x[2],x[3]]}),E=QLi(y);Zl.voronoi(v,{bbox:[x[0],x[1],x[2],x[3]]}).features.forEach(Q=>{let M=SLi(E,Q.geometry);if(M.length>0){let B=this.computeCubeInfo(M);this.baseHeight>B.avgHeight?C.fillVolume+=(this.baseHeight-B.avgHeight)*C.baseArea:C.cutVolume+=(B.avgHeight-this.baseHeight)*C.baseArea,C.maxHeight=Math.max(C.maxHeight,B.maxHeight),C.minHeight=Math.min(C.minHeight,B.minHeight),C.baseArea+=B.baseArea}});let w=this.countBaseVolume(A,f,m);return w!==0&&(C.cutVolume+=w,C.fillVolume+=w),C};Mle.prototype.countBaseVolume=function(o,A,f){let m=this;if(o){let C=[],y=[];for(let Q=0;Q<A.length;Q=Q+3){y.push(A[Q+2]);let M=ee.fromDegrees(A[Q],A[Q+1],f),B=Kt.fromCartesian(M);C.push(B)}C.push(C[0]);let x=IAt(C);y.sort(function(Q,M){return Q-M});let v=y[0],E=y[y.length-1];return Number(E-v)*x/2}return 0};Mle.prototype.computeCubeInfo=function(o){let A=this,f=[],m=Number.MAX_VALUE,C=Number.MIN_VALUE,y=0;o.forEach(function(E){let I=A._earthCtrl.coreMap.scene.camera.getPickRay(E),w=A._earthCtrl.coreMap.scene.globe.pick(I,A._earthCtrl.coreMap.scene),Q=Kt.fromCartesian(w);f.push(Q),m=Math.min(m,Q.height),C=Math.max(C,Q.height),y+=Q.height});let x=y/o.length,v=new hMe;return v.minHeight=m,v.maxHeight=C,v.avgHeight=x,v.baseArea=IAt(f),v};function IAt(o){let A=[0],f=[0],m=new l0,C=Math.PI/180;for(let x=0;x<o.length-1;x++){let v=o[x],E=o[x+1];m.setEndPoints(v,E);let I=Math.sqrt(Math.pow(m.surfaceDistance,2)),w=E.latitude*C,Q=E.longitude*C,M=v.latitude*C,B=v.longitude*C,T=-Math.atan2(Math.sin(Q-B)*Math.cos(M),Math.cos(w)*Math.sin(M)-Math.sin(w)*Math.cos(M)*Math.cos(Q-B));T<0&&(T+=Math.PI*2),f.push(Math.sin(T)*I+f[x]),A.push(Math.cos(T)*I+A[x])}let y=0;for(let x=0;x<A.length-1;x++)y+=A[x]*f[x+1]-A[x+1]*f[x];return Math.abs(y+A[A.length-1]*f[0]-A[0]*f[f.length-1])/2}function bLi(o){let A=[],f=Number.MAX_VALUE,m=Number.MIN_VALUE,C=Number.MAX_VALUE,y=Number.MIN_VALUE;return o.forEach(x=>{f=Math.min(f,x.x),m=Math.max(m,x.x),C=Math.min(C,x.y),y=Math.max(y,x.y)}),A.push(f),A.push(C),A.push(m),A.push(y),A}function QLi(o){let A=[[]];return o.forEach(m=>{A[0].push([m.x,m.y])}),A[0].push([o[0].x,o[0].y]),Zl.polygon(A).geometry}function SLi(o,A){let f=Zl.intersect(o,A);return f?.geometry!==void 0?DLi(f?.geometry):[]}function DLi(o){let A=[];return o.coordinates.forEach(function(f){f.forEach(function(m){A.push(new It(m[0],m[1]))})}),A.push(new It(o.coordinates[0][0][0],o.coordinates[0][0][1])),A}var Ple=Mle;function Gx(o,A){this._earthCtrl=o,this._viewer=o.coreMap,this._cesium=_r,this._scene=o.coreMap.scene,this._Tooltip=new gw(o),this.loadingImg=`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`,this.tooltip=this._Tooltip.CreateTooltip(),this.FlattenIsDraw=!1,this.wallArr=[],this.hierarchy=[],this.tophierarchy=[],this.heightsort=[],this.FlattenPolygon=[],this.deepth=100,this.polygon=null,this.editPoint=[],this.nowPoint=null,this.editPosition=[],this.topPositions=null,this._volumeLabel=void 0,this._volumeLabel1=void 0,this._option=Ae(A.option,{}),this._irregularCut=Ae(A.irregularCut,!1),this.terrainFlatten=new IN(o.coreMap.scene),this.CreatePolygon(A.height,A.option,A.callback)}Gx.prototype.CreatePolygon=function(o,A,f){if(this.FlattenIsDraw)return;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=null),this.removeLabel(),this.addLoading(),this.FlattenIsDraw=!0;let m=this._viewer,C=this._cesium;this.deepth=o||this.deepth,this.removeFromMap(),!A&&(A={});let y=[],x=this.hierarchy,v=this.polygon,E,I=null,w=0,Q=this.heightsort,M=this.deepth,B=this.wallArr,T=this;this.drawHandler=new C.ScreenSpaceEventHandler(m.scene.canvas),m.scene.globe.depthTestAgainstTerrain=!0;let D=this.tooltip,F;this._viewer.container.style.cursor=`url(${window.SmartEarthRootUrl} 'Workers/image/cursor/draw.cur')`,this.drawHandler.setInputAction(function(V){E=R(V.position);let H=C.Cartographic.fromCartesian(E),q=C.Math.toDegrees(H.longitude),ie=C.Math.toDegrees(H.latitude),Z=H.height;y.push(E),x.push(q,ie,H.height),T.tophierarchy.push(q,ie,Z),w===0?(y.push(E),x.push(q,ie,H.height),F=m.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new C.CallbackProperty(()=>y,!1),clampToGround:!0,material:new C.ColorMaterialProperty(C.Color.YELLOW.withAlpha(.3)),width:3}})):w===1&&(F&&m.entities.remove(F),v=m.entities.add({name:null,id:T._earthCtrl.factory.createUUID(),polygon:{hierarchy:new C.PolygonHierarchy(C.Cartesian3.fromDegreesArrayHeights(x)),material:C.Color.YELLOW.withAlpha(.3)}}),v.polygon.hierarchy=new C.CallbackProperty(L,!1)),w++},C.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(function(V){if(w===0){D.showAt(V.endPosition,"\u5DE6\u952E\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u70B9");return}else w===1?D.showAt(V.endPosition,"\u70B9\u51FB\u6DFB\u52A0\u7B2C\u4E8C\u4E2A\u70B9"):D.showAt(V.endPosition,"\u53F3\u952E\u7ED3\u675F\u7ED8\u5236");E=R(V.endPosition);let H=C.Cartographic.fromCartesian(E),q=C.Math.toDegrees(H.longitude),ie=C.Math.toDegrees(H.latitude);x.splice(x.length-3,3),y.splice(y.length-1,1),y.push(E),x.push(q,ie,H.height)},C.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(function(V){this.end&&this.end()}.bind(this),C.ScreenSpaceEventType.RIGHT_CLICK),this.end=V=>{if(D.show(!1),T._viewer.container.style.cursor="default",T.drawHandler.destroy(),F&&m.entities.remove(F),v&&m.entities.remove(v),this.FlattenIsDraw=!1,this.end=void 0,V==="cancel"||y.length<3)return;if(w<2){w=0;return}w=0;for(let se=2;se<x.length;se=se+3)Q.push(x[se]);Q.sort(function(se,ce){return se-ce}),v=m.entities.add({name:null,id:T._earthCtrl.factory.createUUID(),polygon:{hierarchy:new C.CallbackProperty(function(){return new C.PolygonHierarchy(C.Cartesian3.fromDegreesArrayHeights(x))},!1),material:new C.ImageMaterialProperty({image:C.defaultValue(A.bottomImgUrl,`${window.SmartEarthRootUrl}Workers/image/bottomplane.jpg`),repeat:new C.Cartesian2(1,1)})}}),y.push(y[0]);let H,q,ie,Z,oe,ne;for(let se=0;se<y.length-1;se++){H=C.Cartographic.fromCartesian(y[se]),q=C.Cartographic.fromCartesian(y[se+1]),ie=C.Math.toDegrees(H.longitude),oe=C.Math.toDegrees(H.latitude),Z=C.Math.toDegrees(q.longitude),ne=C.Math.toDegrees(q.latitude),I?I=I>q.height?q.height:I:I=H.height>q.height?q.height:H.height;let ce=T.getPoint(ie,oe,Z,ne,H.height,q.height),j=[],de=[];T.getHeightsFromLonLat(ce.positions,function(me){if(me){j=me;for(let _e=0;_e<j.length;_e++)de.push(T.heightsort[0]-T.deepth);T.drawwall(ce.wallJwd,j,de)}})}v.polygon.height=Q[0]-M,this.FlattenPolygon.push(v),this.originHeight=Q[0],k(y),this.topPositions=y,typeof f=="function"&&f(y)};function L(){return new C.PolygonHierarchy(C.Cartesian3.fromDegreesArrayHeights(x))}function R(V){let H;if(m.scene.terrainProvider.constructor.name==="EllipsoidTerrainProvider")H=m.camera.pickEllipsoid(V,m.scene.globe.ellipsoid);else{let ie=m.scene.camera.getPickRay(V);H=m.scene.globe.pick(ie,m.scene)}if(m.scene.pick(V)){let ie=m.scene.pickPosition(V);if(ie){H=ie;let Z=C.Cartographic.fromCartesian(H),oe=m.scene.globe.getHeight(Z);Z.height=oe,H=C.Cartographic.toCartesian(Z)}}return H}function k(V){let H=m.scene.globe,q=V.concat();q.splice(q.length-1,1);for(let Z=0;Z<q.length-1;Z++)q[Z].x===q[Z+1].x&&q[Z].y===q[Z+1].y&&(q.splice(Z,1),Z--);let ie=q.length;if(U(q)&&q.reverse(),T.irregularCut){T.terrainFlatten.clearPolygon();let Z=[],oe=m.scene.globe.ellipsoid;for(let ne=0;ne<q.length;ne++){let se=oe.cartesianToCartographic(q[ne]),ce=C.Math.toDegrees(se.longitude),j=C.Math.toDegrees(se.latitude),de=se.height;Z.push(ce,j,de)}T.terrainFlatten.addPolygon(Z),T.terrainFlatten.update(),T.terrainFlatten.clipPlaneOfFlatten=!0}else{let Z=[];for(let oe=0;oe<ie;++oe){let ne=(oe+1)%ie,se=C.Cartesian3.add(q[oe],q[ne],new C.Cartesian3);se=C.Cartesian3.multiplyByScalar(se,.5,se);let ce=C.Cartesian3.normalize(se,new C.Cartesian3),j=C.Cartesian3.subtract(q[ne],se,new C.Cartesian3);j=C.Cartesian3.normalize(j,j);let de=C.Cartesian3.cross(j,ce,new C.Cartesian3);de=C.Cartesian3.normalize(de,de);let me=new C.Plane(de,0),_e=C.Plane.getPointDistance(me,se);Z.push(new C.ClippingPlane(de,_e))}H.clippingPlanes=new C.ClippingPlaneCollection({planes:Z})}}function U(V){if(V.length>=3)return!((V[1].x-V[0].x)*(V[2].y-V[1].y)-(V[1].y-V[0].y)*(V[2].x-V[1].x)>0)}return this};Gx.prototype.getPoint=function(o,A,f,m,C,y){let x=this,v=160,E=je.lerp(o,f,1/v)-o,I=je.lerp(A,m,1/v)-A,w=[],Q=[],M=[],B;w.push(o,A),B=ee.fromDegrees(o,A),Q.push(Kt.fromCartesian(B));for(let T=0;T<v;T++){let D=o+(T+1)*E,F=A+(T+1)*I;w.push(D,F),B=ee.fromDegrees(D,F),Q.push(Kt.fromCartesian(B))}return w.push(f,m),B=ee.fromDegrees(f,m),Q.push(Kt.fromCartesian(B)),{wallJwd:w,positions:Q}};Gx.prototype.getHeightsFromLonLat=function(o,A){let f=this._viewer,m=f.camera,C=[];if(this.isHaveTerrain(f))if(O(f.terrainProvider.availability)){let y=vQ(f.terrainProvider,o);Promise.resolve(y).then(function(x){x.forEach(function(v){C.push(v.height)}),typeof A=="function"&&A(C)})}else o.forEach(function(y){let x=f.scene.globe.getHeight(y);C.push(x)}),typeof A=="function"&&A(C);else o.forEach(function(y){C.push(f.scene.globe.getHeight(y))}),typeof A=="function"&&A(C)};Gx.prototype.isHaveTerrain=function(){return!!(this._viewer.scene&&this._viewer.scene.terrainProvider&&this._viewer.scene.terrainProvider._layers)};Gx.prototype.drawwall=function(o,A,f){let m=this,C=m._viewer.entities.add({wall:{positions:new Bn(function(){return ee.fromDegreesArray(o)},!1),maximumHeights:A,minimumHeights:f}}),y=C.wall;y.material=new z0({image:Ae(m._option.wallImgUrl,`${window.SmartEarthRootUrl}Workers/image/dzmc.jpg`),repeat:new It(1,1)}),m.wallArr.push(C)};Gx.prototype.setDeepth=function(o){this.FlattenPolygon[0]&&this.FlattenPolygon[0].polygon.height.setValue(this.originHeight-o),this.wallArr.forEach(A=>{let f=A.wall.minimumHeights.getValue();f=Array(f.length),f.fill(this.originHeight-o),A.wall.minimumHeights.setValue(f)})};Gx.prototype.edit=function(o){let A=this,f=A.editPoint,m=A.nowPoint;if(A._earthCtrl.coreMap.scene.globe.depthTestAgainstTerrain=!1,m){for(let x of A.editPoint)x&&(x.show=!0);A.update(m,f,o);return}for(let x=2;x<A.hierarchy.length;x=x+3)A.hierarchy[x]=A.originHeight-A.deepth;A.FlattenPolygon[0]&&A._viewer.entities.remove(A.FlattenPolygon[0]),A.FlattenPolygon=[];let C=this._viewer.entities.add({name:null,id:A._earthCtrl.factory.createUUID(),polygon:{hierarchy:new Un(ee.fromDegreesArrayHeights(A.hierarchy)),material:new z0({image:Ae(A._option.bottomImgUrl,`${window.SmartEarthRootUrl}Workers/image/bottomplane.jpg`),repeat:new It(1,1)}),perPositionHeight:!0}});A.FlattenPolygon.push(C);let y=A.FlattenPolygon[0].polygon.hierarchy.getValue();for(let x of y.positions){let v=this._viewer.entities.add({id:A._earthCtrl.factory.createUUID(),position:x,point:{color:At.WHITE,pixelSize:12,outlineColor:At.BLACK,outlineWidth:1}});f.push(v)}A._earthCtrl.measure.pickObject(null,function(x){let v=x.pickedObject.id;for(let E of f)if(v.id===E.id){A.nowPoint=E,A.update(E,f,o);return}})};Gx.prototype.endEdit=function(){let o=this;if(o._earthCtrl.coreMap.scene.globe.depthTestAgainstTerrain=!0,o.editPoint.length>0)for(let A of o.editPoint)A&&(A.show=!1)};Gx.prototype.excavationAndFill=function(){this.removeLabel();let o=this;this.endEdit(),o.topPositions&&(this.isLoading(!0),setTimeout(()=>{let A=null,f=null,m=!1;if(o.editPosition.length>0){let v=[];f=[];for(let E=0;E<o.editPosition.length-1;E++){let I=Kt.fromCartesian(o.editPosition[E]),w=je.toDegrees(I.longitude),Q=je.toDegrees(I.latitude),M=I.height;v.push(M),f.push(w,Q,M)}v.sort(function(E,I){return I-E}),A=v[0],m=!0}else A=o.heightsort[0]-o.deepth;let y=new Ple(o._earthCtrl,{positions:o.topPositions,baseHeight:A,basePositions:f,countBase:m}).start(),x=o.computeCentroidOfPolygon(o.topPositions);this._volumeLabel=this._viewer.entities.add({position:ee.fromRadians(x.longitude,x.latitude,o.heightsort[o.heightsort.length-1]),label:{text:`\u6316\u65B9\u4F53\u79EF\uFF1A${y.cutVolume}\u7ACB\u65B9\u7C73`,pixelOffset:{x:0,y:-30},font:"16px \u5B8B\u4F53",fillColor:At.GOLD,verticalOrigin:bn.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),this._volumeLabel1=this._viewer.entities.add({position:ee.fromRadians(x.longitude,x.latitude,o.heightsort[o.heightsort.length-1]),label:{text:`\u586B\u65B9\u4F53\u79EF\uFF1A${y.fillVolume}\u7ACB\u65B9\u7C73`,pixelOffset:{x:0,y:-70},font:"16px \u5B8B\u4F53",fillColor:At.GOLD,verticalOrigin:bn.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),this.isLoading(!1),console.log(y.result)},100))};Gx.prototype.computeCentroidOfPolygon=function(o){let A=[],f=[],m=0,C=0;for(let v=0;v<o.length;v++){let E=Kt.fromCartesian(o[v]);m+=E.longitude,C+=E.latitude,A.push(E.longitude),f.push(E.latitude)}let y=0,x=0;return y=m/o.length,x=C/o.length,new Kt(y,x)};Gx.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=this.loadingImg,o.appendChild(A),this.loading=o,this._viewer.container.appendChild(o)};Gx.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};Gx.prototype.update=function(o,A,f){let m=this,C=o.position.getValue(),x=m._scene.globe.ellipsoid.cartesianToCartographic(C),v=je.toDegrees(x.longitude),E=je.toDegrees(x.latitude),I=x.height;o.position.setValue(ee.fromDegrees(v,E,I+f)),m.editPoint=A,m.editPosition=[];let w=[];for(let M of A){let B=M.position.getValue();w.push(B),m.editPosition.push(B)}m.FlattenPolygon[0].polygon.hierarchy=new Bn(function(){return new Un(w)},!0);let Q=m.editPosition;Q.push(Q[0]);for(let M=0;M<Q.length-1;M++){let T=[];for(let D=0;D<=160;D++){let F=ee.lerp(Q[M],Q[M+1],D/160,new ee),L=Kt.fromCartesian(F);T.push(L.height)}m.wallArr[M].wall.minimumHeights.setValue(T)}};Gx.prototype.removeFromMap=function(){this.endEdit(),this._earthCtrl.tools.clearTool(),this.editPoint=[],this.nowPoint=null;let o=this._viewer;if(this.wallArr.length>0){for(let A=0;A<this.wallArr.length;A++)o.entities.remove(this.wallArr[A]);this.wallArr=[]}o.scene.globe.clippingPlanes&&o.scene.globe.clippingPlanes.removeAll(),this.FlattenPolygon&&this.FlattenPolygon.length>0&&(this.FlattenPolygon.forEach(function(A){o.entities.remove(A)}),this.FlattenPolygon=[]),this.FlattenIsDraw=!1,this.removeLabel(),this.terrainFlatten&&this.terrainFlatten.clearPolygon()};Gx.prototype.removeLabel=function(){this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0)};var Rle=Gx;function _C(o,A={}){this._earthCtrl=o,this._viewer=o.coreMap,this._scene=o.coreMap.scene,this.options=Ae(A,{}),this._Tooltip=new gw(o),this._tooltip=this._Tooltip.CreateTooltip(),this._drawColor={point:Ae(this.options.drawColor?.point,At.BLUE),polyline:Ae(this.options.drawColor?.polyline,At.YELLOW),polygon:Ae(this.options.drawColor?.point,At.YELLOW.withAlpha(.5))},this.selectDatum=!0,this.onlyTerrain=!0,this.tin=!1,this._volumeTin=[],this.loadingImg=`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`,this.unit=Ae(A.unit,"km\xB3")}_C.prototype.removeFromMap=function(){this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._prevEntity1!==void 0&&(this._viewer.entities.remove(this._prevEntity1),this._prevEntity1=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._volumeTin.forEach(o=>{this._viewer.entities.remove(o)}),this._volumeTin=[],this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=void 0),this.Triangulation=[],this.tinData=void 0,this._tooltip.show(!1)};_C.prototype.deleteObject=_C.prototype.removeFromMap;_C.prototype.startDrawing=function(o={},A="auto",f){let m=this._scene,C=this._tooltip,y=3,x=[],v=[],E=[],I;this._positions=v,this._degreesArr=E,this._drawColor.point=o.point||this._drawColor.point,this._drawColor.polyline=o.polyline||this._drawColor.polyline,this._drawColor.polygon=o.polygon||this._drawColor.polygon,this.loadingImg=o.loading||this.loadingImg,this.tin=Ae(o.tin,!0),this.onlyTerrain=Ae(o.onlyTerrain,!1),this.selectDatum=Ae(o.selectDatum,!0);let w=this;this._mouseHandler&&this._mouseHandler.destroy(),this.loading||this.addLoading();let Q=new Ur(m.canvas);this._mouseHandler=Q,this.removeFromMap(),this._viewer.container.style.cursor=`url(${globalThis.GEOWORLD_BASE_URL} 'Workers/image/cursor/draw.cur')`;let M;Q.setInputAction(function(T){if(T.position!==null){let D=m.camera.getPickRay(T.position),F=m.globe.pick(D,m);if(this._viewer.scene.pick(T.position)){let R=this._viewer.scene.pickPosition(T.position);R&&(F=R)}if(F){let R=Kt.fromCartesian(F),k=je.toDegrees(R.longitude),U=je.toDegrees(R.latitude);if(x.length===0&&(x.push(k,U),E.push([k,U]),v.push(F),I=F),v.length>=4){let V=Ss.wgs84ToWindowCoordinates(this._viewer.scene,I);if(V!==void 0){let H=V.x-T.position.x,q=V.y-T.position.y;if(H*H+q*q<16){x.splice(x.length-2,2),v.pop(),this.stopDrawing(f);return}}}x.push(k,U),E.push([k,U]),v.push(F),v.length===2&&!M&&(M=this._viewer.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new Bn(function(){return v},!1),clampToGround:!0,material:w._drawColor.polygon,width:3}})),v.length===y&&(M&&this._viewer.entities.remove(M),this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:new Un(ee.fromDegreesArray(x)),material:w._drawColor.polygon,fill:!0}}),this._prevEntity.polygon.hierarchy=new Bn(B,!1))}}}.bind(this),Ki.LEFT_CLICK),Q.setInputAction(function(T){let D=T.endPosition;if(D!==null)if(v.length===0)C.showAt(D,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7B2C\u4E00\u4E2A\u70B9");else{let F=m.camera.getPickRay(D),L=m.globe.pick(F,m),R=this._viewer.scene.pick(D),k=!1;if(R){let U=this._viewer.scene.pickPosition(D);U&&(L=U),k=!0}if(L){let U=Kt.fromCartesian(L),V=je.toDegrees(U.longitude),H=je.toDegrees(U.latitude);if(x.splice(x.length-2,2),E.pop(),v.pop(),x.push(V,H),E.push([V,H]),v.push(L),C.showAt(D,"\u53F3\u952E\u7ED3\u675F\u7ED8\u5236"),v.length>=3&&v.length>=4){let q=Ss.wgs84ToWindowCoordinates(this._viewer.scene,I);if(q!==void 0){let ie=q.x-D.x,Z=q.y-D.y;ie*ie+Z*Z<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}}.bind(this),Ki.MOUSE_MOVE),Q.setInputAction(function(T){this.end&&this.end()}.bind(this),Ki.RIGHT_CLICK);function B(){return new Un(ee.fromDegreesArray(x))}return this.end=T=>{if(this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),w._viewer.container.style.cursor="default",this._tooltip.show(!1),M&&this._viewer.entities.remove(M),this.end=void 0,!(v.length<y)){if(this._prevEntity&&(this._prevEntity.polygon.hierarchy=ee.fromDegreesArray(x)),T==="cancel"){this._prevEntity&&this._viewer.entities.remove(this._prevEntity);return}this.stopDrawing(A,f)}},this};_C.prototype.stopDrawing=function(o,A){this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._volumeTin.forEach(f=>{this._viewer.entities.remove(f)}),this._volumeTin=[],this.isLoading(!0),setTimeout(()=>{let f=this.computeCutVolume(o,this.onlyTerrain),m=C=>{let y=C.maxHeight,x=C.minHeight;this._prevEntity.polygon.height=C.minHeight,this._prevEntity.polygon.heightReference=0;let v={id:this._earthCtrl.factory.createUUID(),polygon:{hierarchy:{positions:this._positions},height:x,extrudedHeight:y,closeTop:!1,closeBottom:!1,material:At.CYAN.withAlpha(.2),outline:!0,outlineColor:At.RED,outlineWidth:2}};if(this._prevEntity1=this._viewer.entities.add(v),typeof A=="function"&&A(C),this.selectDatum){let E=()=>{this.addPoint(I=>{this.setDatum(I,w=>{typeof A=="function"&&A({...C,...w}),E()})})};E()}};this.onlyTerrain?f.then(C=>{m(C)}):m(f)},100)};_C.prototype.computeCentroidOfPolygon=function(o){let A=[],f=[],m=0,C=0;for(let v=0;v<o.length;v++){let E=Kt.fromCartesian(o[v]);m+=E.longitude,C+=E.latitude,A.push(E.longitude),f.push(E.latitude)}let y=0,x=0;return y=m/o.length,x=C/o.length,new Kt(y,x)};_C.prototype.computeCutVolume=function(o,A){let f=this,m=15e3,C=-15e3;if(o==="auto"){let E=wi.fromPoints(this._positions);console.log("BoundingSphere.radius",E.radius),o=E.radius/20}let y=this.getPointsInPolygon(this._degreesArr,o,!0),x=Zl.polygon([this._degreesArr]),v=()=>{let{tin:E}=this.tinFromPoints(y,{getArea:!0,polygon:x});this.tinData=E;let I={fill:0,dig:0},w,Q,M,B,T;this.Triangulation=[],E.features.forEach(L=>{if(L.positions){if(this.tin){let k=this._viewer.entities.add({polygon:{hierarchy:new Un(L.positions),material:this._drawColor.polygon,perPositionHeight:!0,outline:!0,outlineColor:At.YELLOW}});this._volumeTin.push(k)}let R=L.geometry.coordinates[0];w=R[0][2],Q=R[1][2],M=R[2][2],T=L.area,this.Triangulation.push({bottomArea:T,height:[w,Q,M]}),B=(w-m+Q-m+M-m)/3,B>0?I.dig=I.dig+T*B:I.fill=I.fill-T*B}});let D=this.computeCentroidOfPolygon(this._positions);this.unit!=="m\xB3"&&(I.dig=I.dig/1e9,I.fill=I.fill/1e9);let F=this.unit==="m\xB3"?"\u7ACB\u65B9\u7C73":"\u7ACB\u65B9\u5343\u7C73";return this._volumeLabel=this._viewer.entities.add({position:ee.fromRadians(D.longitude,D.latitude,C),label:{text:`\u6316\u65B9\u4F53\u79EF\uFF1A${I.dig.toFixed(4)}${F}`,pixelOffset:{x:0,y:-30},font:"16px \u5B8B\u4F53",fillColor:At.GOLD,verticalOrigin:bn.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),this._volumeLabel1=this._viewer.entities.add({position:ee.fromRadians(D.longitude,D.latitude,C),label:{text:`\u586B\u65B9\u4F53\u79EF\uFF1A${I.fill.toFixed(4)}${F}`,pixelOffset:{x:0,y:-70},font:"16px \u5B8B\u4F53",fillColor:At.GOLD,verticalOrigin:bn.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),this.isLoading(!1),{maxHeight:C,minHeight:m,volume:I,unit:this.unit,spacing:o}};if(A){let E=[];return y.features.forEach(w=>{let Q=w.geometry.coordinates;E.push(Kt.fromDegrees(Q[0],Q[1]))}),vQ(this._viewer.scene.globe.terrainProvider,E).then(w=>(y.features.forEach((Q,M)=>{let B=Q.geometry.coordinates;B[2]=w[M]&&w[M].height?w[M].height:0,C<B[2]&&(C=B[2]),m>B[2]&&(m=B[2])}),v()))}return y.features.forEach(E=>{let I=E.geometry.coordinates,w=new Kt(je.toRadians(I[0]),je.toRadians(I[1]));I[2]=this._viewer.scene.sampleHeight(w)||0,C<I[2]&&(C=I[2]),m>I[2]&&(m=I[2])}),v()};_C.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=this.loadingImg,o.appendChild(A),this.loading=o,this._viewer.container.appendChild(o)};_C.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};_C.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};_C.prototype.addPoint=function(o){this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=null),this._prevEntity1&&(this.addPointHandle=new Ur(this._viewer.scene.canvas),this.addPointHandle.setInputAction(function(A){let f=this._viewer.scene.pick(A.position);if(f&&f.id&&f.id.id===this._prevEntity1.id){let m=this._viewer.scene.pickPosition(A.position);if(m){let C=Kt.fromCartesian(m);this.addPointHandle.destroy(),this.addPointHandle=null,o&&typeof o=="function"&&o(C.height.toFixed(1))}}}.bind(this),Ki.LEFT_CLICK),this.addPointHandle.setInputAction(function(A){let f=this._viewer.scene.pick(A.endPosition);f&&f.id&&f.id.id===this._prevEntity1.id?this._tooltip.showAt(A.endPosition,"\u70B9\u51FB\u4FEE\u6539\u57FA\u51C6\u9762\u9AD8\u5EA6"):this._tooltip.show(!1)}.bind(this),Ki.MOUSE_MOVE))};_C.prototype.showTin=function(o){this.tin=o,this._volumeTin.forEach(A=>{this._viewer.entities.remove(A)}),this._volumeTin=[],o&&this.tinData&&this.tinData.features.forEach(A=>{if(A.positions){let f=this._viewer.entities.add({polygon:{hierarchy:new Un(A.positions),material:this._drawColor.polygon,perPositionHeight:!0,outline:!0,outlineColor:At.YELLOW}});this._volumeTin.push(f)}})};_C.prototype.setDatum=function(o,A){if(this.Triangulation&&this.Triangulation.length>0){let f,m,C,y={fill:0,dig:0};this.Triangulation.forEach(function(v){f=v.bottomArea,m=v.height,C=(m[0]-o+m[1]-o+m[2]-o)/3,C>0?y.dig=y.dig+f*C:y.fill=y.fill-f*C}),this.unit!=="m\xB3"&&(y.dig=y.dig/1e9,y.fill=y.fill/1e9);let x=this.unit==="m\xB3"?"\u7ACB\u65B9\u7C73":"\u7ACB\u65B9\u5343\u7C73";this._volumeLabel.label.text=`\u6316\u65B9\u4F53\u79EF\uFF1A${y.dig.toFixed(4)}${x}`,this._volumeLabel1.label.text=`\u586B\u65B9\u4F53\u79EF\uFF1A${y.fill.toFixed(4)}${x}`,this._prevEntity.polygon.height=o,A&&typeof A=="function"&&A({volume:y,unit:this.unit})}};_C.prototype.getPointsInPolygon=function(o,A=50,f=!0){if(o.length<3)return;o.push(o[0]);let m=Zl.lineString(o),C=Zl.bbox(m),y=Zl.pointGrid(C,A,{units:"meters"}),x=Zl.polygon([o]),v=Zl.pointsWithinPolygon(y,x);if(f)for(let E=0;E<o.length-1;E++){let I=Zl.lineString([o[E],o[E+1]]),w={units:"meters"},Q=Zl.length(I,w),M;for(let B=A;;B+=A)if(B<=Q)M=Zl.along(I,B,w),v.features.push(M);else{M=Zl.along(I,Q,w),v.features.push(M);break}}return v};_C.prototype.tinFromPoints=function(o,A={}){let{polygon:f,getArea:m}=A,C=Zl.tin(o),y=0;return C&&C.features&&C.features.forEach(x=>{let v=!0;if(f){let E=Zl.centerOfMass(x);v=Zl.booleanPointInPolygon(E,f)}if(v){let E=x.geometry.coordinates[0],I=[],w=[];for(let Q=0;Q<3;Q++)I.push([E[Q][0],E[Q][1]]),w.push(ee.fromDegrees(E[Q][0],E[Q][1],E[Q][2]));x.positions=w,m&&(x.area=this.getArea(I,w,!0),y+=x.area)}}),{tin:C,area:y}};_C.prototype.getArea=function(o,A,f){if(o.length<3)return;o.push(o[0]);let m=o,C=0,y=Zl.polygon([m]),x;m.length===4?x=[y]:x=Zl.tesselate(y).features;let v,E,I,w;return x.forEach(Q=>{v=Q.geometry.coordinates[0],E=m.findIndex(F=>F.toString()===v[0].toString()),I=m.findIndex(F=>F.toString()===v[1].toString()),w=m.findIndex(F=>F.toString()===v[2].toString());let M=this.getdistance(A[E],A[I]),B=this.getdistance(A[I],A[w]),T=this.getdistance(A[E],A[w]),D=(M+B+T)/2;C+=Math.sqrt(D*((D-M)*(D-B)*(D-T)))}),f||(C<1e6?C=`${C.toFixed(2)}\u5E73\u65B9\u7C73`:C=`${(C/1e6).toFixed(2)}\u5E73\u65B9\u5343\u7C73`),C};_C.prototype.getdistance=function(o,A){let f=Kt.fromCartesian(o),m=Kt.fromCartesian(A),C=Di.MOON2000,x=new l0(f,m,C).surfaceDistance;return x=Math.sqrt(Math.pow(x,2)+Math.pow(m.height-f.height,2)),x};var _At=_C;function Lle(o){this.mEarthCtrl=o,this._polylines=[],this._resPolylines=[],this._points=[],this.entities=this.mEarthCtrl.entities,this.camera=this.mEarthCtrl.coreMap.camera,this.scene=this.mEarthCtrl.coreMap.scene}Lle.prototype.createLineOfSight=function(o){let A=[],f=this,m=[],C=[],y={polyline:[]};f.objectsToExclude=null;let x,v=function(){function M(B){this.options={polyline:{show:!0,positions:[],material:At.YELLOW,width:3,clampToGround:!1}},this.positionsp=B,this._init()}return M.prototype._init=function(){let B=this,T=function(){return B.positionsp};this.options.polyline.positions=new Bn(T,!1),this.polyline=f.entities.add(this.options),f.item=this.polyline,C.push(this.polyline)},M}(),E=new Ur(f.scene.canvas),I=[],w;if(this._points.length>0)for(let M=0;M<this._points.length;M++)this.entities.remove(this._points[M]);let Q=[];return E.setInputAction(function(M){let B,T=new ee(0,0,0);if(new ja(f.mEarthCtrl).pickVector(M.position,T)&&(B=T),!!B)if(I.length===0){I.push(B.clone(),B.clone());let F={leftX:M.position.x,leftY:M.position.y};Q.push(F),x=B.clone()}else{let F={rightX:M.position.x,rightY:M.position.y};Q.push(F);let L={postion:I,entity:C,cartesian:Q};m.push(L),Q=[],w=void 0,I=[],I.push(x.clone()),I.push(x.clone()),w=new v(I),A.push(w)}},Ki.LEFT_CLICK),E.setInputAction(function(M){let B,T=f.camera.getPickRay(M.endPosition);if(B=f.scene.globe.pick(T,f.scene),f.scene.pick(M.endPosition)){let F=f.scene.pickPosition(M.endPosition);F&&(B=F)}!B||I.length>=2&&(O(w)?B!==void 0&&(I.pop(),I.push(B)):(w=new v(I),A.push(w)))},Ki.MOUSE_MOVE),E.setInputAction(function(M){let B=f.entities.add(new UA);f.objectsToExclude=[B];let T=!0;for(let D=0;D<m.length;D++)D===0?T=f.tsjx(m[0].postion[0],m[0].postion[1]):T=f.tsjx(m[D].postion[0],m[D].postion[1]);I.pop(),f._polylines=y.polyline,E.destroy();for(let D=0;D<C.length;D++)f.entities.remove(C[D]);O(o)&&typeof o=="function"&&o(y)},Ki.RIGHT_CLICK),this};Lle.prototype.tsjx=function(o,A){let f=this,m=ee.normalize(ee.subtract(A,o,new ee),new ee),C=new ls(o,m),y=f.scene.globe.pick(C,f.scene);y!=null?(x(y,o,At.GREEN),x(y,A,At.RED)):x(o,A,At.GREEN);function x(v,E,I){let w=f.entities.add({polyline:{positions:[v,E],width:1,material:I,depthFailMaterial:I}});f._resPolylines.push(w)}return!1};Lle.prototype.deleteObject=function(){if(this._points.length>0){this.objectsToExclude=null;for(let o=0;o<this._points.length;o++)this.entities.remove(this._points[o])}if(this._resPolylines.length>0){for(let o=0;o<this._resPolylines.length;o++)this.entities.remove(this._resPolylines[o]);this._resPolylines=[]}};var BAt=Lle;function _h(o,A={}){this._earthCtrl=o,this._viewer=o.coreMap,this._scene=o.coreMap.scene,this.options=Ae(A,{}),this._Tooltip=new gw(o),this._tooltip=this._Tooltip.CreateTooltip(),this._drawColor={point:Ae(this.options.drawColor?.point,At.BLUE),polyline:Ae(this.options.drawColor?.polyline,At.YELLOW),polygon:Ae(this.options.drawColor?.polygon,At.YELLOW.withAlpha(.5))},this.selectDatum=!0,this.onlyTerrain=!0,this.tin=!1,this._volumeTin=[],this.loadingImg=`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`,this.wallArr=[],this.FlattenPolygon=[],this._Apositions=[],this._heightsort=null,this._deepth=100,this._positions=[],this._modelArr=Ae(A.modelArr,[]),this._isFlattening=Ae(A.isFlattening,!0),this.modelCuttingPolygon=null,this.wallImgUrl=Ae(A.wallImgUrl,null),this.bottomImgUrl=Ae(A.bottomImgUrl,null),this.calculate=Ae(A.calculate,!0),this._Loading=Ae(A.loading,!0),this.editPoint=[],this.nowPoint=null,this.hierarchy=[],this._originHeight=null}_h.prototype.removeMeasureFromMap=function(){this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._prevEntity1!==void 0&&(this._viewer.entities.remove(this._prevEntity1),this._prevEntity1=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._volumeTin.forEach(o=>{this._viewer.entities.remove(o)}),this._volumeTin=[],this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=void 0),this.Triangulation=[],this.tinData=void 0,this._tooltip.show(!1)};_h.prototype.removeFromMap=function(){if(this.endEdit(),this.removeMeasureFromMap(),this.wallArr.length>0){for(let o=0;o<this.wallArr.length;o++)this._viewer.entities.remove(this.wallArr[o]);this.wallArr=[]}if(this.FlattenPolygon&&this.FlattenPolygon.length>0){for(let o=0;o<this.FlattenPolygon.length;o++)this._viewer.entities.remove(this.FlattenPolygon[o]);this.FlattenPolygon=[]}this.removeModelCutting()};_h.prototype.deleteObject=_h.prototype.removeFromMap;_h.prototype.startDrawing=function(o={},A){let f=Ae(o.spacing,"auto"),m=this._scene,C=this._tooltip,y=3,x=[],v=[],E=[],I=[],w=[],Q;this._Apositions=o.positions,this._positions=v,this._hierarchy=E,this._heightsort=I,this._degreesArr=w,this._deepth=Ae(o.deepth,100),this._drawColor.point=o.point||this._drawColor.point,this._drawColor.polyline=o.polyline||this._drawColor.polyline,this._drawColor.polygon=o.polygon||this._drawColor.polygon,this.loadingImg=o.loading||this.loadingImg,this.tin=Ae(o.tin,!1),this.onlyTerrain=Ae(o.onlyTerrain,!1),this.selectDatum=Ae(o.selectDatum,!1);let M=this;if(this._mouseHandler&&this._mouseHandler.destroy(),this.loading||this.addLoading(),o.positions){let B=ee.fromDegreesArray(o.positions);for(let T of B)v.push(T);if(!(v.length<y)){for(let T=0;T<o.positions.length;T+=2)w.push([o.positions[T],o.positions[T+1]]);this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:ee.fromDegreesArray(o.positions),material:M._drawColor.polygon,fill:!0}});for(let T=0;T<o.positions.length;T+=2){let D=M._viewer.scene.sampleHeight(new Kt(je.toRadians(o.positions[T]),je.toRadians(o.positions[T+1])));I.push(D),E.push(o.positions[T],o.positions[T+1],D)}this.stopDrawing(f,T=>{A&&A(T)})}}else{let B=new Ur(m.canvas);this._mouseHandler=B,this.removeMeasureFromMap(),this._viewer.container.style.cursor=`url(${globalThis.GEOWORLD_BASE_URL} 'Workers/image/cursor/draw.cur')`;let T;B.setInputAction(function(F){if(F.position!==null){let L=m.camera.getPickRay(F.position),R=m.globe.pick(L,m);if(this._viewer.scene.pick(F.position)){let U=this._viewer.scene.pickPosition(F.position);U&&(R=U)}if(R){let U=Kt.fromCartesian(R),V=je.toDegrees(U.longitude),H=je.toDegrees(U.latitude);if(x.length===0&&(x.push(V,H),w.push([V,H]),v.push(R),Q=R),v.length>=4){let q=Ss.wgs84ToWindowCoordinates(this._viewer.scene,Q);if(q!==void 0){let ie=q.x-F.position.x,Z=q.y-F.position.y;if(ie*ie+Z*Z<16){x.splice(x.length-2,2),v.pop(),this.stopDrawing(A);return}}}x.push(V,H),w.push([V,H]),v.push(R),v.length===2&&!T&&(T=this._viewer.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new Bn(function(){return v},!1),clampToGround:!0,material:M._drawColor.polygon,width:3}})),v.length===y&&(T&&this._viewer.entities.remove(T),this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:new Un(ee.fromDegreesArray(x)),material:M._drawColor.polygon,fill:!0}}),this._prevEntity.polygon.hierarchy=new Bn(()=>new Un(ee.fromDegreesArray(x)),!1))}}}.bind(this),Ki.LEFT_CLICK),B.setInputAction(function(F){let L=F.endPosition;if(L!==null)if(v.length===0)C.showAt(L,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7B2C\u4E00\u4E2A\u70B9");else{let R=m.camera.getPickRay(L),k=m.globe.pick(R,m),U=this._viewer.scene.pick(L),V=!1;if(U){let H=this._viewer.scene.pickPosition(L);H&&(k=H),V=!0}if(k){let H=Kt.fromCartesian(k),q=je.toDegrees(H.longitude),ie=je.toDegrees(H.latitude);if(x.splice(x.length-2,2),w.pop(),v.pop(),x.push(q,ie),w.push([q,ie]),v.push(k),C.showAt(L,"\u53F3\u952E\u7ED3\u675F\u7ED8\u5236"),v.length>=3&&v.length>=4){let Z=Ss.wgs84ToWindowCoordinates(this._viewer.scene,Q);if(Z!==void 0){let oe=Z.x-L.x,ne=Z.y-L.y;oe*oe+ne*ne<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}}.bind(this),Ki.MOUSE_MOVE);let D=null;B.setInputAction(function(F){D=window.setTimeout(()=>{console.log("\u5355\u51FB"),this.end&&this.end()},200)}.bind(this),Ki.RIGHT_CLICK),B.setInputAction(function(F){console.log("\u53CC\u51FB......"),clearTimeout(D)},Ki.LEFT_DOUBLE_CLICK),this.end=F=>{if(this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),M._viewer.container.style.cursor="default",this._tooltip.show(!1),T&&this._viewer.entities.remove(T),this.end=void 0,console.log(w,"?????????"),!(v.length<y)){if(this._prevEntity&&(this._prevEntity.polygon.hierarchy=ee.fromDegreesArray(x)),F==="cancel"){this._prevEntity&&this._viewer.entities.remove(this._prevEntity);return}for(let L=0;L<x.length;L+=2){let R=M._viewer.scene.sampleHeight(new Kt(je.toRadians(x[L]),je.toRadians(x[L+1])));I.push(R),E.push(x[L],x[L+1],R)}this._Apositions=x,this.stopDrawing(f,A)}}}return this};_h.prototype.stopDrawing=function(o,A){let f=this;this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._volumeTin.forEach(m=>{this._viewer.entities.remove(m)}),this._volumeTin=[],this._Loading&&this.isLoading(!0),setTimeout(()=>{f._heightsort.sort(function(T,D){return T-D});let m=this._viewer.entities.add({name:null,id:f._earthCtrl.factory.createUUID(),polygon:{hierarchy:new Bn(function(){return new Un(ee.fromDegreesArrayHeights(f._hierarchy))},!1),material:new z0({image:Ae(f.bottomImgUrl,`${window.SmartEarthRootUrl}Workers/image/bottomplane.jpg`),repeat:new It(1,1)})}});f.FlattenPolygon.push(m),f.originHeight=f._heightsort[0];let C=ee.fromDegreesArrayHeights(f._hierarchy);C.push(C[0]),f._positionsB=C;let y=null,x,v,E,I,w,Q;for(let T=0;T<C.length-1;T++){x=Kt.fromCartesian(C[T]),v=Kt.fromCartesian(C[T+1]),E=je.toDegrees(x.longitude),w=je.toDegrees(x.latitude),I=je.toDegrees(v.longitude),Q=je.toDegrees(v.latitude),y?y=y>v.height?v.height:y:y=x.height>v.height?v.height:x.height;let D=f.getPoint(E,w,I,Q,x.height,v.height),F=[],L=[];f.getHeightsFromLonLat(D.positions,function(R){if(R){F=R;for(let k=0;k<F.length;k++)L.push(f._heightsort[0]-f._deepth);f.drawwall(D.wallJwd,F,L)}})}if(f._baseHeight=f._heightsort[0]-f._deepth,m.polygon.height=f._baseHeight,!this.calculate)return f._isFlattening&&f.modelCutting(),A&&A(!0),this.isLoading(!1);let M=this.computeCutVolume(o,this.onlyTerrain),B=T=>{let D=T.maxHeight,F=T.minHeight;if(this._prevEntity.polygon.height=T.minHeight,this._prevEntity.polygon.heightReference=0,this.selectDatum){let L=()=>{this.addPoint(R=>{this.setDatum(R,k=>{typeof A=="function"&&A({...T,...k}),L()})})};L()}};this.onlyTerrain?M.then(T=>{B(T)}):B(M),f.setDatum(f._baseHeight,T=>{f._isFlattening&&f.modelCutting(),A&&A(T),this._Loading&&this.isLoading(!1)})},100)};_h.prototype.modelCutting=function(){let o=this;if(o._modelCuttingPolygon=rh.fromPositions({positions:ee.fromDegreesArray(o._Apositions),height:o._baseHeight}),o._modelArr.length>0)for(let A of o._modelArr)A.addFlattenPolygon(o._modelCuttingPolygon),A.needUpdateFlatten=!0,A.clipPlaneOfFlatten=!0;else console.info("\u8BF7\u6DFB\u52A0\u6A21\u578B\uFF01")};_h.prototype.removeModelCutting=function(){let o=this;if(o._modelArr.length>0){for(let A of o._modelArr)A.removeFlattenPolygon(o._modelCuttingPolygon);o._modelCuttingPolygon=null,o._modelArr=[]}else console.info("\u8BF7\u6DFB\u52A0\u6A21\u578B\uFF01")};_h.prototype.computeCentroidOfPolygon=function(o){let A=[],f=[],m=0,C=0;for(let v=0;v<o.length;v++){let E=Kt.fromCartesian(o[v]);m+=E.longitude,C+=E.latitude,A.push(E.longitude),f.push(E.latitude)}let y=0,x=0;return y=m/o.length,x=C/o.length,new Kt(y,x)};_h.prototype.edit=function(o,A,f){let m=this,C=m.editPoint,y=m.nowPoint;if(m._earthCtrl.coreMap.scene.globe.depthTestAgainstTerrain=!1,y){for(let E of m.editPoint)E&&(E.show=!0);m.update(y,C,o);return}for(let E=2;E<m._hierarchy.length;E=E+3)m._hierarchy[E]=m.originHeight-m._deepth;m.FlattenPolygon[0]&&m._viewer.entities.remove(m.FlattenPolygon[0]),m.FlattenPolygon=[];let x=this._viewer.entities.add({name:null,id:m._earthCtrl.factory.createUUID(),polygon:{hierarchy:new Un(ee.fromDegreesArrayHeights(m._hierarchy)),material:new z0({image:Ae(m.bottomImgUrl,`${window.SmartEarthRootUrl}Workers/image/bottomplane.jpg`),repeat:new It(1,1)}),perPositionHeight:!0}});m.FlattenPolygon.push(x);let v=m.FlattenPolygon[0].polygon.hierarchy.getValue();for(let E of v.positions){let I=this._viewer.entities.add({id:m._earthCtrl.factory.createUUID(),position:E,point:{color:At.WHITE,pixelSize:12,outlineColor:At.BLACK,outlineWidth:1}});C.push(I)}if(o)if(A){for(let E of C)if(A===E.id){m.nowPoint=E,m.update(E,C,o);return}}else m._earthCtrl.measure.pickObject(null,function(E){let I=E.pickedObject.id;for(let w of C)if(I.id===w.id){m.nowPoint=w,m.update(w,C,o);return}});else f&&f(C)};_h.prototype.update=function(o,A,f){let m=this,C=o.position.getValue(),x=m._scene.globe.ellipsoid.cartesianToCartographic(C),v=je.toDegrees(x.longitude),E=je.toDegrees(x.latitude),I=x.height;o.position.setValue(ee.fromDegrees(v,E,I+f)),m.editPoint=A,m.editPosition=[];let w=[];for(let M of A){let B=M.position.getValue();w.push(B),m.editPosition.push(B)}m.FlattenPolygon[0].polygon.hierarchy=new Bn(function(){return new Un(w)},!0);let Q=m.editPosition;Q.push(Q[0]);for(let M=0;M<Q.length-1;M++){let T=[];for(let D=0;D<=160;D++){let F=ee.lerp(Q[M],Q[M+1],D/160,new ee),L=Kt.fromCartesian(F);T.push(L.height)}m.wallArr[M].wall.minimumHeights.setValue(T)}};_h.prototype.endEdit=function(){let o=this;if(o._earthCtrl.coreMap.scene.globe.depthTestAgainstTerrain=!0,o.editPoint.length>0)for(let A of o.editPoint)A&&(A.show=!1)};_h.prototype.computeCutVolume=function(o,A){let f=this,m=15e3,C=-15e3;o==="auto"&&(o=wi.fromPoints(this._positions).radius/20);let y=this.getPointsInPolygon(this._degreesArr,o,!0),x=Zl.polygon([this._degreesArr]),v=()=>{let{tin:E}=this.tinFromPoints(y,{getArea:!0,polygon:x});this.tinData=E;let I={fill:0,dig:0},w={fill:"\u7ACB\u65B9\u7C73",dig:"\u7ACB\u65B9\u7C73"},Q,M,B,T,D,F={fill:1,dig:1};this.Triangulation=[],E.features.forEach(R=>{if(R.positions){if(this.tin){let U=this._viewer.entities.add({polygon:{hierarchy:new Un(R.positions),material:this._drawColor.polygon,perPositionHeight:!0,outline:!0,outlineColor:At.YELLOW}});this._volumeTin.push(U)}let k=R.geometry.coordinates[0];Q=k[0][2],M=k[1][2],B=k[2][2],D=R.area,this.Triangulation.push({bottomArea:D,height:[Q,M,B]}),T=(Q-m+M-m+B-m)/3,T>0?I.dig=I.dig+D*T*F.dig:I.fill=I.fill-D*T*F.fill,I.dig>1e10&&w.dig==="\u7ACB\u65B9\u7C73"&&(I.dig=I.dig/1e9,w.dig="\u7ACB\u65B9\u5343\u7C73",F.dig=1e-9),I.fill>1e10&&w.fill==="\u7ACB\u65B9\u7C73"&&(I.fill=I.fill/1e9,w.fill="\u7ACB\u65B9\u5343\u7C73",F.fill=1e-9)}});let L=this.computeCentroidOfPolygon(this._positions);return this._volumeLabel=this._viewer.entities.add({position:ee.fromRadians(L.longitude,L.latitude,C),label:{text:`\u6316\u65B9\u4F53\u79EF\uFF1A${I.dig.toFixed(4)}${w.dig}`,pixelOffset:{x:0,y:-30},font:"16px \u5B8B\u4F53",fillColor:At.GOLD,verticalOrigin:bn.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),this._volumeLabel1=this._viewer.entities.add({position:ee.fromRadians(L.longitude,L.latitude,C),label:{text:`\u586B\u65B9\u4F53\u79EF\uFF1A${I.fill.toFixed(4)}${w.fill}`,pixelOffset:{x:0,y:-70},font:"16px \u5B8B\u4F53",fillColor:At.GOLD,verticalOrigin:bn.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),{maxHeight:C,minHeight:m,volume:I,unit:w,spacing:o}};if(A){let E=[];return y.features.forEach(w=>{let Q=w.geometry.coordinates;E.push(Kt.fromDegrees(Q[0],Q[1]))}),vQ(this._viewer.scene.globe.terrainProvider,E).then(w=>(y.features.forEach((Q,M)=>{let B=Q.geometry.coordinates;B[2]=w[M]&&w[M].height?w[M].height:0,C<B[2]&&(C=B[2]),m>B[2]&&(m=B[2])}),v()))}return y.features.forEach(E=>{let I=E.geometry.coordinates,w=new Kt(je.toRadians(I[0]),je.toRadians(I[1]));I[2]=this._viewer.scene.sampleHeight(w)||0,C<I[2]&&(C=I[2]),m>I[2]&&(m=I[2])}),v()};_h.prototype.getPoint=function(o,A,f,m,C,y){let x=this,v=160,E=je.lerp(o,f,1/v)-o,I=je.lerp(A,m,1/v)-A,w=[],Q=[],M=[],B;w.push(o,A),B=ee.fromDegrees(o,A),Q.push(Kt.fromCartesian(B));for(let T=0;T<v;T++){let D=o+(T+1)*E,F=A+(T+1)*I;w.push(D,F),B=ee.fromDegrees(D,F),Q.push(Kt.fromCartesian(B))}return w.push(f,m),B=ee.fromDegrees(f,m),Q.push(Kt.fromCartesian(B)),{wallJwd:w,positions:Q}};_h.prototype.getHeightsFromLonLat=function(o,A){let f=this._viewer,m=[];o.forEach(function(C){m.push(f.scene.sampleHeight(new Kt(C.longitude,C.latitude)))}),typeof A=="function"&&A(m)};_h.prototype.isHaveTerrain=function(){return!!(this._viewer.scene&&this._viewer.scene.terrainProvider&&this._viewer.scene.terrainProvider._layers)};_h.prototype.drawwall=function(o,A,f){let m=this,C=m._viewer.entities.add({wall:{positions:new Bn(function(){return ee.fromDegreesArray(o)},!1),maximumHeights:A,minimumHeights:f}}),y=C.wall;y.material=new z0({image:Ae(m.wallImgUrl,`${window.SmartEarthRootUrl}Workers/image/dzmc.jpg`),repeat:new It(1,1)}),m.wallArr.push(C)};_h.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=this.loadingImg,o.appendChild(A),this.loading=o,this._viewer.container.appendChild(o)};_h.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};_h.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};_h.prototype.addPoint=function(o){this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=null),this._prevEntity1&&(this.addPointHandle=new Ur(this._viewer.scene.canvas),this.addPointHandle.setInputAction(function(A){let f=this._viewer.scene.pick(A.position);if(f&&f.id&&f.id.id===this._prevEntity1.id){let m=this._viewer.scene.pickPosition(A.position);if(m){let C=Kt.fromCartesian(m);this.addPointHandle.destroy(),this.addPointHandle=null,o&&typeof o=="function"&&o(C.height.toFixed(1))}}}.bind(this),Ki.LEFT_CLICK),this.addPointHandle.setInputAction(function(A){let f=this._viewer.scene.pick(A.endPosition);f&&f.id&&f.id.id===this._prevEntity1.id?this._tooltip.showAt(A.endPosition,"\u70B9\u51FB\u4FEE\u6539\u57FA\u51C6\u9762\u9AD8\u5EA6"):this._tooltip.show(!1)}.bind(this),Ki.MOUSE_MOVE))};_h.prototype.showTin=function(o){this.tin=o,this._volumeTin.forEach(A=>{this._viewer.entities.remove(A)}),this._volumeTin=[],o&&this.tinData&&this.tinData.features.forEach(A=>{if(A.positions){let f=this._viewer.entities.add({polygon:{hierarchy:new Un(A.positions),material:this._drawColor.polygon,perPositionHeight:!0,outline:!0,outlineColor:At.YELLOW}});this._volumeTin.push(f)}})};_h.prototype.setDatum=function(o,A){if(this.Triangulation&&this.Triangulation.length>0){let f,m,C,y={fill:0,dig:0},x={fill:"\u7ACB\u65B9\u7C73",dig:"\u7ACB\u65B9\u7C73"},v={fill:1,dig:1};this.Triangulation.forEach(function(E){f=E.bottomArea,m=E.height,C=(m[0]-o+m[1]-o+m[2]-o)/3,C>0?y.dig=y.dig+f*C*v.dig:y.fill=y.fill-f*C*v.fill,y.dig>1e10&&x.dig==="\u7ACB\u65B9\u7C73"&&(y.dig=y.dig/1e9,x.dig="\u7ACB\u65B9\u5343\u7C73",v.dig=1e-9),y.fill>1e10&&x.fill==="\u7ACB\u65B9\u7C73"&&(y.fill=y.fill/1e9,x.fill="\u7ACB\u65B9\u5343\u7C73",v.fill=1e-9)}),this._volumeLabel.label.text=`\u6316\u65B9\u4F53\u79EF\uFF1A${y.dig.toFixed(4)}${x.dig}`,this._volumeLabel1.label.text=`\u586B\u65B9\u4F53\u79EF\uFF1A${y.fill.toFixed(4)}${x.fill}`,this._prevEntity.polygon.height=o,A&&typeof A=="function"&&A({volume:y,unit:x})}};_h.prototype.getPointsInPolygon=function(o,A=50,f=!0){if(o.length<3)return;o.push(o[0]);let m=Zl.lineString(o),C=Zl.bbox(m),y=Zl.pointGrid(C,A,{units:"meters"}),x=Zl.polygon([o]),v=Zl.pointsWithinPolygon(y,x);if(f)for(let E=0;E<o.length-1;E++){let I=Zl.lineString([o[E],o[E+1]]),w={units:"meters"},Q=Zl.length(I,w),M;for(let B=A;;B+=A)if(B<=Q)M=Zl.along(I,B,w),v.features.push(M);else{M=Zl.along(I,Q,w),v.features.push(M);break}}return v};_h.prototype.tinFromPoints=function(o,A={}){let{polygon:f,getArea:m}=A,C=Zl.tin(o),y=0;return C&&C.features&&C.features.forEach(x=>{let v=!0;if(f){let E=Zl.centerOfMass(x);v=Zl.booleanPointInPolygon(E,f)}if(v){let E=x.geometry.coordinates[0],I=[],w=[];for(let Q=0;Q<3;Q++)I.push([E[Q][0],E[Q][1]]),w.push(ee.fromDegrees(E[Q][0],E[Q][1],E[Q][2]));x.positions=w,m&&(x.area=this.getArea(I,w,!0),y+=x.area)}}),{tin:C,area:y}};_h.prototype.getArea=function(o,A,f){if(o.length<3)return;o.push(o[0]);let m=o,C=0,y=Zl.polygon([m]),x;m.length===4?x=[y]:x=Zl.tesselate(y).features;let v,E,I,w;return x.forEach(Q=>{v=Q.geometry.coordinates[0],E=m.findIndex(F=>F.toString()===v[0].toString()),I=m.findIndex(F=>F.toString()===v[1].toString()),w=m.findIndex(F=>F.toString()===v[2].toString());let M=this.getdistance(A[E],A[I]),B=this.getdistance(A[I],A[w]),T=this.getdistance(A[E],A[w]),D=(M+B+T)/2;C+=Math.sqrt(D*((D-M)*(D-B)*(D-T)))}),f||(C<1e6?C=`${C.toFixed(2)}\u5E73\u65B9\u7C73`:C=`${(C/1e6).toFixed(2)}\u5E73\u65B9\u5343\u7C73`),C};_h.prototype.getdistance=function(o,A){let f=Kt.fromCartesian(o),m=Kt.fromCartesian(A),C=new l0;C.setEndPoints(f,m);let y=C.surfaceDistance;return y=Math.sqrt(Math.pow(y,2)+Math.pow(m.height-f.height,2)),y};var wAt=_h;function T2(o,A={}){this._earthCtrl=o,this._viewer=o.coreMap,this._scene=o.coreMap.scene,this.options=Ae(A,{}),this._modelArr=[],this._Apositions=[],this.FlattenPolygon=[],this._Loading=Ae(A.loading,!1),this._bottom=Ae(A.bottom,!1),this.loadingImg=Ae(A.loadingImg,`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`),this._Tooltip=new gw(o),this._tooltip=this._Tooltip.CreateTooltip(),this._positions=[],this._deepth=100,this._drawColor={point:Ae(this.options.drawColor?.point,At.BLUE),polyline:Ae(this.options.drawColor?.polyline,At.YELLOW),polygon:Ae(this.options.drawColor?.polygon,At.YELLOW.withAlpha(.5))}}T2.prototype.removeMeasureFromMap=function(){this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=void 0),this.Triangulation=[],this.tinData=void 0,this._tooltip.show(!1)};T2.prototype.startDrawing=function(o={},A){let f=this._scene,m=this._tooltip,C=3,y,x=[],v=[],E=[],I=[],w=[];this._positions=v,this._hierarchy=E,this._heightsort=I,this._degreesArr=w,this._deepth=Ae(o.deepth,100),this._modelArr=Ae(o.modelArr,[]);let Q=this;if(this._mouseHandler&&this._mouseHandler.destroy(),this.loading||this.addLoading(),o.positions){let M=ee.fromDegreesArray(o.positions);for(let B of M)v.push(B);if(!(v.length<C)){for(let B=0;B<o.positions.length;B+=2)w.push([o.positions[B],o.positions[B+1]]);console.log(v,"\u4F4D\u7F6E\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A"),this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:ee.fromDegreesArray(o.positions),material:Q._drawColor.polygon,fill:!0}});for(let B=0;B<o.positions.length;B+=2){let T=Q._viewer.scene.sampleHeight(new Kt(je.toRadians(o.positions[B]),je.toRadians(o.positions[B+1])));I.push(T),E.push(o.positions[B],o.positions[B+1],T)}this._Apositions=o.positions,this.stopDrawing(B=>{A&&A(B)})}}else{let M=new Ur(f.canvas);this._mouseHandler=M,this.removeMeasureFromMap(),this._viewer.container.style.cursor=`url(${globalThis.GEOWORLD_BASE_URL} 'Workers/image/cursor/draw.cur')`;let B;M.setInputAction(function(T){if(T.position!==null){let D=f.camera.getPickRay(T.position),F=f.globe.pick(D,f);if(this._viewer.scene.pick(T.position)){let R=this._viewer.scene.pickPosition(T.position);R&&(F=R)}if(F){let R=Kt.fromCartesian(F),k=je.toDegrees(R.longitude),U=je.toDegrees(R.latitude);if(x.length===0&&(x.push(k,U),w.push([k,U]),v.push(F),y=F),v.length>=4){let V=Ss.wgs84ToWindowCoordinates(this._viewer.scene,y);if(V!==void 0){let H=V.x-T.position.x,q=V.y-T.position.y;if(H*H+q*q<16){x.splice(x.length-2,2),v.pop(),this.stopDrawing(A);return}}}x.push(k,U),w.push([k,U]),v.push(F),v.length===2&&!B&&(B=this._viewer.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new Bn(function(){return v},!1),clampToGround:!0,material:Q._drawColor.polygon,width:3}})),v.length===C&&(B&&this._viewer.entities.remove(B),this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:new Un(ee.fromDegreesArray(x)),material:Q._drawColor.polygon,fill:!0}}),this._prevEntity.polygon.hierarchy=new Bn(()=>new Un(ee.fromDegreesArray(x)),!1))}}}.bind(this),Ki.LEFT_CLICK),M.setInputAction(function(T){let D=T.endPosition;if(D!==null)if(v.length===0)m.showAt(D,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7B2C\u4E00\u4E2A\u70B9");else{let F=f.camera.getPickRay(D),L=f.globe.pick(F,f),R=this._viewer.scene.pick(D),k=!1;if(R){let U=this._viewer.scene.pickPosition(D);U&&(L=U),k=!0}if(L){let U=Kt.fromCartesian(L),V=je.toDegrees(U.longitude),H=je.toDegrees(U.latitude);if(x.splice(x.length-2,2),w.pop(),v.pop(),x.push(V,H),w.push([V,H]),v.push(L),m.showAt(D,"\u53F3\u952E\u7ED3\u675F\u7ED8\u5236"),v.length>=3&&v.length>=4){let q=Ss.wgs84ToWindowCoordinates(this._viewer.scene,y);if(q!==void 0){let ie=q.x-D.x,Z=q.y-D.y;ie*ie+Z*Z<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}}.bind(this),Ki.MOUSE_MOVE),M.setInputAction(function(T){this.end&&this.end()}.bind(this),Ki.RIGHT_CLICK),this.end=T=>{if(this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),Q._viewer.container.style.cursor="default",this._tooltip.show(!1),B&&this._viewer.entities.remove(B),this.end=void 0,console.log(w,"?????????"),!(v.length<C)){if(this._prevEntity&&(this._prevEntity.polygon.hierarchy=ee.fromDegreesArray(x)),T==="cancel"){this._prevEntity&&this._viewer.entities.remove(this._prevEntity);return}for(let D=0;D<x.length;D+=2){let F=Q._viewer.scene.sampleHeight(new Kt(je.toRadians(x[D]),je.toRadians(x[D+1])));I.push(F),E.push(x[D],x[D+1],F)}this._Apositions=x,this.stopDrawing(A)}}}};T2.prototype.stopDrawing=function(o){let A=this;this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._Loading&&this.isLoading(!0),setTimeout(()=>{A._heightsort.sort(function(m,C){return m-C});let f=null;A._bottom?(f=this._viewer.entities.add({name:null,id:A._earthCtrl.factory.createUUID(),polygon:{hierarchy:new Bn(function(){return new Un(ee.fromDegreesArrayHeights(A._hierarchy))},!1),material:new z0({image:Ae(A.bottomImgUrl,`${window.SmartEarthRootUrl}Workers/image/bottomplane.jpg`),repeat:new It(1,1)})}}),A._baseHeight=A._heightsort[0]-A._deepth,f.polygon.height=A._baseHeight):f=this._viewer.entities.add({name:null,id:A._earthCtrl.factory.createUUID(),polygon:{hierarchy:new Bn(function(){return new Un(ee.fromDegreesArrayHeights(A._hierarchy))},!1),material:At.YELLOW.withAlpha(0)}}),A.FlattenPolygon.push(f),A.modelCutting()})};T2.prototype.modelCutting=function(){let o=this;if(o._modelCuttingPolygon=rh.fromPositions({positions:ee.fromDegreesArray(o._Apositions),height:o._baseHeight}),o._modelArr.length>0)for(let A of o._modelArr)A.addFlattenPolygon(o._modelCuttingPolygon),A.needUpdateFlatten=!0,A.clipPlaneOfFlatten=!0;else console.info("\u8BF7\u6DFB\u52A0\u6A21\u578B\uFF01")};T2.prototype.removeModelCutting=function(){let o=this;if(o._modelArr.length>0){for(let A of o._modelArr)A.removeFlattenPolygon(o._modelCuttingPolygon);o._modelCuttingPolygon=null,o._modelArr=[]}};T2.prototype.removeFromMap=function(){if(this.removeMeasureFromMap(),this.FlattenPolygon&&this.FlattenPolygon.length>0){for(let o=0;o<this.FlattenPolygon.length;o++)this._viewer.entities.remove(this.FlattenPolygon[o]);this.FlattenPolygon=[]}this.removeModelCutting()};T2.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=this.loadingImg,o.appendChild(A),this.loading=o,this._viewer.container.appendChild(o)};T2.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};T2.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};var bAt=T2;function M2(o,A={}){this._earthCtrl=o,this._viewer=o.coreMap,this._scene=o.coreMap.scene,this.options=Ae(A,{}),this._Apositions=[],this.FlattenPolygon=[],this._terrainFlatten=new IN(o.coreMap.scene),this._Loading=Ae(A.loading,!1),this._bottom=Ae(A.bottom,!1),this.loadingImg=Ae(A.loadingImg,`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`),this._Tooltip=new gw(o),this._tooltip=this._Tooltip.CreateTooltip(),this._positions=[],this._deepth=10,this._drawColor={point:Ae(this.options.drawColor?.point,At.BLUE),polyline:Ae(this.options.drawColor?.polyline,At.YELLOW),polygon:Ae(this.options.drawColor?.polygon,At.YELLOW.withAlpha(.5))}}M2.prototype.removeMeasureFromMap=function(){this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=void 0),this.Triangulation=[],this.tinData=void 0,this._tooltip.show(!1)};M2.prototype.startDrawing=function(o={},A){let f=this._scene,m=this._tooltip,C=3,y,x=[],v=[],E=[],I=[],w=[];this._positions=v,this._hierarchy=E,this._heightsort=I,this._degreesArr=w,this._deepth=Ae(o.deepth,100);let Q=this;if(this._mouseHandler&&this._mouseHandler.destroy(),this.loading||this.addLoading(),o.positions){let M=ee.fromDegreesArray(o.positions);for(let B of M)v.push(B);if(!(v.length<C)){for(let B=0;B<o.positions.length;B+=2)w.push([o.positions[B],o.positions[B+1]]);this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:ee.fromDegreesArray(o.positions),material:Q._drawColor.polygon,fill:!0}});for(let B=0;B<o.positions.length;B+=2){let T=Q._viewer.scene.sampleHeight(new Kt(je.toRadians(o.positions[B]),je.toRadians(o.positions[B+1])));I.push(T),E.push(o.positions[B],o.positions[B+1],T)}this._Apositions=o.positions,this.stopDrawing(B=>{A&&A(B)})}}else{let M=new Ur(f.canvas);this._mouseHandler=M,this.removeMeasureFromMap(),this._viewer.container.style.cursor=`url(${globalThis.GEOWORLD_BASE_URL} 'Workers/image/cursor/draw.cur')`;let B;M.setInputAction(function(T){if(T.position!==null){let D=f.camera.getPickRay(T.position),F=f.globe.pick(D,f);if(this._viewer.scene.pick(T.position)){let R=this._viewer.scene.pickPosition(T.position);R&&(F=R)}if(F){let R=Kt.fromCartesian(F),k=je.toDegrees(R.longitude),U=je.toDegrees(R.latitude);if(x.length===0&&(x.push(k,U),w.push([k,U]),v.push(F),y=F),v.length>=4){let V=Ss.wgs84ToWindowCoordinates(this._viewer.scene,y);if(V!==void 0){let H=V.x-T.position.x,q=V.y-T.position.y;if(H*H+q*q<16){x.splice(x.length-2,2),v.pop(),this.stopDrawing(A);return}}}x.push(k,U),w.push([k,U]),v.push(F),v.length===2&&!B&&(B=this._viewer.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new Bn(function(){return v},!1),clampToGround:!0,material:Q._drawColor.polygon,width:3}})),v.length===C&&(B&&this._viewer.entities.remove(B),this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:new Un(ee.fromDegreesArray(x)),material:Q._drawColor.polygon,fill:!0}}),this._prevEntity.polygon.hierarchy=new Bn(()=>new Un(ee.fromDegreesArray(x)),!1))}}}.bind(this),Ki.LEFT_CLICK),M.setInputAction(function(T){let D=T.endPosition;if(D!==null)if(v.length===0)m.showAt(D,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7B2C\u4E00\u4E2A\u70B9");else{let F=f.camera.getPickRay(D),L=f.globe.pick(F,f),R=this._viewer.scene.pick(D),k=!1;if(R){let U=this._viewer.scene.pickPosition(D);U&&(L=U),k=!0}if(L){let U=Kt.fromCartesian(L),V=je.toDegrees(U.longitude),H=je.toDegrees(U.latitude);if(x.splice(x.length-2,2),w.pop(),v.pop(),x.push(V,H),w.push([V,H]),v.push(L),m.showAt(D,"\u53F3\u952E\u7ED3\u675F\u7ED8\u5236"),v.length>=3&&v.length>=4){let q=Ss.wgs84ToWindowCoordinates(this._viewer.scene,y);if(q!==void 0){let ie=q.x-D.x,Z=q.y-D.y;ie*ie+Z*Z<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}}.bind(this),Ki.MOUSE_MOVE),M.setInputAction(function(T){this.end&&this.end()}.bind(this),Ki.RIGHT_CLICK),this.end=T=>{if(this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),Q._viewer.container.style.cursor="default",this._tooltip.show(!1),B&&this._viewer.entities.remove(B),this.end=void 0,console.log(w,"?????????"),!(v.length<C)){if(this._prevEntity&&(this._prevEntity.polygon.hierarchy=ee.fromDegreesArray(x)),T==="cancel"){this._prevEntity&&this._viewer.entities.remove(this._prevEntity);return}for(let D=0;D<x.length;D+=2){let F=Q._viewer.scene.sampleHeight(new Kt(je.toRadians(x[D]),je.toRadians(x[D+1])));I.push(F),E.push(x[D],x[D+1],F)}this._Apositions=x,this.stopDrawing(A)}}}};M2.prototype.stopDrawing=function(o){let A=this;this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._Loading&&this.isLoading(!0),setTimeout(()=>{A._heightsort.sort(function(C,y){return C-y});let f=null;A._bottom?(f=this._viewer.entities.add({name:null,id:A._earthCtrl.factory.createUUID(),polygon:{hierarchy:new Bn(function(){return new Un(ee.fromDegreesArrayHeights(A._hierarchy))},!1),material:new z0({image:Ae(A.bottomImgUrl,`${window.SmartEarthRootUrl}Workers/image/bottomplane.jpg`),repeat:new It(1,1)})}}),A._baseHeight=A._heightsort[0]-A._deepth,f.polygon.height=A._baseHeight):f=this._viewer.entities.add({name:null,id:A._earthCtrl.factory.createUUID(),polygon:{hierarchy:new Bn(function(){return new Un(ee.fromDegreesArrayHeights(A._hierarchy))},!1),material:At.YELLOW.withAlpha(0)}}),A.FlattenPolygon.push(f);let m=[];A._baseHeight=A._heightsort[0]-A._deepth;for(let C=0;C<A._hierarchy.length;C+=3)m.push(A._hierarchy[C],A._hierarchy[C+1],A._baseHeight);console.log(m,"\u4F4D\u7F6E\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A"),A.terrainCutting(m)})};M2.prototype.terrainCutting=function(o){let A=this;A._terrainFlatten.addPolygon(o),A._terrainFlatten.update(),A._terrainFlatten.clipPlaneOfFlatten=!0};M2.prototype.removeTerrainCutting=function(){this._terrainFlatten.clearPolygon()};M2.prototype.removeFromMap=function(){if(this.removeMeasureFromMap(),this.FlattenPolygon&&this.FlattenPolygon.length>0){for(let o=0;o<this.FlattenPolygon.length;o++)this._viewer.entities.remove(this.FlattenPolygon[o]);this.FlattenPolygon=[]}this.removeTerrainCutting()};M2.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=this.loadingImg,o.appendChild(A),this.loading=o,this._viewer.container.appendChild(o)};M2.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};M2.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};var QAt=M2;function pw(o,A={}){this._earthCtrl=o,this._terrainFlatten=new IN(this._earthCtrl.coreMap.scene),this._viewer=o.coreMap,this._scene=o.coreMap.scene,this.options=Ae(A,{}),this._Tooltip=new gw(o),this._tooltip=this._Tooltip.CreateTooltip(),this._drawColor={point:Ae(this.options.drawColor?.point,At.BLUE),polyline:Ae(this.options.drawColor?.polyline,At.YELLOW),polygon:Ae(this.options.drawColor?.polygon,At.YELLOW.withAlpha(.5))},this.loadingImg=`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`,this.wallArr=[],this.FlattenPolygon=[],this._Apositions=[],this._heightsort=null,this._deepth=100,this._positions=[],this._modelArr=Ae(A.modelArr,[]),this._isFlattening=Ae(A.isFlattening,!0),this.modelCuttingPolygon=null,this.wallImgUrl=Ae(A.wallImgUrl,null),this.bottomImgUrl=Ae(A.bottomImgUrl,null),this._Loading=Ae(A.loading,!0)}pw.prototype.removeMeasureFromMap=function(){this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=void 0),this.Triangulation=[],this.tinData=void 0,this._tooltip.show(!1)};pw.prototype.removeFromMap=function(){if(this.removeMeasureFromMap(),this.wallArr.length>0){for(let o=0;o<this.wallArr.length;o++)this._viewer.entities.remove(this.wallArr[o]);this.wallArr=[]}if(this.FlattenPolygon&&this.FlattenPolygon.length>0){for(let o=0;o<this.FlattenPolygon.length;o++)this._viewer.entities.remove(this.FlattenPolygon[o]);this.FlattenPolygon=[]}this.removeModelCutting()};pw.prototype.deleteObject=pw.prototype.removeFromMap;pw.prototype.startDrawing=function(o={},A){let f=Ae(o.spacing,"auto"),m=this._scene,C=this._tooltip,y=3,x=this._positions,v=[],E;this._Apositions=o.positions,this._heightsort=v,this._deepth=Ae(o.deepth,100),this._sampleStep=Ae(o.sampleStep,100),this._maxSampleCount=Ae(o.maxSampleCount,200),this._drawColor.point=o.point||this._drawColor.point,this._drawColor.polyline=o.polyline||this._drawColor.polyline,this._drawColor.polygon=o.polygon||this._drawColor.polygon,this.loadingImg=o.loading||this.loadingImg;let I=this;if(this._mouseHandler&&this._mouseHandler.destroy(),this.loading||this.addLoading(),!o.positions){let w=new Ur(m.canvas);this._mouseHandler=w,this.removeMeasureFromMap(),this._viewer.container.style.cursor=`url(${globalThis.GEOWORLD_BASE_URL} 'Assets/image/cursor/draw.cur')`;let Q;w.setInputAction(function(B){if(B.position!==null){let T=this._viewer.scene.pickPosition(B.position);if(T){let D=Kt.fromCartesian(T);if(x.length===0&&(x.push(D),E=T),x.length>=4){let F=Ss.wgs84ToWindowCoordinates(this._viewer.scene,E);if(F!==void 0){let L=F.x-B.position.x,R=F.y-B.position.y;if(L*L+R*R<16){x.splice(x.length-2,2),this.stopDrawing(A);return}}}x.push(D),x.length===2&&!Q&&(Q=this._viewer.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new Bn(function(){let F=[];for(let L=0;L<x.length;L++){let R=x[L];F.push(R.longitude,R.latitude,R.height)}return ee.fromRadiansArrayHeights(F)},!1),clampToGround:!1,material:I._drawColor.polygon,width:3}})),x.length===y&&(Q&&this._viewer.entities.remove(Q),this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:new Bn(()=>{let F=[];for(let L=0;L<x.length;L++){let R=x[L];F.push(R.longitude,R.latitude,R.height)}return new Un(ee.fromRadiansArrayHeights(F))},!1),material:I._drawColor.polygon,fill:!0}}))}}}.bind(this),Ki.LEFT_CLICK),w.setInputAction(function(B){let T=B.endPosition;if(T!==null)if(x.length===0)C.showAt(T,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7B2C\u4E00\u4E2A\u70B9");else{let D=this._viewer.scene.pickPosition(T);if(D){let F=Kt.fromCartesian(D);if(x.splice(x.length-1,1),x.push(F),C.showAt(T,"\u53F3\u952E\u7ED3\u675F\u7ED8\u5236"),x.length>=3&&x.length>=4){let L=Ss.wgs84ToWindowCoordinates(this._viewer.scene,E);if(L!==void 0){let R=L.x-T.x,k=L.y-T.y;R*R+k*k<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}}.bind(this),Ki.MOUSE_MOVE);let M=null;w.setInputAction(function(B){M=window.setTimeout(()=>{console.log("\u5355\u51FB"),this.end&&this.end()},200)}.bind(this),Ki.RIGHT_CLICK),w.setInputAction(function(B){console.log("\u53CC\u51FB......"),clearTimeout(M)},Ki.LEFT_DOUBLE_CLICK),this.end=B=>{if(this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),I._viewer.container.style.cursor="default",this._tooltip.show(!1),Q&&this._viewer.entities.remove(Q),this.end=void 0,!(x.length<y)){if(this._prevEntity&&this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0,B==="cancel")return;for(let T=0;T<x.length;T+=2){let D=x[T].height;v.push(D)}this._Apositions=x,this.stopDrawing(f,A)}}}return this};function TLi(o,A,f){let m=je.lerp(o.longitude,A.longitude,1/f)-o.longitude,C=je.lerp(o.latitude,A.latitude,1/f)-o.latitude,y=[];y.push(o);for(let x=0;x<f;x++){let v=o.longitude+(x+1)*m,E=o.latitude+(x+1)*C;y.push(new Kt(v,E))}return y.push(A),y}function MLi(o,A,f,m,C){let y=[];A.forEach(function(x){let v=Kt.toCartesian(new Kt(x.longitude,x.latitude,m)),E=Kt.toCartesian(new Kt(x.longitude,x.latitude,f)),I=ee.normalize(ee.subtract(E,v,new ee),new ee),w=new ls(v,I),Q=null,M=[],B=o.scene.drillPickFromRay(w,1,M);o.scene.globe.show=!1,B.length>0&&!B[0].object&&B[0].position?(Q=o.scene.drillPickFromRay(w,100,M),Q.unshift(B[0])):Q=o.scene.drillPickFromRay(w,100,M),o.scene.globe.show=!0,y.push(Q)}),typeof C=="function"&&C(y)}function PLi(o,A,f){for(let y=0;y<o.length;y++){let x=o[y];for(let v=0;v<x.length;v++){let E=x[v].position,I=Kt.fromCartesian(E);if(I.height<A){x.splice(v,x.length-v);let w=ee.fromRadians(I.latitude,I.longitude,A);x.push({object:null,position:w});break}}{let v=x[x.length-1].position,E=Kt.fromCartesian(v);if(Math.abs(E.height-A)>.01){let I=ee.fromRadians(E.latitude,E.longitude,A);x.push({object:null,position:I})}}{let v=x[x.length-1].position,E=Kt.fromCartesian(v);console.log("di",E.height)}}for(let y=0;y<o.length;y++){let x=o[y],v=x[x.length-1];f.push(v.position)}let m=0;o.forEach(function(y){m=m<y.length?y.length:m}),o.forEach(function(y){if(m-y.length>0){let v=y.length;y.length=m,y.fill(null,v,y.length)}});let C=[];for(let y=0;y<m-1;y++){let x=[],v=[];for(let E=0;E<o.length;E++){let I=o[E][y],w=o[E][y+1];I&&w&&(x.push(I),v.push(w))}C.push({ups:x,bottoms:v})}return C}pw.prototype.stopDrawing=function(o,A){let f=this;this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._Loading&&this.isLoading(!0);let m=this._positions,C=this._viewer,y=this.wallArr,x=this._deepth,v=this._sampleStep,E=this._maxSampleCount;m.push(m[0]);let I=0;for(let w=0;w<m.length-1;w++){let Q=ee.fromRadians(m[w].longitude,m[w].latitude,m[w].height),M=ee.fromRadians(m[w+1].longitude,m[w+1].latitude,m[w+1].height),T=ee.distance(M,Q)/v;I=I<T?T:I}I=E<I?E:I,I=260,setTimeout(()=>{f._heightsort.sort(function(D,F){return D-F});let w=f._heightsort[0]+2e3,Q=f._heightsort[0]-2e3,M=[];for(let D=0;D<m.length-1;D++){let F=m[D],L=m[D+1],R=TLi(F,L,I);MLi(C,R,Q,w,function(k){let U=PLi(k,x,M);for(let V=0;V<U.length;V++){let H=U[V];y.push(RLi(C,H,V))}})}let B=[];for(let D=0;D<m.length;D++){let F=m[D];B.push(F.longitude,F.latitude,x)}let T=C.entities.add({polygon:{hierarchy:{positions:ee.fromRadiansArrayHeights(B)},perPositionHeight:!0,granularity:je.RADIANS_PER_DEGREE*100,material:new z0({image:`${globalThis.GEOWORLD_BASE_URL}Workers/image/bottomplane.jpg`,repeat:new It(1,1)}),fill:!0}});return y.push(T),f._isFlattening&&f.modelCutting(),A&&A(!0),this.isLoading(!1)},20)};pw.prototype.modelCutting=function(){let o=this,A=this._deepth,f=this._positions,m=[],C=[];for(let y=0;y<f.length;y++){let x=f[y];m.push(x.longitude,x.latitude,x.height-10),C.push(je.toDegrees(x.longitude),je.toDegrees(x.latitude),x.height-10)}if(o._modelCuttingPolygon=rh.fromPositions({positions:ee.fromRadiansArrayHeights(m),height:A-10}),o._terrainFlatten.addPolygon(C),o._terrainFlatten.update(),o._terrainFlatten.clipPlaneOfFlatten=!0,o._modelArr.length>0)for(let y of o._modelArr)y.addFlattenPolygon(o._modelCuttingPolygon),y.needUpdateFlatten=!0,y.clipPlaneOfFlatten=!0;else console.info("\u8BF7\u6DFB\u52A0\u6A21\u578B\uFF01")};pw.prototype.removeModelCutting=function(){let o=this;if(o._modelArr.length>0){for(let A of o._modelArr)A.removeFlattenPolygon(o._modelCuttingPolygon);o._modelCuttingPolygon=null,o._modelArr=[],o._terrainFlatten.clearPolygon(),o._terrainFlatten.clipPlaneOfFlatten=!1}else console.info("\u8BF7\u6DFB\u52A0\u6A21\u578B\uFF01")};function RLi(o,A,f){let m=[],C=[];for(let I=0;I<A.ups.length;I++){let w=A.ups[I];m.push(w.position);let Q=Kt.fromCartesian(w.position);C.push(Q.height)}let y=[];for(let I=0;I<A.bottoms.length;I++){let w=A.bottoms[I],Q=Kt.fromCartesian(w.position);y.push(Q.height)}let x=`${globalThis.GEOWORLD_BASE_URL}Workers/image/MTY0001.jpg`,v=`${globalThis.GEOWORLD_BASE_URL}Workers/image/MTY0002.jpg`,E=o.entities.add({wall:{positions:m,material:new z0({image:f%2?x:v,repeat:new It(.01,.01)}),maximumHeights:C,minimumHeights:y,granularity:je.RADIANS_PER_DEGREE*100}});return E.show=!0,E}pw.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=this.loadingImg,o.appendChild(A),this.loading=o,this._viewer.container.appendChild(o)};pw.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};pw.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};var SAt=pw;function id(o){this._earthCtrl=o,this._coreMap=o.coreMap,this.tools=[],this.vols=[],this.saveResult=!1}id.prototype.getDistanceSpace=function(o){this.saveResult===!1&&this.deleteObject(),this._tool=new NW(this._earthCtrl),this._tool.spaceDistance(o),this.tools.push(this._tool)};id.prototype.getDistanceHorizontal=function(o){this.saveResult===!1&&this.deleteObject(),this._tool=new NW(this._earthCtrl),this._tool.horizontalDistance(o),this.tools.push(this._tool)};id.prototype.deleteObject=function(){O(this._tool)&&this._tool.deleteObject(),this.saveResult===!1&&this.tools.pop()};id.prototype.deleteAll=function(){this.tools.forEach(function(o){o.deleteObject()}),this.vols.forEach(function(o){o.cleanUp()}),this._earthCtrl.measure.tools.forEach(function(o){o.clearResult()}),this.tools=[],this.vols=[],this._earthCtrl.measure.tools=[]};id.prototype.saveResults=function(o){this.saveResult=o};id.prototype.getPlaneArea=function(o){this.saveResult===!1&&this.deleteObject(),this._tool=new NW(this._earthCtrl),this._tool.getPlaneArea(o),this.tools.push(this._tool)};id.prototype.getSurfaceArea3d=function(o){this.saveResult===!1&&this.deleteObject(),this._tool=new NW(this._earthCtrl),this._tool.getSurfaceArea3d(o),this.tools.push(this._tool)};id.prototype.volumetric=function(o){this.saveResult===!1&&this.removeVolumetric(),this._vol=new Ile(this._earthCtrl),this._vol.startDrawing(o),this.vols.push(this._vol)};id.prototype.removeVolumetric=function(o){O(this._vol)&&this.vols.forEach(function(A){A.cleanUp()})};id.prototype.lineOfSight=function(o){this._tool=new BAt(this._earthCtrl),this._tool.createLineOfSight(o),this.tools.push(this._tool)};id.prototype.createViewShed=function(o){return new Ele(this._earthCtrl,o)};id.prototype.createSubmergence=function(o){return new _le(this._earthCtrl,o)};id.prototype.createProfile=function(o){return new Ble(this._earthCtrl,o)};id.prototype.createBufferAnalysis=function(o){return new Yre(this._earthCtrl,o)};id.prototype.createSkyline=function(o){return new ble(this._earthCtrl,o)};id.prototype.createCurtainContrast=function(o){return new xAt(this._earthCtrl,o)};id.prototype.createRestrictTheHeight=function(o){return new Sle(this._earthCtrl,o)};id.prototype.createModifyMesh=function(o,A){return new Dle(this._earthCtrl).addClipping(o,A)};id.prototype.createTerrainModifier=function(o){return new Tle(this._earthCtrl,o)};id.prototype.createTerrainExcavation=function(o){return new Rle(this._earthCtrl,o)};id.prototype.createExcavationAndFillAnalysis=function(o){return new Ple(this._earthCtrl,o)};id.prototype.createVolumetricMeasure=function(o){return new _At(this._earthCtrl,o)};id.prototype.createModelVolumetric=function(o){return new wAt(this._earthCtrl,o)};id.prototype.createModelCutting=function(o){return new bAt(this._earthCtrl,o)};id.prototype.createTerrainCutting=function(o){return new QAt(this._earthCtrl,o)};id.prototype.createModelSection=function(o){return new SAt(this._earthCtrl,o)};var Fle=id;function Nle(o,A){if(this._earthCtrl=o,!O(A.flagHtml))throw new Ui("flagDiv is required.");this._flagHtml=A.flagHtml,this._options=Ae(A,Ae.EMAIL),this._circleRadius=Ae(A.circleRadius,10),this._lon=Ae(A.lon,121),this._lat=Ae(A.lat,31),this._height=Ae(A.height,0),this._show=Ae(A.show,!0),this._flagScale=Ae(A.flagScale,4),this._circleColor=Ae(A.circleColor,At.RED),this._cylinderColor=Ae(A.cylinderColor,At.YELLOWGREEN),this._duration=Ae(A.duration,2e3),this._gradient=Ae(A.gradient,2),this._count=Ae(A.count,2),this._canvasZoom=Ae(A.canvasZoom,10),this._circleEntity=void 0,this._cylinderEntity=void 0,this._lineEntity=void 0,this._htmlPlaneEntity=void 0,this._linePlaneEntity=void 0,this._flagDiv=document.createElement("div"),this._flagDiv.style.opacity="0.7",this._flagDiv.style.margin="0",this._flagDiv.style.padding="0",this._flagDiv.id=Ae(A.id,Vu()),this._flagDiv.innerHTML=this._flagHtml,this._show&&this.addToMap()}Nle.prototype.removeFromMap=function(){O(this._circleEntity)&&(this._earthCtrl.entities.remove(this._circleEntity),this._circleEntity=void 0),O(this._cylinderEntity)&&(this._earthCtrl.entities.remove(this._cylinderEntity),this._cylinderEntity=void 0),O(this._lineEntity)&&(this._earthCtrl.entities.remove(this._lineEntity),this._lineEntity=void 0),O(this._linePlaneEntity)&&(this._earthCtrl.entities.remove(this._linePlaneEntity),this._linePlaneEntity=void 0),O(this._htmlPlaneEntity)&&(this._earthCtrl.entities.remove(this._htmlPlaneEntity),this._htmlPlaneEntity=void 0)};Nle.prototype.addToMap=function(){let o=this,A=0,f=2,m,C=ee.fromDegrees(o._lon,o._lat,o._height);if(O(o._circleEntity)||(o._circleEntity=o._earthCtrl.entities.add({position:C,ellipse:{height:o._height,semiMinorAxis:o._circleRadius,semiMajorAxis:o._circleRadius,material:new Z8({duration:o._duration,gradient:o._gradient,color:o._circleColor,count:o._count})}})),!O(o._cylinderEntity)){let v=o._circleRadius*2/5,E=o._circleRadius*3/4;m=dQ.changeCartesian3Height(C,E/2),o._cylinderEntity=o._earthCtrl.entities.add({position:m,cylinder:{length:E,topRadius:v,bottomRadius:v,fill:!0,outline:!1,material:o._cylinderColor}})}if(O(o._lineEntity)||(A=o._circleRadius*o._flagScale+o._height,o._lineEntity=o._earthCtrl.entities.add({polyline:{width:f,positions:ee.fromDegreesArrayHeights([o._lon,o._lat,o._height,o._lon,o._lat,A]),material:o._cylinderColor}})),!O(o._htmlPlaneEntity)){A=o._circleRadius*o._flagScale;let v=A/5,E=v*3,I=A-v/2,w=4*f,Q=new ee(w/2,0,I),M=dQ.changeCartesian3ByScalar(C,Q);this._linePlaneEntity=o._earthCtrl.entities.add({position:M,plane:{plane:new Wa(ee.UNIT_Y,0),dimensions:new It(w,v),material:o._cylinderColor}});let B=new ee(E/2+w,0,I);m=dQ.changeCartesian3ByScalar(C,B);let T=o._flagDiv,D=o._canvasZoom,F=document.createElement("canvas");F.width=10*v/E*D,F.height=10*D,lH.drawDocument(T,F,{zoom:D}).then(function(L){o._htmlPlaneEntity=o._earthCtrl.entities.add({position:new Bn(y,!1),plane:{plane:new Bn(x,!0),dimensions:new It(E,v),material:new z0({image:L.image,transparent:!0})}})},function(L){console.info(L)})}function y(){return m}function x(){let v=new ee;return v=ee.negate(ee.UNIT_Y,v),new Wa(v,0)}};Object.defineProperties(Nle.prototype,{});var DAt=Nle;function kle(o,A){this._earthCtrl=o,this._scene=o.coreMap.scene,this._options=O(A,Ae.EMPTY_OBJECT),this._color=Ae(A.color,At.RED),this._lon=Ae(A.lon,121),this._lat=Ae(A.lat,31),this._height=Ae(A.height,0),this._statistics=Ae(A.statisticData,1e3),this._radius=Ae(A.radius,100),this._duration=Ae(A.duration,2e3),this._gradient=Ae(A.gradient,2),this._count=Ae(A.count,2),this._scale=Ae(A.dataScale,1),this._show=Ae(A.show,!0),this._billboardWidthRatio=Ae(A.billboardWidthRatio,1.2),this._billboardHeightRatio=Ae(A.billboardHeightRatio,2.4),this._prefix=Ae(A.prefix,""),this._scaleByDistance=Ae(A.scaleByDistance,new To(1500,3,15e3,.1)),this._topFillColor=Ae(A.topFillColor,At.fromCssColorString("#323232")),this._circleEntity=void 0,this._cylinderEntity=void 0,this._billboardEntity=void 0,this._position=ee.fromDegrees(this._lon,this._lat,this._height),this._show&&this.addToMap()}var RN=new ee;kle.prototype.addToMap=function(){let o=this;if(O(o._circleEntity)||(o._circleEntity=o._earthCtrl.entities.add({position:o._position,ellipse:{height:o._height,semiMinorAxis:o._radius,semiMajorAxis:o._radius,material:new Z8({duration:o._duration,gradient:o._gradient,color:o._color,count:o._count})}})),!O(o._cylinderEntity)){RN=ee.clone(o._position,RN);let A=o._statistics*o._scale,f=Vn.eastNorthUpToFixedFrame(RN),m=new ee(0,0,A/2);Xe.multiplyByPoint(f,m,RN),o._cylinderEntity=o._earthCtrl.entities.add({position:RN,cylinder:{length:A,topRadius:o._radius/10,bottomRadius:o._radius/10,fill:!0,outline:!1,material:o._color}})}if(!O(o._billboardEntity)){RN=ee.clone(o._position,RN);let A=o._cylinderEntity.cylinder.length._value,f=Kt.fromCartesian(RN),m=ee.fromRadians(f.longitude,f.latitude,f.height+A);o._billboardEntity=o._earthCtrl.entities.add({position:m,billboard:{scaleByDistance:o._scaleByDistance,verticalOrigin:bn.BOTTOM,width:o._radius/o._billboardWidthRatio,height:o._radius/o._billboardHeightRatio,image:NLi(o._color,o._topFillColor,o._prefix+o._statistics,o._radius).toDataURL()}})}};kle.prototype.removeFromMap=function(){O(this._cylinderEntity)&&(this._earthCtrl.entities.remove(this._cylinderEntity),this._cylinderEntity=void 0),O(this._circleEntity)&&(this._earthCtrl.entities.remove(this._circleEntity),this._circleEntity=void 0),O(this._billboardEntity)&&(this._earthCtrl.entities.remove(this._billboardEntity),this._billboardEntity=void 0)};function LLi(o,A,f,m){o.save(),o.strokeStyle="rgba(0,0,0,0)",o.scale(m/150,m/100),o.save(),o.fillStyle=A.toCssColorString(),o.lineWidth=4,o.beginPath(),o.moveTo(77.8,82.1),o.lineTo(64.6,69),o.lineTo(23.8,69),o.bezierCurveTo(20.8,69,18.3,66.5,18.3,63.5),o.lineTo(18.3,22.5),o.bezierCurveTo(18.3,19.5,20.8,17,23.8,17),o.lineTo(131.8,17),o.bezierCurveTo(134.8,17,137.3,19.5,137.3,22.5),o.lineTo(137.3,63.5),o.bezierCurveTo(137.3,66.5,134.8,69,131.8,69),o.lineTo(90.9,69),o.lineTo(77.8,82.1),o.closePath(),o.moveTo(23.8,18),o.bezierCurveTo(21.3,18,19.3,20,19.3,22.5),o.lineTo(19.3,63.5),o.bezierCurveTo(19.3,66,21.3,68,23.8,68),o.lineTo(65,68),o.lineTo(77.7,80.7),o.lineTo(90.5,68),o.lineTo(131.8,68),o.bezierCurveTo(134.3,68,136.3,66,136.3,63.5),o.lineTo(136.3,22.5),o.bezierCurveTo(136.3,20,134.3,18,131.8,18),o.lineTo(23.8,18),o.closePath(),o.fill(),o.stroke(),o.restore(),o.save(),o.fillStyle=f.toCssColorString(),o.beginPath(),o.moveTo(131.8,18),o.lineTo(23.80000000000001,18),o.bezierCurveTo(21.30000000000001,18,19.30000000000001,20,19.30000000000001,22.5),o.lineTo(19.30000000000001,63.5),o.bezierCurveTo(19.30000000000001,66,21.30000000000001,68,23.80000000000001,68),o.lineTo(65,68),o.lineTo(77.7,80.7),o.lineTo(90.5,68),o.lineTo(131.8,68),o.bezierCurveTo(134.3,68,136.3,66,136.3,63.5),o.lineTo(136.3,22.5),o.bezierCurveTo(136.3,20,134.2,18,131.8,18),o.closePath(),o.fill(),o.stroke(),o.restore(),o.restore()}function FLi(o,A,f){let m=f/1.4,C=m,y=m;A.width>A.height?y=m*(A.height/A.width):A.width<A.height&&(C=m*(A.width/A.height));let x=f/150*8,v=Math.round((f-C+x)/2),E=Math.round((5/6*f-y)/2);o.drawImage(A,v,E,C,y)}function NLi(o,A,f,m){let C=document.createElement("canvas");C.width=m,C.height=m;let y=C.getContext("2d");LLi(y,o,A,m);let x=m,v=N5(f,{font:`bold ${x}pt Microsoft YaHei`,fillColor:o});return FLi(y,v,x),C}Object.defineProperties(kle.prototype,{billboard:{get:function(){return this._billboardEntity}},cylinder:{get:function(){return this._cylinderEntity}},circle:{get:function(){return this._circleEntity}},show:{get:function(){return this._show},set:function(o){O(this._billboardEntity)&&(this._billboardEntity.show=o),O(this._cylinderEntity)&&(this._cylinderEntity.show=o),O(this._circleEntity)&&(this._circleEntity.show=o)}}});var TAt=kle;function dMe(o,A){if(this._earthCtrl=o,this._scene=o.coreMap.scene,this._options=Ae(A,Ae.EMPTY_OBJECT),this._color=Ae(A.color,At.RED),this._lon=Ae(A.lon,121),this._lat=Ae(A.lat,31),this._height=Ae(A.height,0),this._show=Ae(A.show,!0),this._containerWidth=Ae(A.containerWidth,200),this._containerHeight=Ae(A.containerHeight,200),this._containerColor=Ae(A.cylinderColor,At.YELLOWGREEN),this._canvasZoom=Ae(A.canvasZoom,10),this._scaleByDistance=Ae(A.scaleByDistance,new To(1500,3,15e3,.1)),this._tipsHtml=A.tipsHtml,this._tipsEntity=void 0,this._tipsDiv=document.createElement("div"),this._tipsDiv.style.opacity="0.7",this._tipsDiv.style.margin="0",this._tipsDiv.style.padding="0",this._tipsDiv.id=Ae(A.id,Vu()),this._tipsDiv.innerHTML=this._tipsHtml,!O(A.tipsHtml))throw new Ui("tipsHtml is required.");this.addToMap()}dMe.prototype.removeFromMap=function(){O(this._tipsEntity)&&(this._earthCtrl.entities.remove(this._tipsEntity),this._tipsEntity=void 0),O(this._tipsDiv)&&(this._earthCtrl.entities.remove(this._tipsDiv),this._tipsDiv=void 0)};dMe.prototype.addToMap=function(){let o=this,A=ee.fromDegrees(o._lon,o._lat,o._height);if(!O(o._tipsEntity)){let m=o._containerHeight,C=o._containerWidth,y=o._canvasZoom,x=o._tipsDiv,v=document.createElement("canvas");v.width=C,v.height=m,lH.drawDocument(x,v,{zoom:y}).then(function(E){o._tipsEntity=o._earthCtrl.entities.add({position:new Bn(f,!1),billboard:{scaleByDistance:o._scaleByDistance,verticalOrigin:bn.BOTTOM,width:C,height:m,image:E.image.src}})},function(E){console.info(E)})}function f(){return A}};var MAt=dMe;function WO(o,A){this._earthCtrl=o,this._scene=o.coreMap.scene,this._options=Ae(A,Ae.EMPTY_OBJECT),this.element=document.createElement("div"),this._html=Ae(A.html,""),this._lon=Ae(A.lon,121),this._lat=Ae(A.lat,31),this._height=Ae(A.height,10),this._show=Ae(A.show,!0),this._removeHandler=void 0,this._pos=void 0,this._position=void 0,this._c=void 0,this._changedC=void 0,this._point=void 0,this._parameter=A,this._rtti="GwScreenDialog",this.isInit=!1,this.isInit===!1&&this.addToMap()}WO.prototype.setHtml=function(o){this.element.innerHTML=o};WO.prototype.setShow=function(o){if(!this.isInit)return 0;this.element.style.display=o?"block":"none"};WO.prototype.showAt=function(){if(!this.isInit)return 0;this._position&&(this._pos=Ss.wgs84ToWindowCoordinates(this._scene,this._position),this._pos&&(this.element.style.left=`${this._pos.x}px`,this.element.style.top=`${this._pos.y}px`))};WO.prototype.removeFromMap=function(){this.element.remove(),this.isInit=!1};WO.prototype.addToMap=function(){if(this.isInit)return 0;nA(".map-widget",this.element),this.element.innerHTML=this._html,this.element.style.position="absolute",this.isInit=!0,this._position=ee.fromDegrees(this._lon,this._lat,this._height),this.showAt(),this._c=new It(this._pos.x,this._pos.y);let o=this;this._scene.camera.moveStart.addEventListener(function(){o._removeHandler=o._scene.postRender.addEventListener(function(){if(o._c){let A=new L5(Di.WGS84,o._earthCtrl.camera._camera.position);A&&o._position&&(A.isPointVisible(o._position)===!1?o.setShow(!1):(o._show===!0&&o.setShow(!0),o._changedC=Ss.wgs84ToWindowCoordinates(o._scene,o._position),o._changedC?(o._c=o._changedC,o.showAt()):o.setShow(!1)))}})}),this._scene.camera.moveEnd.addEventListener(function(){o._removeHandler&&o._removeHandler.call()})};Object.defineProperties(WO.prototype,{show:{get:function(){return this._show},set:function(o){this._show!==o&&(this._show=o,this.setShow(o))}},html:{get:function(){return this._html},set:function(o){this._html!==o&&(this._html=o,this.setHtml(o))}},lon:{get:function(){return this._lon},set:function(o){this._lon!==o&&(this._lon=o,this._position=ee.fromDegrees(this._lon,this._lat,this._height),this.showAt())}},lat:{get:function(){return this._lat},set:function(o){this._lat!==o&&(this._lat=o,this._position=ee.fromDegrees(this._lon,this._lat,this._height),this.showAt())}},height:{get:function(){return this._height},set:function(o){this._height!==o&&(this._height=o,this._position=ee.fromDegrees(this._lon,this._lat,this._height),this.showAt())}}});var PAt=WO;function OW(o){this._earthCtrl=o,this._coreMap=o.coreMap}OW.prototype.createStatisticFlag=function(o){return new DAt(this._earthCtrl,o)};OW.prototype.createStatisticCylinder=function(o){return new TAt(this._earthCtrl,o)};OW.prototype.createTipsContainer=function(o){return new MAt(this._earthCtrl,o)};OW.prototype.createScreenDialog=function(o){return new PAt(this._earthCtrl,o)};var RAt=OW;function Ole(){var o=["getKeyRecoveryParam","curveType","Input not Buffer","map","_ipad","b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef","setAutoPadding","rejected",'{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}',"dir","transform","ERR_UNKNOWN_ENCODING","mulf","Apr","_verify2","tmp","EncoderBuffer","password","raw","isBoxedPrimitive","onRuntimeInitialized","seqof","addn","sqlite3_bind_double","sum32_5","000000000000000000","bufferedRequest","non-byte EncoderBuffer value","set","ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","_countBits","assign","publicKey","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758","privateExponent","fired","root","isString","invalid sig","WeakMap","modulus must be greater than 1","_sqlite3_result_int64","-e4437ed6010e88286f547fa90abfe4c3","onend","modelDbModelIdList","The argument '","5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b","save","arrayBufferBlockCount","sum64_5_hi","notStrictEqual","sqlite3_column_blob","entry","c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","utf8","c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","readableListening","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865","/dev/stdin","clock","Password","codes","exitKey","a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","SetModelStoreyTransform","fromRed works only with numbers in reduction context","callbackify","e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","worldDirection","494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","byteLength","spread","kdeparams","canvas","7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","_final","not ","createDecipher","chdir","6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c","[object HTMLCollection]","_sqlite3_changes","dataStoreArrayBuffer","Trace","shim","isArgumentsObject","'name' must be a string","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58","isBuf","falling back to ArrayBuffer instantiation","Index out of range","call","[object Object]","emitter","tagged","rsa",'Failed to peek tag: "',"content","Attempt to access memory outside buffer bounds","eject","ERR_FR_TOO_MANY_REDIRECTS","exists","da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","pipe","String","boolean","Rand","_decodeTag","getHighWaterMark","3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","ERR_BUFFER_OUT_OF_BOUNDS","getCiphers","callee","2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06","serialNumber","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc","tinv","ineg","bool","0x8000000000000000","%Object.getOwnPropertyDescriptor%","00000000000000000","sync","maj32",". Build with -s ASSERTIONS=1 for more info.","0x7fffffffffffffff","search","iterator","readInt16LE","0000000000000","ECONNABORTED","join32","d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","imuln","zeroBits","acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","mtime","setRequestHeader","Instance","9333177ztxjEH","imul","worldUp","\x1B[31m"," [Function","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3","utils","toNumber","Number","heartbeat","ended","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375","isNull","stream","ixor","_importPublic","da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","outSize","path=","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589","hmacStrength","trying to set auth tag in unsupported state","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d","fillLast",'"buf" argument must be a Buffer or Uint8Array',"Jul","fromSecret","ETIMEDOUT","content-length","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e","notStrictEqualObject","aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","746590PyDowD","subjectPrivateKey","emitClose","writing","_secret","___errno_location"," ** ","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8","Number is too big","Function","_decode"," and <= ","4446261rhToce","RDNSequence","shift","numstr","oneC","Cancel","readingMore","BasePoint","52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","simpleSieve","getDivisor","charstr","a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","_events","SaveShell","Premature close","/dev/shm","176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ms exceeded","_sqlite3_open",'" argument must be of type number. Received type ',"recoveryParam","HEAP32","00000000000000000000000","onlyShowShells","persEnc","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8","revBin","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573","config","des-ede3","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e","allowHalfOpen","Not implemented yet","copy","computeSecret","Cipher","d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","handlers","Digest already called",`
uniform sampler2D colorTexture;
uniform sampler2D depthTexture;
// in vec2 v_textureCoordinates;
public/WebSDK/index.js
@@ -1,11 +1,11 @@
/**
 *
 * SmartEarth WebSDK - https://websdk.terra-it.cn
 * Version 3.2.4-11
 * Version 3.2.4-12
 *
 **/
var R_t=Object.create;var XAe=Object.defineProperty;var L_t=Object.getOwnPropertyDescriptor;var F_t=Object.getOwnPropertyNames;var N_t=Object.getPrototypeOf,k_t=Object.prototype.hasOwnProperty;var u1=(o=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(o,{get:(A,f)=>(typeof require<"u"?require:A)[f]}):o)(function(o){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+o+'" is not supported')});var O_t=(o,A)=>()=>(A||o((A={exports:{}}).exports,A),A.exports),g5e=(o,A)=>{for(var f in A)XAe(o,f,{get:A[f],enumerable:!0})},U_t=(o,A,f,m)=>{if(A&&typeof A=="object"||typeof A=="function")for(let C of F_t(A))!k_t.call(o,C)&&C!==f&&XAe(o,C,{get:()=>A[C],enumerable:!(m=L_t(A,C))||m.enumerable});return o};var G_t=(o,A,f)=>(f=o!=null?R_t(N_t(o)):{},U_t(A||!o||!o.__esModule?XAe(f,"default",{value:o,enumerable:!0}):f,o));var vct=O_t((xct,ese)=>{(function(o,A,f){typeof ese<"u"&&ese.exports?ese.exports=f():typeof define=="function"&&define.amd?define(f):A[o]=f()})("h337",xct,function(){var o={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.25:"rgb(0,0,255)",.55:"rgb(0,255,0)",.85:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}},A=function(){var E=function(Q){this._coordinator={},this._data=[],this._radi=[],this._min=10,this._max=1,this._xField=Q.xField||Q.defaultXField,this._yField=Q.yField||Q.defaultYField,this._valueField=Q.valueField||Q.defaultValueField,Q.radius&&(this._cfgRadius=Q.radius)},I=o.defaultRadius;return E.prototype={_organiseData:function(w,Q){var M=w[this._xField],B=w[this._yField],T=this._radi,D=this._data,F=this._max,L=this._min,R=w[this._valueField]||1,k=w.radius||this._cfgRadius||I;D[M]||(D[M]=[],T[M]=[]),D[M][B]?D[M][B]+=R:(D[M][B]=R,T[M][B]=k);var U=D[M][B];return U>F?(Q?this.setDataMax(U):this._max=U,!1):U<L?(Q?this.setDataMin(U):this._min=U,!1):{x:M,y:B,value:R,radius:k,min:L,max:F}},_unOrganizeData:function(){var w=[],Q=this._data,M=this._radi;for(var B in Q)for(var T in Q[B])w.push({x:B,y:T,radius:M[B][T],value:Q[B][T]});return{min:this._min,max:this._max,data:w}},_onExtremaChange:function(){this._coordinator.emit("extremachange",{min:this._min,max:this._max})},addData:function(){if(arguments[0].length>0)for(var w=arguments[0],Q=w.length;Q--;)this.addData.call(this,w[Q]);else{var M=this._organiseData(arguments[0],!0);M&&(this._data.length===0&&(this._min=this._max=M.value),this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[M]}))}return this},setData:function(w){var Q=w.data,M=Q.length;this._data=[],this._radi=[];for(var B=0;B<M;B++)this._organiseData(Q[B],!1);return this._max=w.max,this._min=w.min||0,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},removeData:function(){},setDataMax:function(w){return this._max=w,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setDataMin:function(w){return this._min=w,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setCoordinator:function(w){this._coordinator=w},_getInternalData:function(){return{max:this._max,min:this._min,data:this._data,radi:this._radi}},getData:function(){return this._unOrganizeData()}},E}(),f=function(){var E=function(M){var B=M.gradient||M.defaultGradient,T=document.createElement("canvas"),D=T.getContext("2d");T.width=256,T.height=1;var F=D.createLinearGradient(0,0,256,1);for(var L in B)F.addColorStop(L,B[L]);return D.fillStyle=F,D.fillRect(0,0,256,1),D.getImageData(0,0,256,1).data},I=function(M,B){var T=document.createElement("canvas"),D=T.getContext("2d"),F=M,L=M;if(T.width=T.height=M*2,B==1)D.beginPath(),D.arc(F,L,M,0,2*Math.PI,!1),D.fillStyle="rgba(0,0,0,1)",D.fill();else{var R=D.createRadialGradient(F,L,M*B,F,L,M);R.addColorStop(0,"rgba(0,0,0,1)"),R.addColorStop(1,"rgba(0,0,0,0)"),D.fillStyle=R,D.fillRect(0,0,2*M,2*M)}return T},w=function(L){for(var B=[],T=L.min,D=L.max,F=L.radi,L=L.data,R=Object.keys(L),k=R.length;k--;)for(var U=R[k],V=Object.keys(L[U]),H=V.length;H--;){var q=V[H],ie=L[U][q],Z=F[U][q];B.push({x:U,y:q,value:ie,radius:Z})}return{min:T,max:D,data:B}};function Q(M){var B=M.container,T=this.shadowCanvas=document.createElement("canvas"),D=this.canvas=M.canvas||document.createElement("canvas"),F=this._renderBoundaries=[1e4,1e4,0,0],L=getComputedStyle(M.container)||{};D.className="heatmap-canvas",this._width=D.width=T.width=M.width||+L.width.replace(/px/,""),this._height=D.height=T.height=M.height||+L.height.replace(/px/,""),this.shadowCtx=T.getContext("2d"),this.ctx=D.getContext("2d"),D.style.cssText=T.style.cssText="position:absolute;left:0;top:0;",B.style.position="relative",B.appendChild(D),this._palette=E(M),this._templates={},this._setStyles(M)}return Q.prototype={renderPartial:function(M){M.data.length>0&&(this._drawAlpha(M),this._colorize())},renderAll:function(M){this._clear(),M.data.length>0&&(this._drawAlpha(w(M)),this._colorize())},_updateGradient:function(M){this._palette=E(M)},updateConfig:function(M){M.gradient&&this._updateGradient(M),this._setStyles(M)},setDimensions:function(M,B){this._width=M,this._height=B,this.canvas.width=this.shadowCanvas.width=M,this.canvas.height=this.shadowCanvas.height=B},_clear:function(){this.shadowCtx.clearRect(0,0,this._width,this._height),this.ctx.clearRect(0,0,this._width,this._height)},_setStyles:function(M){this._blur=M.blur==0?0:M.blur||M.defaultBlur,M.backgroundColor&&(this.canvas.style.backgroundColor=M.backgroundColor),this._width=this.canvas.width=this.shadowCanvas.width=M.width||this._width,this._height=this.canvas.height=this.shadowCanvas.height=M.height||this._height,this._opacity=(M.opacity||0)*255,this._maxOpacity=(M.maxOpacity||M.defaultMaxOpacity)*255,this._minOpacity=(M.minOpacity||M.defaultMinOpacity)*255,this._useGradientOpacity=!!M.useGradientOpacity},_drawAlpha:function(D){for(var B=this._min=D.min,T=this._max=D.max,D=D.data||[],F=D.length,L=1-this._blur;F--;){var R=D[F],k=R.x,U=R.y,V=R.radius,H=Math.min(R.value,T),q=k-V,ie=U-V,Z=this.shadowCtx,oe;this._templates[V]?oe=this._templates[V]:this._templates[V]=oe=I(V,L);var ne=(H-B)/(T-B);Z.globalAlpha=ne<.01?.01:ne,Z.drawImage(oe,q,ie),q<this._renderBoundaries[0]&&(this._renderBoundaries[0]=q),ie<this._renderBoundaries[1]&&(this._renderBoundaries[1]=ie),q+2*V>this._renderBoundaries[2]&&(this._renderBoundaries[2]=q+2*V),ie+2*V>this._renderBoundaries[3]&&(this._renderBoundaries[3]=ie+2*V)}},_colorize:function(){var M=this._renderBoundaries[0],B=this._renderBoundaries[1],T=this._renderBoundaries[2]-M,D=this._renderBoundaries[3]-B,F=this._width,L=this._height,R=this._opacity,k=this._maxOpacity,U=this._minOpacity,V=this._useGradientOpacity;M<0&&(M=0),B<0&&(B=0),M+T>F&&(T=F-M),B+D>L&&(D=L-B);for(var H=this.shadowCtx.getImageData(M,B,T,D),q=H.data,ie=q.length,Z=this._palette,oe=3;oe<ie;oe+=4){var ne=q[oe],se=ne*4;if(!!se){var ce;R>0?ce=R:ne<k?ne<U?ce=U:ce=ne:ce=k,q[oe-3]=Z[se],q[oe-2]=Z[se+1],q[oe-1]=Z[se+2],q[oe]=V?Z[se+3]:ce}}H.data=q,this.ctx.putImageData(H,M,B),this._renderBoundaries=[1e3,1e3,0,0]},getValueAt:function(M){var B,T=this.shadowCtx,D=T.getImageData(M.x,M.y,1,1),F=D.data[3],L=this._max,R=this._min;return B=Math.abs(L-R)*(F/255)>>0,B},getDataURL:function(){return this.canvas.toDataURL()}},Q}(),m=function(){var E=!1;return o.defaultRenderer==="canvas2d"&&(E=f),E}(),C={merge:function(){for(var v={},E=arguments.length,I=0;I<E;I++){var w=arguments[I];for(var Q in w)v[Q]=w[Q]}return v}},y=function(){var E=function(){function M(){this.cStore={}}return M.prototype={on:function(B,T,D){var F=this.cStore;F[B]||(F[B]=[]),F[B].push(function(L){return T.call(D,L)})},emit:function(B,T){var D=this.cStore;if(D[B])for(var F=D[B].length,L=0;L<F;L++){var R=D[B][L];R(T)}}},M}(),I=function(Q){var M=Q._renderer,B=Q._coordinator,T=Q._store;B.on("renderpartial",M.renderPartial,M),B.on("renderall",M.renderAll,M),B.on("extremachange",function(D){Q._config.onExtremaChange&&Q._config.onExtremaChange({min:D.min,max:D.max,gradient:Q._config.gradient||Q._config.defaultGradient})}),T.setCoordinator(B)};function w(){var Q=this._config=C.merge(o,arguments[0]||{});if(this._coordinator=new E,Q.plugin){var M=Q.plugin;if(o.plugins[M]){var B=o.plugins[M];this._renderer=new B.renderer(Q),this._store=new B.store(Q)}else throw new Error("Plugin '"+M+"' not found. Maybe it was not registered.")}else this._renderer=new m(Q),this._store=new A(Q);I(this)}return w.prototype={addData:function(){return this._store.addData.apply(this._store,arguments),this},removeData:function(){return this._store.removeData&&this._store.removeData.apply(this._store,arguments),this},setData:function(){return this._store.setData.apply(this._store,arguments),this},setDataMax:function(){return this._store.setDataMax.apply(this._store,arguments),this},setDataMin:function(){return this._store.setDataMin.apply(this._store,arguments),this},configure:function(Q){return this._config=C.merge(this._config,Q),this._renderer.updateConfig(this._config),this._coordinator.emit("renderall",this._store._getInternalData()),this},repaint:function(){return this._coordinator.emit("renderall",this._store._getInternalData()),this},getData:function(){return this._store.getData()},getDataURL:function(){return this._renderer.getDataURL()},getValueAt:function(Q){return this._store.getValueAt?this._store.getValueAt(Q):this._renderer.getValueAt?this._renderer.getValueAt(Q):null}},w}(),x={create:function(v){return new y(v)},register:function(v,E){o.plugins[v]=E}};return x})});var p5e="WebSDK v3.2.4-11",m5e="Cesium v1.99",C5e="2023.11.28",H_t="SmartEarth",V_t={VERSION:p5e,CesiumVERSION:m5e,CompileTime:C5e},z_t=typeof window<"u"?window:typeof self<"u"?self:{};z_t.logSmartEarth=()=>{let o=`
var R_t=Object.create;var XAe=Object.defineProperty;var L_t=Object.getOwnPropertyDescriptor;var F_t=Object.getOwnPropertyNames;var N_t=Object.getPrototypeOf,k_t=Object.prototype.hasOwnProperty;var u1=(o=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(o,{get:(A,f)=>(typeof require<"u"?require:A)[f]}):o)(function(o){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+o+'" is not supported')});var O_t=(o,A)=>()=>(A||o((A={exports:{}}).exports,A),A.exports),g5e=(o,A)=>{for(var f in A)XAe(o,f,{get:A[f],enumerable:!0})},U_t=(o,A,f,m)=>{if(A&&typeof A=="object"||typeof A=="function")for(let C of F_t(A))!k_t.call(o,C)&&C!==f&&XAe(o,C,{get:()=>A[C],enumerable:!(m=L_t(A,C))||m.enumerable});return o};var G_t=(o,A,f)=>(f=o!=null?R_t(N_t(o)):{},U_t(A||!o||!o.__esModule?XAe(f,"default",{value:o,enumerable:!0}):f,o));var vct=O_t((xct,ese)=>{(function(o,A,f){typeof ese<"u"&&ese.exports?ese.exports=f():typeof define=="function"&&define.amd?define(f):A[o]=f()})("h337",xct,function(){var o={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.25:"rgb(0,0,255)",.55:"rgb(0,255,0)",.85:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}},A=function(){var E=function(Q){this._coordinator={},this._data=[],this._radi=[],this._min=10,this._max=1,this._xField=Q.xField||Q.defaultXField,this._yField=Q.yField||Q.defaultYField,this._valueField=Q.valueField||Q.defaultValueField,Q.radius&&(this._cfgRadius=Q.radius)},I=o.defaultRadius;return E.prototype={_organiseData:function(w,Q){var M=w[this._xField],B=w[this._yField],T=this._radi,D=this._data,F=this._max,L=this._min,R=w[this._valueField]||1,k=w.radius||this._cfgRadius||I;D[M]||(D[M]=[],T[M]=[]),D[M][B]?D[M][B]+=R:(D[M][B]=R,T[M][B]=k);var U=D[M][B];return U>F?(Q?this.setDataMax(U):this._max=U,!1):U<L?(Q?this.setDataMin(U):this._min=U,!1):{x:M,y:B,value:R,radius:k,min:L,max:F}},_unOrganizeData:function(){var w=[],Q=this._data,M=this._radi;for(var B in Q)for(var T in Q[B])w.push({x:B,y:T,radius:M[B][T],value:Q[B][T]});return{min:this._min,max:this._max,data:w}},_onExtremaChange:function(){this._coordinator.emit("extremachange",{min:this._min,max:this._max})},addData:function(){if(arguments[0].length>0)for(var w=arguments[0],Q=w.length;Q--;)this.addData.call(this,w[Q]);else{var M=this._organiseData(arguments[0],!0);M&&(this._data.length===0&&(this._min=this._max=M.value),this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[M]}))}return this},setData:function(w){var Q=w.data,M=Q.length;this._data=[],this._radi=[];for(var B=0;B<M;B++)this._organiseData(Q[B],!1);return this._max=w.max,this._min=w.min||0,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},removeData:function(){},setDataMax:function(w){return this._max=w,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setDataMin:function(w){return this._min=w,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setCoordinator:function(w){this._coordinator=w},_getInternalData:function(){return{max:this._max,min:this._min,data:this._data,radi:this._radi}},getData:function(){return this._unOrganizeData()}},E}(),f=function(){var E=function(M){var B=M.gradient||M.defaultGradient,T=document.createElement("canvas"),D=T.getContext("2d");T.width=256,T.height=1;var F=D.createLinearGradient(0,0,256,1);for(var L in B)F.addColorStop(L,B[L]);return D.fillStyle=F,D.fillRect(0,0,256,1),D.getImageData(0,0,256,1).data},I=function(M,B){var T=document.createElement("canvas"),D=T.getContext("2d"),F=M,L=M;if(T.width=T.height=M*2,B==1)D.beginPath(),D.arc(F,L,M,0,2*Math.PI,!1),D.fillStyle="rgba(0,0,0,1)",D.fill();else{var R=D.createRadialGradient(F,L,M*B,F,L,M);R.addColorStop(0,"rgba(0,0,0,1)"),R.addColorStop(1,"rgba(0,0,0,0)"),D.fillStyle=R,D.fillRect(0,0,2*M,2*M)}return T},w=function(L){for(var B=[],T=L.min,D=L.max,F=L.radi,L=L.data,R=Object.keys(L),k=R.length;k--;)for(var U=R[k],V=Object.keys(L[U]),H=V.length;H--;){var q=V[H],ie=L[U][q],Z=F[U][q];B.push({x:U,y:q,value:ie,radius:Z})}return{min:T,max:D,data:B}};function Q(M){var B=M.container,T=this.shadowCanvas=document.createElement("canvas"),D=this.canvas=M.canvas||document.createElement("canvas"),F=this._renderBoundaries=[1e4,1e4,0,0],L=getComputedStyle(M.container)||{};D.className="heatmap-canvas",this._width=D.width=T.width=M.width||+L.width.replace(/px/,""),this._height=D.height=T.height=M.height||+L.height.replace(/px/,""),this.shadowCtx=T.getContext("2d"),this.ctx=D.getContext("2d"),D.style.cssText=T.style.cssText="position:absolute;left:0;top:0;",B.style.position="relative",B.appendChild(D),this._palette=E(M),this._templates={},this._setStyles(M)}return Q.prototype={renderPartial:function(M){M.data.length>0&&(this._drawAlpha(M),this._colorize())},renderAll:function(M){this._clear(),M.data.length>0&&(this._drawAlpha(w(M)),this._colorize())},_updateGradient:function(M){this._palette=E(M)},updateConfig:function(M){M.gradient&&this._updateGradient(M),this._setStyles(M)},setDimensions:function(M,B){this._width=M,this._height=B,this.canvas.width=this.shadowCanvas.width=M,this.canvas.height=this.shadowCanvas.height=B},_clear:function(){this.shadowCtx.clearRect(0,0,this._width,this._height),this.ctx.clearRect(0,0,this._width,this._height)},_setStyles:function(M){this._blur=M.blur==0?0:M.blur||M.defaultBlur,M.backgroundColor&&(this.canvas.style.backgroundColor=M.backgroundColor),this._width=this.canvas.width=this.shadowCanvas.width=M.width||this._width,this._height=this.canvas.height=this.shadowCanvas.height=M.height||this._height,this._opacity=(M.opacity||0)*255,this._maxOpacity=(M.maxOpacity||M.defaultMaxOpacity)*255,this._minOpacity=(M.minOpacity||M.defaultMinOpacity)*255,this._useGradientOpacity=!!M.useGradientOpacity},_drawAlpha:function(D){for(var B=this._min=D.min,T=this._max=D.max,D=D.data||[],F=D.length,L=1-this._blur;F--;){var R=D[F],k=R.x,U=R.y,V=R.radius,H=Math.min(R.value,T),q=k-V,ie=U-V,Z=this.shadowCtx,oe;this._templates[V]?oe=this._templates[V]:this._templates[V]=oe=I(V,L);var ne=(H-B)/(T-B);Z.globalAlpha=ne<.01?.01:ne,Z.drawImage(oe,q,ie),q<this._renderBoundaries[0]&&(this._renderBoundaries[0]=q),ie<this._renderBoundaries[1]&&(this._renderBoundaries[1]=ie),q+2*V>this._renderBoundaries[2]&&(this._renderBoundaries[2]=q+2*V),ie+2*V>this._renderBoundaries[3]&&(this._renderBoundaries[3]=ie+2*V)}},_colorize:function(){var M=this._renderBoundaries[0],B=this._renderBoundaries[1],T=this._renderBoundaries[2]-M,D=this._renderBoundaries[3]-B,F=this._width,L=this._height,R=this._opacity,k=this._maxOpacity,U=this._minOpacity,V=this._useGradientOpacity;M<0&&(M=0),B<0&&(B=0),M+T>F&&(T=F-M),B+D>L&&(D=L-B);for(var H=this.shadowCtx.getImageData(M,B,T,D),q=H.data,ie=q.length,Z=this._palette,oe=3;oe<ie;oe+=4){var ne=q[oe],se=ne*4;if(!!se){var ce;R>0?ce=R:ne<k?ne<U?ce=U:ce=ne:ce=k,q[oe-3]=Z[se],q[oe-2]=Z[se+1],q[oe-1]=Z[se+2],q[oe]=V?Z[se+3]:ce}}H.data=q,this.ctx.putImageData(H,M,B),this._renderBoundaries=[1e3,1e3,0,0]},getValueAt:function(M){var B,T=this.shadowCtx,D=T.getImageData(M.x,M.y,1,1),F=D.data[3],L=this._max,R=this._min;return B=Math.abs(L-R)*(F/255)>>0,B},getDataURL:function(){return this.canvas.toDataURL()}},Q}(),m=function(){var E=!1;return o.defaultRenderer==="canvas2d"&&(E=f),E}(),C={merge:function(){for(var v={},E=arguments.length,I=0;I<E;I++){var w=arguments[I];for(var Q in w)v[Q]=w[Q]}return v}},y=function(){var E=function(){function M(){this.cStore={}}return M.prototype={on:function(B,T,D){var F=this.cStore;F[B]||(F[B]=[]),F[B].push(function(L){return T.call(D,L)})},emit:function(B,T){var D=this.cStore;if(D[B])for(var F=D[B].length,L=0;L<F;L++){var R=D[B][L];R(T)}}},M}(),I=function(Q){var M=Q._renderer,B=Q._coordinator,T=Q._store;B.on("renderpartial",M.renderPartial,M),B.on("renderall",M.renderAll,M),B.on("extremachange",function(D){Q._config.onExtremaChange&&Q._config.onExtremaChange({min:D.min,max:D.max,gradient:Q._config.gradient||Q._config.defaultGradient})}),T.setCoordinator(B)};function w(){var Q=this._config=C.merge(o,arguments[0]||{});if(this._coordinator=new E,Q.plugin){var M=Q.plugin;if(o.plugins[M]){var B=o.plugins[M];this._renderer=new B.renderer(Q),this._store=new B.store(Q)}else throw new Error("Plugin '"+M+"' not found. Maybe it was not registered.")}else this._renderer=new m(Q),this._store=new A(Q);I(this)}return w.prototype={addData:function(){return this._store.addData.apply(this._store,arguments),this},removeData:function(){return this._store.removeData&&this._store.removeData.apply(this._store,arguments),this},setData:function(){return this._store.setData.apply(this._store,arguments),this},setDataMax:function(){return this._store.setDataMax.apply(this._store,arguments),this},setDataMin:function(){return this._store.setDataMin.apply(this._store,arguments),this},configure:function(Q){return this._config=C.merge(this._config,Q),this._renderer.updateConfig(this._config),this._coordinator.emit("renderall",this._store._getInternalData()),this},repaint:function(){return this._coordinator.emit("renderall",this._store._getInternalData()),this},getData:function(){return this._store.getData()},getDataURL:function(){return this._renderer.getDataURL()},getValueAt:function(Q){return this._store.getValueAt?this._store.getValueAt(Q):this._renderer.getValueAt?this._renderer.getValueAt(Q):null}},w}(),x={create:function(v){return new y(v)},register:function(v,E){o.plugins[v]=E}};return x})});var p5e="WebSDK v3.2.4-12",m5e="Cesium v1.99",C5e="2023.12.1",H_t="SmartEarth",V_t={VERSION:p5e,CesiumVERSION:m5e,CompileTime:C5e},z_t=typeof window<"u"?window:typeof self<"u"?self:{};z_t.logSmartEarth=()=>{let o=`
%c${H_t}
%c
\u7248 \u672C \u53F7\uFF1A${p5e}    ${m5e}
@@ -16835,7 +16835,7 @@
gl_FragColor = mix(gl_FragColor, u_floodColor, 0.3);
}
}
`}Object.defineProperties(oAt.prototype,{parameter:{get:function(){return this._parameter}},show:{get:function(){return this._pps!==null},set:function(o){o?aLi(this):sLi(this)}},maxHeight:{get:function(){return this._maxHeight},set:function(o){this._maxHeight=o}},minHeight:{get:function(){return this._minHeight},set:function(o){this._minHeight=o}}});var zO=oAt;function xy(o,A){this._earthCtrl=o,this._coreMap=o.coreMap,this._minHeight=Ae(A.minHeight,0),this._maxHeight=Ae(A.maxHeight,0),this._extrudedHeight=Ae(A.extrudedHeight,0),this.shapeTool=void 0,this._speed=Ae(A.speed,1),this._baseWaterColor=Ae(A.baseWaterColor,new At(.2,.3,.6,.5)),this._waterFrequency=Ae(A.waterFrequency,1e3),this._animationSpeed=Ae(A.animationSpeed,.01),this._amplitude=Ae(A.amplitude,10),this._isPolygon=Ae(A.isPolygon,!0),this.eventHelper=new Mx,this._nowHeight=null,this._height=Ae(A.height,void 0),this._type=Ae(A.type,"up")}xy.prototype.drawPolygon=function(o){let A=this;this.shapeTool=A._earthCtrl.shapeTool.createDrawShapeTool(function(f){A.setPolygon({positions:f.result}),o&&o(A)})};xy.prototype.setPolygon=function(o){this.positions=o.positions;let A=this,f=A.computePolygonHeightRange(this.positions);A._minHeight=f.minHeight,A._maxHeight=f.maxHeight,A._extrudedHeight=A._minHeight};xy.prototype.computePolygonHeightRange=function(o){let A=[],f=this._earthCtrl.coreMap;for(let D=0;D<o.length;D++)A.push(o[D].clone());let m,C,y,x,v,E,I,w=0,Q=9999,M=Math.PI/Math.pow(2,11)/64,B=new rh.fromPositions({positions:A,vertexFormat:za.FLAT_VERTEX_FORMAT,granularity:M}),T=new rh.createGeometry(B);for(let D=0;D<T.indices.length;D+=3)m=T.indices[D],C=T.indices[D+1],y=T.indices[D+2],I=new ee(T.attributes.position.values[3*m],T.attributes.position.values[3*m+1],T.attributes.position.values[3*m+2]),(x=f.scene.globe.getHeight(Kt.fromCartesian(I)))<Q&&(Q=x),w<x&&(w=x),I=new ee(T.attributes.position.values[3*C],T.attributes.position.values[3*C+1],T.attributes.position.values[3*C+2]),(v=f.scene.globe.getHeight(Kt.fromCartesian(I)))<Q&&(Q=v),w<v&&(w=v),I=new ee(T.attributes.position.values[3*y],T.attributes.position.values[3*y+1],T.attributes.position.values[3*y+2]),(E=f.scene.globe.getHeight(Kt.fromCartesian(I)))<Q&&(Q=E),w<E&&(w=E);return{maxHeight:w,minHeight:Q}};xy.prototype.removeFromMap=function(){this._isPolygon?O(this.primitive)&&(this.removePrimitive(),this._extrudedHeight=this.minHeight,this.primitive=null):O(this.flood)&&(this.flood.show=!1),this.eventHelper&&this.eventHelper.removeAll(),this.shapeTool&&this.shapeTool.removeFromMap()};xy.prototype._onTick=function(){let o=this;o._type==="up"?o._extrudedHeight>=o._maxHeight?(o._extrudedHeight=o._maxHeight,o._nowHeight=o._extrudedHeight,o.eventHelper.removeAll()):(o._isPolygon?o.removePrimitive():O(o.flood)||(o.flood=new zO(o._earthCtrl,{minHeight:o.minHeight,maxHeight:o._extrudedHeight,positions:o.positions}),o.flood.show=!0),o._extrudedHeight+=o._speed,o._isPolygon?o.addPrimitive():o.flood.maxHeight=o._extrudedHeight):o._type==="down"&&(o._extrudedHeight<=o._minHeight?(o._extrudedHeight=o._minHeight,o._nowHeight=o._extrudedHeight,o.eventHelper.removeAll()):(o._isPolygon?o.removePrimitive():O(o.flood)||(o.flood=new zO(o._earthCtrl,{minHeight:o.minHeight,maxHeight:o._extrudedHeight,positions:o.positions}),o.flood.show=!0),o._extrudedHeight-=o._speed,o._isPolygon?o.addPrimitive():o.flood.maxHeight=o._extrudedHeight))};xy.prototype._onTickNext=function(){let o=this;o._nowHeight?o._type==="up"?o._extrudedHeight>=o._nowHeight+o._height?(o._extrudedHeight=o._nowHeight+o._height,o._nowHeight=o._extrudedHeight,o.eventHelper.removeAll()):(o._isPolygon?o.removePrimitive():O(o.flood)||(o.flood=new zO(o._earthCtrl,{minHeight:o.minHeight,maxHeight:o._extrudedHeight,positions:o.positions}),o.flood.show=!0),o._extrudedHeight+=o._speed,o._isPolygon?o.addPrimitive():o.flood.maxHeight=o._extrudedHeight):o._type==="down"&&(o._extrudedHeight<=o._nowHeight-o._height?(o._extrudedHeight=o._nowHeight-o._height,o._nowHeight=o._extrudedHeight,o.eventHelper.removeAll()):(o._isPolygon?o.removePrimitive():O(o.flood)||(o.flood=new zO(o._earthCtrl,{minHeight:o.minHeight,maxHeight:o._extrudedHeight,positions:o.positions}),o.flood.show=!0),o._extrudedHeight-=o._speed,o._isPolygon?o.addPrimitive():o.flood.maxHeight=o._extrudedHeight)):o._type==="up"?o._extrudedHeight>=o._minHeight+o._height?(o._extrudedHeight=o._minHeight+o._height,o._nowHeight=o._extrudedHeight,o.eventHelper.removeAll()):(o._isPolygon?o.removePrimitive():O(o.flood)||(o.flood=new zO(o._earthCtrl,{minHeight:o.minHeight,maxHeight:o._extrudedHeight,positions:o.positions}),o.flood.show=!0),o._extrudedHeight+=o._speed,o._isPolygon?o.addPrimitive():o.flood.maxHeight=o._extrudedHeight):o._type==="down"&&(o._extrudedHeight<=o._maxHeight-o._height?(o._extrudedHeight=o._maxHeight-o._height,o._nowHeight=o._extrudedHeight,o.eventHelper.removeAll()):(o._isPolygon?o.removePrimitive():O(o.flood)||(o.flood=new zO(o._earthCtrl,{minHeight:o.minHeight,maxHeight:o._extrudedHeight,positions:o.positions}),o.flood.show=!0),o._extrudedHeight-=o._speed,o._isPolygon?o.addPrimitive():o.flood.maxHeight=o._extrudedHeight))};xy.prototype.removePrimitive=function(){O(this.primitive)&&this._earthCtrl.primitives.remove(this.primitive)};xy.prototype.polygonAnalysis=function(){let o=this;O(o.shapeTool)&&(o.shapeTool.removeFromMap(),o.shapeTool=void 0),o._height?o.eventHelper.add(o._earthCtrl.coreMap.clock.onTick,xy.prototype._onTickNext,this):o.eventHelper.add(o._earthCtrl.coreMap.clock.onTick,xy.prototype._onTick,this);let A={};A.normalMap=`${globalThis.GEOWORLD_BASE_URL}Assets/Images/waterNormals.jpg`,A.baseWaterColor=o.baseWaterColor,A.frequency=o.waterFrequency,A.animationSpeed=o.animationSpeed,A.amplitude=o.amplitude;let f=new ss({fabric:{type:"Water",uniforms:A}});f.update(o._earthCtrl.coreMap.scene.context),o.primitiveAppearance=new DY({material:f,fragmentShaderSource:TY})};xy.prototype.postAnalysis=function(){let o=this;O(o.shapeTool)&&(o.shapeTool.removeFromMap(),o.shapeTool=void 0),o._height?o.eventHelper.add(o._earthCtrl.coreMap.clock.onTick,xy.prototype._onTickNext,this):o.eventHelper.add(o._earthCtrl.coreMap.clock.onTick,xy.prototype._onTick,this)};xy.prototype.addPrimitive=function(){let o=this;o.primitive=o._earthCtrl.primitives.add(new Za({geometryInstances:new co({geometry:rh.fromPositions({positions:o.positions,extrudedHeight:o._extrudedHeight})}),asynchronous:!1,appearance:o.primitiveAppearance}))};xy.prototype.startAnalysis=function(){let o=this;setTimeout(()=>{o._isPolygon?o.polygonAnalysis():o.postAnalysis()},100)};Object.defineProperties(xy.prototype,{isPolygon:{get:function(){return this._isPolygon}},minHeight:{set:function(o){this._minHeight=o},get:function(){return this._minHeight}},maxHeight:{set:function(o){this._maxHeight=o},get:function(){return this._maxHeight}},speed:{set:function(o){this._speed=o},get:function(){return this._speed}},baseWaterColor:{set:function(o){this._baseWaterColor=o},get:function(){return this._baseWaterColor}},waterFrequency:{set:function(o){this._waterFrequency=o},get:function(){return this._waterFrequency}},animationSpeed:{set:function(o){this._animationSpeed=o},get:function(){return this._animationSpeed}},amplitude:{set:function(o){this._amplitude=o},get:function(){return this._amplitude}},height:{set:function(o){this._height=o,this.postAnalysis()},get:function(){return this._height}},type:{set:function(o){this._type=o},get:function(){return this._type}}});var YTe=xy;function KO(o,A){this._earthCtrl=o,this._coreMap=o.coreMap,this.shapeTool=void 0,this.positions=void 0,this.echarts=void 0,this.mCallback=Ae(A.callback,void 0),this.defaultChart=Ae(A.defaultChart,!0),this.step=Ae(A.step,20),this.image=A.image,this.echarstView=A.echartsView,this.echartsParentView=A.echartsParentView,this.billboard=void 0,this.minHeight=0,this.maxHeight=0,this.profile={arrHB:[],arrPoint:[],arrLX:[],points:[],distance:0}}KO.prototype.drawPolyLine=function(){let o=this;this.shapeTool=o._earthCtrl.shapeTool.createDrawShapeTool(function(A){o.setPolyline({positions:A.result})},"polyline")};KO.prototype.setPolyline=function(o){this.positions=o.positions};KO.prototype.startAnalysis=function(){if(!this.positions)return console.info("\u8BF7\u5148\u7ED8\u5236\u5256\u9762\u7EBF\uFF01");if(this.positions.length>1){this.profile.arrLX.push(0);for(let A=0;A<this.positions.length-1;A++){let f=this.positions[A],m=this.positions[A+1];this.profile2PointAnalysis(f,m)}this.processHeight();let o=this.profile;this.defaultChart&&cLi(this,o),O(this.mCallback)&&this.mCallback(o),this.positions=void 0}};KO.prototype.processHeight=function(){let o=this;if(!(o.profile.arrHB.length<=0)){o.minHeight=o.maxHeight=o.profile.arrHB[0];for(let A=1;A<o.profile.arrHB.length;A++){let f=o.profile.arrHB[A];f>o.maxHeight?o.maxHeight=f:f<o.minHeight&&(o.minHeight=f)}o.minHeight=parseInt(o.minHeight/100)*100;for(let A=0;A<o.profile.arrHB.length;A++){let f=o.profile.arrHB[A];o.profile.arrHB[A]=f-o.minHeight}}};var uLi=new ee;KO.prototype.profile2PointAnalysis=function(o,A){let f=this,m=ee.distance(o,A),C=parseInt(m/f.step),y=Kt.fromCartesian(o),x=Kt.fromCartesian(A);f.positions.length>2&&f.profile.arrLX.length>1&&f.profile.arrLX.push(f.profile.arrLX[f.profile.arrLX.length-1]+WTe(f.profile.points[f.profile.points.length-1],y)),f.profile.points.push(y),f.profile.arrPoint.push(JTe(o)),f.profile.arrHB.push(y.height);let v=f.profile.arrLX.length-1;console.info(v);for(let E=1;E<C;E++){let I=ee.lerp(o,A,E/C,uLi),w=Kt.fromCartesian(I),Q=f._coreMap.scene.globe.getHeight(w);w.height=Q;let M=WTe(f.profile.points[v+E-1],w);f.profile.distance=f.profile.distance+M,f.profile.points.push(w),f.profile.arrLX.push(f.profile.arrLX[v+E-1]+M),f.profile.arrPoint.push(JTe(I)),f.profile.arrHB.push(Q)}return f.profile.points.push(x),f.profile.arrLX.push(f.profile.arrLX[f.profile.arrLX.length-1]+WTe(f.profile.points[f.profile.points.length-1],x)),f.profile.arrPoint.push(JTe(A)),f.profile.arrHB.push(x.height),f.profile};function uAt(o,A){let f=document.getElementById(o);f.style.display=A?"block":"none"}var aAt;function cLi(o,A){if(A!==null&&A.arrPoint!==null){uAt(o.echartsParentView,!0),O(o.echarts)||(o.echarts=kb.init(document.getElementById(o.echarstView),"dark"));let f=A.arrPoint,m={grid:{left:10,right:10,bottom:10,containLabel:!0},dataZoom:[{type:"inside",throttle:50}],tooltip:{trigger:"axis",formatter:function(C){let y="";if(C.length===0)return y;let x=f[C[0].dataIndex],v=C[0].value+o.minHeight;return aAt=new ee.fromDegrees(x.x,x.y,v),O(o.billboard)||(o.billboard=o._earthCtrl.entities.add({name:"profile_billboard",position:new Bn(function(){return aAt},!1),billboard:{verticalOrigin:bn.BOTTOM,image:o.image,iconWidth:8,iconHeight:8,scale:.5}})),o.billboard.show||(o.billboard.show=!0),y+=`\u6240\u5728\u4F4D\u7F6E&nbsp;${lAt(x.x)},${lAt(x.y)}<br />\u8DDD\u8D77\u70B9&nbsp;<label>${sAt(C[0].axisValue)}</label><br />${C[0].seriesName}&nbsp;<label style='color:${C[0].color};'>${sAt(v)}</label><br />`}},xAxis:[{name:"\u884C\u7A0B",type:"category",boundaryGap:!1,axisLine:{show:!1},axisLabel:{show:!1},data:A.arrLX}],yAxis:[{type:"value",axisLabel:{formatter:function(C){return`${C+o.minHeight}\u7C73`}}}],series:[{name:"\u9AD8\u7A0B\u503C",type:"line",smooth:!0,symbol:"none",sampling:"average",itemStyle:{normal:{color:"rgb(255, 70, 131)"}},areaStyle:{normal:{color:new kb.graphic.LinearGradient(0,0,0,1,[{offset:0,color:"rgb(255, 158, 68)"},{offset:1,color:"rgb(255, 70, 131)"}])}},data:A.arrHB}]};o.echarts.setOption(m)}}function sAt(o,A){if(o===null)return"";o=Number(o),(A===null||A==="auto")&&(o<1e3?A="m":A="km");let f="";switch(A){default:case"m":f=`${o.toFixed(2)}\u7C73`;break;case"km":f=`${(o*.001).toFixed(2)}\u516C\u91CC`;break;case"mile":f=`${(o*54e-5).toFixed(2)}\u6D77\u91CC`;break;case"zhang":f=`${(o*.3).toFixed(2)}\u4E08`;break}return f}function lAt(o){let A=o.toString();return A.slice(0,A.indexOf(".")+3)}function JTe(o){let A=Kt.fromCartesian(o),f=je.toDegrees(A.longitude),m=je.toDegrees(A.latitude),C=A.height;return{x:f,y:m,z:C}}function WTe(o,A){let f=new l0;f.setEndPoints(o,A);let m=f.surfaceDistance;return m=Math.sqrt(Math.pow(m,2)+Math.pow(A.height-o.height,2)),m}KO.prototype.removeFromMap=function(){let o=this;O(o.shapeTool)&&(o.shapeTool.removeFromMap(),o.shapeTool=void 0),O(o.billboard)&&(o._earthCtrl.entities.remove(o.billboard),o.billboard=void 0),uAt(o.echartsParentView,!1)};var jTe=KO;function Ise(o,A){this._earthCtrl=o,this._coreMap=o.coreMap,this._skylineColor=Ae(A.color,At.RED.withAlpha(1)),this._postProccessStage=null,this._postProcessStages=this._coreMap.scene.postProcessStages,this._width=Ae(A.width,1),this._edgeDetection=bv.createEdgeDetectionStage({width:this._width||1}),this.addToMap()}Ise.prototype.addToMap=function(){this.removeFromMap();let o=new va({name:"czm_skylinetemp",fragmentShader:"uniform sampler2D colorTexture;uniform sampler2D depthTexture;varying vec2 v_textureCoordinates;void main(void){float depth = czm_readDepth(depthTexture, v_textureCoordinates);vec4 color = texture2D(colorTexture, v_textureCoordinates);if(depth<1.0 - 0.000001){gl_FragColor = color;}else{gl_FragColor = vec4(1.0,0.0,0.0,1.0);}}"}),A=new va({name:"czm_skylinetemp1",fragmentShader:"uniform sampler2D colorTexture;uniform sampler2D redTexture;uniform sampler2D silhouetteTexture;uniform vec4 skylineColor;varying vec2 v_textureCoordinates;void main(void){vec4 redcolor=texture2D(redTexture, v_textureCoordinates);vec4 silhouetteColor = texture2D(silhouetteTexture, v_textureCoordinates);vec4 color = texture2D(colorTexture, v_textureCoordinates);if(redcolor.r == 1.0){gl_FragColor = mix(color, skylineColor, silhouetteColor.a);}else{gl_FragColor = color;}}",uniforms:{redTexture:o.name,silhouetteTexture:this._edgeDetection.name,skylineColor:this._skylineColor}});this._postProccessStage=new CC({name:"czm_skyline",stages:[this._edgeDetection,o,A],inputPreviousStageTexture:!1,uniforms:this._edgeDetection.uniforms}),this._postProcessStages.add(this._postProccessStage)};Ise.prototype.removeFromMap=function(){this._postProccessStage&&(this._earthCtrl.coreMap.scene.postProcessStages.remove(this._postProccessStage),this._postProccessStage=null)};Object.defineProperties(Ise.prototype,{});var qTe=Ise;function _se(o,A){this._earthCtrl=o,this._coreMap=o.coreMap,this.leftIndex=void 0,this.rightIndex=void 0,this.addToMap(A.leftIndex,A.rightIndex)}var YO={dragStartX:0,_scene:void 0};_se.prototype.addToMap=function(o,A){document.getElementById("slider")&&this.clear();let m=this._coreMap.imageryLayers,C=this._coreMap.scene;YO._scene=C;let y=this._coreMap.container,x=document.createElement("div");x.id="slider",x.style.position="absolute",x.style.cursor="e-resize",x.style.top=0,x.style.backgroundColor="#D3D3D3",x.style.width="8px",x.style.height="100%",x.style.zIndex="1000",y.appendChild(x);let v=m.get(o),E=m.get(A);this.leftIndex=o,this.rightIndex=A,v.splitDirection=uI.LEFT,E.splitDirection=uI.RIGHT;let I=document.getElementById("slider");C.splitPosition=I.offsetLeft/I.parentElement.offsetWidth,I.addEventListener("mousedown",AAt,!1),window.addEventListener("mouseup",cAt,!1),I.style.left="50%",YO._scene.splitPosition=.5};function cAt(){window.removeEventListener("mousemove",XTe,!1)}function AAt(o){let A=document.getElementById("slider");YO.dragStartX=o.clientX-A.offsetLeft,window.addEventListener("mousemove",XTe,!1)}function XTe(o){let A=document.getElementById("slider"),f=(o.clientX-YO.dragStartX)/A.parentElement.offsetWidth;A.style.left=`${100*f}%`,YO._scene.splitPosition=f}_se.prototype.removeFromMap=function(){let o=document.getElementById("slider");if(o){YO._scene.splitPosition="0%",o.removeEventListener("mousedown",AAt,!1),window.removeEventListener("mouseup",cAt,!1),window.removeEventListener("mousemove",XTe,!1),o.remove();let A=this._coreMap.imageryLayers,f=A.get(this.leftIndex),m=A.get(this.rightIndex);f.splitDirection=uI.NONE,m.splitDirection=uI.NONE,YO._scene=void 0}};Object.defineProperties(_se.prototype,{});var hAt=_se;function NW(o,A){this._earthCtrl=o,this._coreMap=o.coreMap,this.color=Ae(A.color,At.RED.withAlpha(.5)),this.positions=A.positions,this.baseHeight=Ae(A.baseHeight,0),this._height=Ae(A.height,0),this.extrudedHeight=Ae(A.extrudedHeight,1e4),this.limitHeightPrimitive=null,this.addToMap()}NW.prototype.addToMap=function(){if(this.removeFromMap(),!this.positions)return;let o=ee.fromDegreesArray(this.positions),A=new co({geometry:new rh({polygonHierarchy:new Un(o),height:this.baseHeight,extrudedHeight:this.baseHeight+this.extrudedHeight}),attributes:{color:Yo.fromColor(this.color)}});this.limitHeightPrimitive=this._coreMap.scene.primitives.add(new s6({geometryInstances:A,releaseGeometryInstances:!1,classificationType:Gu.CESIUM_3D_TILE}))};NW.prototype.changeHeight=function(o){!this.limitHeightPrimitive||(console.log("?!?!?!",this.limitHeightPrimitive),this.limitHeightPrimitive.readyPromise.then(A=>{let f=Kt.fromCartesian(this.limitHeightPrimitive._primitive._boundingSpheres[0].center);console.log("???",f);let m=ee.fromRadians(f.longitude,f.latitude,this.baseHeight),C=ee.fromRadians(f.longitude,f.latitude,this.baseHeight+o),y=ee.subtract(C,m,new ee);console.log("!!!!",this.limitHeightPrimitive._primitive.modelMatrix),this.limitHeightPrimitive._primitive.modelMatrix=Xe.setTranslation(Xe.IDENTITY,y,new Xe),this.baseHeight=this.baseHeight+o}))};NW.prototype.removeFromMap=function(){this.limitHeightPrimitive&&(this._coreMap.scene.primitives.remove(this.limitHeightPrimitive),this.limitHeightPrimitive=void 0)};Object.defineProperties(NW.prototype,{});var ZTe=NW;function dAt(o){this._earthCtrl=o}dAt.prototype.toDegrees=function(o){let A=Kt.fromCartesian(o);return{lon:je.toDegrees(A.longitude),lat:je.toDegrees(A.latitude),height:A.height}};var fAt=dAt;function JO(o){this._viewer=o.coreMap,this._trans=new fAt}JO.prototype.addClipping=function(o,A={}){if(this.remove(),A.type==="polygon"){let f=A.positions,m=[];f.forEach(v=>{m.push(this._trans.toDegrees(v))}),m.push(m[0]);let C;A.isInner?C=this.isClockWise(m):C=!this.isClockWise(m),C&&m.reverse();let y=[],x=this.getInverseTransform(o);for(let v=0;v<m.length-1;v++){let E=this.createPlane(m[v],m[v+1],x);y.push(E)}o.clippingPlanes=new rB({planes:y,unionClippingRegions:!A.isInner})}return this.item=o,this};JO.prototype.getInverseTransform=function(o){let A,f=o.root.transform;return f&&f.equals(Xe.IDENTITY)||!f?A=Vn.eastNorthUpToFixedFrame(o.boundingSphere.center):A=Xe.fromArray(o.root.transform),Xe.inverseTransformation(A,new Xe)};JO.prototype.getOriginCoordinateSystemPoint=function(o,A){let f=ee.fromDegrees(o.lon,o.lat);return Xe.multiplyByPoint(A,f,new ee(0,0,0))};JO.prototype.createPlane=function(o,A,f){let m=this.getOriginCoordinateSystemPoint(o,f),C=this.getOriginCoordinateSystemPoint(A,f),y=new ee(0,0,1),x=ee.subtract(C,m,new ee),v=ee.cross(x,y,new ee);v=ee.normalize(v,v);let E=Wa.fromPointNormal(m,v);return kM.fromPlane(E)};JO.prototype.isClockWise=function(o){if(o.length<3)return null;o[0]===o[o.length-1]&&(o=o.slice(0,o.length-1));let A={i:-1,val:90};for(let E=0;E<o.length;E++){let{lat:I}=o[E];I<A.val&&(A.val=I,A.i=E)}let f=(A.i+o.length-1)%o.length,m=A.i,C=(A.i+1)%o.length,y={lat:o[m].lat-o[f].lat,lon:o[m].lon-o[f].lon},x={lat:o[C].lat-o[m].lat,lon:o[C].lon-o[m].lon},v=x.lon*y.lat-y.lon*x.lat;return v===0?o[C].lon<o[f].lon:v>0};JO.prototype.remove=function(){this.item&&this.item.clippingPlanes&&this.item.clippingPlanes.removeAll(),this.item&&(this.item.clippingPlanes=void 0)};var $Te=JO;var eMe;function tMe(o,A){this._viewer=o.coreMap,eMe=o.coreMap,this.createTerrainModifier(A.name,A.polygon,A.altitude)}tMe.prototype.findDirectParent=function(o){try{let A=[];if(o.width===Math.PI)return null;for(let f=0;f<eMe.scene.globe._surface._tilesToRender.length;f++){let m=eMe.scene.globe._surface._tilesToRender[f],C=m._rectangle;Si.intersection(C,o)&&A.push(m)}return A}catch(A){console.log(A)}return null};tMe.prototype.createTerrainModifier=function(o,A,f){let m=A.length,C=new Array(m);C.fill(f);let y=Vu(),x=Date.now(),v=Si.fromCartesianArray(A),E=this.findDirectParent(v);this._viewer.terrainProvider&&this._viewer.terrainProvider._modifyTerrainObjects===void 0&&(this._viewer.terrainProvider._modifyTerrainObjects=[]);let I=this._viewer,w={id:y,name:o,show:!0,rectangle:v,vertices:A,heights:C,timeStamp:x,remove:function(){if(I.terrainProvider&&I.terrainProvider._modifyTerrainObjects)for(let Q=I.terrainProvider._modifyTerrainObjects.length-1;Q>=0;Q--)I.terrainProvider._modifyTerrainObjects[Q].id===y&&I.terrainProvider._modifyTerrainObjects.splice(Q,1);if(E)try{for(let Q=0;Q<E.length;Q++)try{E[Q]._parent.freeResources()}catch(M){console.log(M)}}catch(Q){console.log(Q)}}};if(this._viewer.terrainProvider._modifyTerrainObjects.push(w),E)try{for(let Q=0;Q<E.length;Q++)try{E[Q]._parent.freeResources()}catch(M){console.log(M)}}catch(Q){console.log(Q)}return w};var iMe=tMe;var KH;function rMe(o){this._earthCtrl=o,this.Viewer=o.coreMap,KH=o.coreMap}rMe.prototype.CreateTooltip=function(o={},A,f){let m,C,y,x,v;typeof o=="object"&&(m=o),m&&m.origin?(m.origin==="center"&&(C=15,y=-12),m.origin==="top"&&(C=15,y=-44),m.origin==="bottom"&&(C=15,y=20)):(C=15,y=20),m&&m.color?(m.color==="white"&&(x="background: rgba(255, 255, 255, 0.8);color: black;"),m.color==="black"&&(x="background: rgba(0, 0, 0, 0.5);color: white;"),m.color==="yellow"&&(x="color: black;background-color: #ffcc33;border: 1px solid white;")):x="background: rgba(0, 0, 0, 0.5);color: white;",m&&m.id?v=`toolTip${m.id}`:v="toolTip";let E=document.getElementById(v);if(!E){let I=document.createElement("div");nA(".map-widget",I);let w=`<div id="${v}" style="display: none;pointer-events: none;position: absolute;z-index: 1000;opacity: 0.8;border-radius: 4px;padding: 4px 8px;white-space: nowrap;font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px;${x}"></div>`;nA(".map-widget",w),E=document.getElementById(v)}return f?(E.innerHTML=o,E.style.left=`${A.x+C}px`,E.style.top=`${A.y+y}px`,E.style.display="block"):E.style.display="none",{tooltip:E,style:m,showAt:function(I,w){this.tooltip.innerHTML=w,this.style&&this.style.origin?(this.style.origin==="center"&&(C=15,y=-this.tooltip.offsetHeight/2),this.style.origin==="top"&&(C=15,y=-this.tooltip.offsetHeight-20),this.style.origin==="bottom"&&(C=15,y=20)):(C=15,y=-this.tooltip.offsetHeight/2),this.tooltip.style.left=`${I.x+C}px`,this.tooltip.style.top=`${I.y+y}px`,this.tooltip.style.display="block"},show:function(I){I?this.tooltip.style.display="block":this.tooltip.style.display="none"}}};rMe.prototype.CreateResultTooltip=function(o={}){let A,f,m,C=o.id?`resultToolTip${o.id}`:"resultToolTip",y=document.getElementById(C);if(o.color?(o.color==="white"&&(m="background: rgba(255, 255, 255, 0.8);color: black;"),o.color==="black"&&(m="background: rgba(0, 0, 0, 0.5);color: white;"),o.color==="blue"&&(m="background: rgba(48, 119, 221);color: white;"),o.color==="yellow"&&(m="color: black;background-color: #ffcc33;border: 1px solid white;")):m="color: black;background-color: #ffcc33;border: 1px solid white;",!y){let Q=`<div id="${C}" class="resultToolTip" style="display: none;pointer-events: none;position: absolute;z-index: 1000;opacity: 0.8;border-radius: 4px;padding: 4px 8px;white-space: nowrap;font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px;${m}"></div>`;nA(".map-widget",Q),y=document.getElementById(C)}let x=o.addX||0,v=o.addY||0,E,I=this;function w(){if(E){if(o.far!==void 0||o.near!==void 0){let M=I.getPointToCameraDistance(KH,E);if(M>o.far){y.style.display="none";return}else if(M<o.near){y.style.display="none";return}y.style.display="block"}let Q=KH.scene.cartesianToCanvasCoordinates(E);if(!Q)return;A=-y.offsetWidth/2+x,f=-y.offsetHeight+v,y.style.left=`${Q.x+A}px`,y.style.top=`${Q.y+f}px`}}return KH.clock.onTick.addEventListener(w),{tooltip:y,position:E,showAt:function(Q,M){if(this.tooltip.innerHTML=M,this.tooltip.style.display="block",this.position=Q,E=Q,E){let B=KH.scene.cartesianToCanvasCoordinates(E);if(!B)return;A=-this.tooltip.offsetWidth/2+x,f=-this.tooltip.offsetHeight+v,this.tooltip.style.left=`${B.x+A}px`,this.tooltip.style.top=`${B.y+f}px`}},show:function(Q){Q?(this.tooltip.style.display="block",E=this.position):(this.tooltip.style.display="none",E=void 0)},destroy(){KH.clock.onTick.removeEventListener(w),y.remove()}}};var pw=rMe;var nMe=class{constructor(){this.minHeight=Number.MAX_VALUE,this.maxHeight=Number.MIN_VALUE,this.cutVolume=0,this.fillVolume=0,this.baseArea=0}},oMe=class{constructor(){this.minHeight=Number.MAX_VALUE,this.maxHeight=Number.MIN_VALUE,this.avgHeight=0,this.baseArea=0}};function Bse(o,A){this._earthCtrl=o,this._viewer=o.coreMap,this.baseHeight=Ae(A.baseHeight,0),this.options=A}Bse.prototype.start=function(){let o=this.options.positions,A=this.options.countBase,f=this.options.basePositions,m=this.options.baseHeight,C=new nMe,y=[];o.forEach(Q=>{let M=Kt.fromCartesian(Q);this.baseHeight=Math.min(M.height,Ae(m,this.baseHeight)),y.push(Ss.wgs84ToWindowCoordinates(this._viewer.scene,Q))});let x=ALi(y),v=Zl.randomPoint(100,{bbox:[x[0],x[1],x[2],x[3]]}),E=hLi(y);Zl.voronoi(v,{bbox:[x[0],x[1],x[2],x[3]]}).features.forEach(Q=>{let M=dLi(E,Q.geometry);if(M.length>0){let B=this.computeCubeInfo(M);this.baseHeight>B.avgHeight?C.fillVolume+=(this.baseHeight-B.avgHeight)*C.baseArea:C.cutVolume+=(B.avgHeight-this.baseHeight)*C.baseArea,C.maxHeight=Math.max(C.maxHeight,B.maxHeight),C.minHeight=Math.min(C.minHeight,B.minHeight),C.baseArea+=B.baseArea}});let w=this.countBaseVolume(A,f,m);return w!==0&&(C.cutVolume+=w,C.fillVolume+=w),C};Bse.prototype.countBaseVolume=function(o,A,f){let m=this;if(o){let C=[],y=[];for(let Q=0;Q<A.length;Q=Q+3){y.push(A[Q+2]);let M=ee.fromDegrees(A[Q],A[Q+1],f),B=Kt.fromCartesian(M);C.push(B)}C.push(C[0]);let x=gAt(C);y.sort(function(Q,M){return Q-M});let v=y[0],E=y[y.length-1];return Number(E-v)*x/2}return 0};Bse.prototype.computeCubeInfo=function(o){let A=this,f=[],m=Number.MAX_VALUE,C=Number.MIN_VALUE,y=0;o.forEach(function(E){let I=A._earthCtrl.coreMap.scene.camera.getPickRay(E),w=A._earthCtrl.coreMap.scene.globe.pick(I,A._earthCtrl.coreMap.scene),Q=Kt.fromCartesian(w);f.push(Q),m=Math.min(m,Q.height),C=Math.max(C,Q.height),y+=Q.height});let x=y/o.length,v=new oMe;return v.minHeight=m,v.maxHeight=C,v.avgHeight=x,v.baseArea=gAt(f),v};function gAt(o){let A=[0],f=[0],m=new l0,C=Math.PI/180;for(let x=0;x<o.length-1;x++){let v=o[x],E=o[x+1];m.setEndPoints(v,E);let I=Math.sqrt(Math.pow(m.surfaceDistance,2)),w=E.latitude*C,Q=E.longitude*C,M=v.latitude*C,B=v.longitude*C,T=-Math.atan2(Math.sin(Q-B)*Math.cos(M),Math.cos(w)*Math.sin(M)-Math.sin(w)*Math.cos(M)*Math.cos(Q-B));T<0&&(T+=Math.PI*2),f.push(Math.sin(T)*I+f[x]),A.push(Math.cos(T)*I+A[x])}let y=0;for(let x=0;x<A.length-1;x++)y+=A[x]*f[x+1]-A[x+1]*f[x];return Math.abs(y+A[A.length-1]*f[0]-A[0]*f[f.length-1])/2}function ALi(o){let A=[],f=Number.MAX_VALUE,m=Number.MIN_VALUE,C=Number.MAX_VALUE,y=Number.MIN_VALUE;return o.forEach(x=>{f=Math.min(f,x.x),m=Math.max(m,x.x),C=Math.min(C,x.y),y=Math.max(y,x.y)}),A.push(f),A.push(C),A.push(m),A.push(y),A}function hLi(o){let A=[[]];return o.forEach(m=>{A[0].push([m.x,m.y])}),A[0].push([o[0].x,o[0].y]),Zl.polygon(A).geometry}function dLi(o,A){let f=Zl.intersect(o,A);return f?.geometry!==void 0?fLi(f?.geometry):[]}function fLi(o){let A=[];return o.coordinates.forEach(function(f){f.forEach(function(m){A.push(new It(m[0],m[1]))})}),A.push(new It(o.coordinates[0][0][0],o.coordinates[0][0][1])),A}var wse=Bse;function Gx(o,A){this._earthCtrl=o,this._viewer=o.coreMap,this._cesium=_r,this._scene=o.coreMap.scene,this._Tooltip=new pw(o),this.loadingImg=`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`,this.tooltip=this._Tooltip.CreateTooltip(),this.FlattenIsDraw=!1,this.wallArr=[],this.hierarchy=[],this.tophierarchy=[],this.heightsort=[],this.FlattenPolygon=[],this.deepth=100,this.polygon=null,this.editPoint=[],this.nowPoint=null,this.editPosition=[],this.topPositions=null,this._volumeLabel=void 0,this._volumeLabel1=void 0,this._option=Ae(A.option,{}),this._irregularCut=Ae(A.irregularCut,!1),this.terrainFlatten=new _N(o.coreMap.scene),this.CreatePolygon(A.height,A.option,A.callback)}Gx.prototype.CreatePolygon=function(o,A,f){if(this.FlattenIsDraw)return;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=null),this.removeLabel(),this.addLoading(),this.FlattenIsDraw=!0;let m=this._viewer,C=this._cesium;this.deepth=o||this.deepth,this.removeFromMap(),!A&&(A={});let y=[],x=this.hierarchy,v=this.polygon,E,I=null,w=0,Q=this.heightsort,M=this.deepth,B=this.wallArr,T=this;this.drawHandler=new C.ScreenSpaceEventHandler(m.scene.canvas),m.scene.globe.depthTestAgainstTerrain=!0;let D=this.tooltip,F;this._viewer.container.style.cursor=`url(${window.SmartEarthRootUrl} 'Workers/image/cursor/draw.cur')`,this.drawHandler.setInputAction(function(V){E=R(V.position);let H=C.Cartographic.fromCartesian(E),q=C.Math.toDegrees(H.longitude),ie=C.Math.toDegrees(H.latitude),Z=H.height;y.push(E),x.push(q,ie,H.height),T.tophierarchy.push(q,ie,Z),w===0?(y.push(E),x.push(q,ie,H.height),F=m.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new C.CallbackProperty(()=>y,!1),clampToGround:!0,material:new C.ColorMaterialProperty(C.Color.YELLOW.withAlpha(.3)),width:3}})):w===1&&(F&&m.entities.remove(F),v=m.entities.add({name:null,id:T._earthCtrl.factory.createUUID(),polygon:{hierarchy:new C.PolygonHierarchy(C.Cartesian3.fromDegreesArrayHeights(x)),material:C.Color.YELLOW.withAlpha(.3)}}),v.polygon.hierarchy=new C.CallbackProperty(L,!1)),w++},C.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(function(V){if(w===0){D.showAt(V.endPosition,"\u5DE6\u952E\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u70B9");return}else w===1?D.showAt(V.endPosition,"\u70B9\u51FB\u6DFB\u52A0\u7B2C\u4E8C\u4E2A\u70B9"):D.showAt(V.endPosition,"\u53F3\u952E\u7ED3\u675F\u7ED8\u5236");E=R(V.endPosition);let H=C.Cartographic.fromCartesian(E),q=C.Math.toDegrees(H.longitude),ie=C.Math.toDegrees(H.latitude);x.splice(x.length-3,3),y.splice(y.length-1,1),y.push(E),x.push(q,ie,H.height)},C.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(function(V){this.end&&this.end()}.bind(this),C.ScreenSpaceEventType.RIGHT_CLICK),this.end=V=>{if(D.show(!1),T._viewer.container.style.cursor="default",T.drawHandler.destroy(),F&&m.entities.remove(F),v&&m.entities.remove(v),this.FlattenIsDraw=!1,this.end=void 0,V==="cancel"||y.length<3)return;if(w<2){w=0;return}w=0;for(let se=2;se<x.length;se=se+3)Q.push(x[se]);Q.sort(function(se,ce){return se-ce}),v=m.entities.add({name:null,id:T._earthCtrl.factory.createUUID(),polygon:{hierarchy:new C.CallbackProperty(function(){return new C.PolygonHierarchy(C.Cartesian3.fromDegreesArrayHeights(x))},!1),material:new C.ImageMaterialProperty({image:C.defaultValue(A.bottomImgUrl,`${window.SmartEarthRootUrl}Workers/image/bottomplane.jpg`),repeat:new C.Cartesian2(1,1)})}}),y.push(y[0]);let H,q,ie,Z,oe,ne;for(let se=0;se<y.length-1;se++){H=C.Cartographic.fromCartesian(y[se]),q=C.Cartographic.fromCartesian(y[se+1]),ie=C.Math.toDegrees(H.longitude),oe=C.Math.toDegrees(H.latitude),Z=C.Math.toDegrees(q.longitude),ne=C.Math.toDegrees(q.latitude),I?I=I>q.height?q.height:I:I=H.height>q.height?q.height:H.height;let ce=T.getPoint(ie,oe,Z,ne,H.height,q.height),j=[],de=[];T.getHeightsFromLonLat(ce.positions,function(me){if(me){j=me;for(let _e=0;_e<j.length;_e++)de.push(T.heightsort[0]-T.deepth);T.drawwall(ce.wallJwd,j,de)}})}v.polygon.height=Q[0]-M,this.FlattenPolygon.push(v),this.originHeight=Q[0],k(y),this.topPositions=y,typeof f=="function"&&f(y)};function L(){return new C.PolygonHierarchy(C.Cartesian3.fromDegreesArrayHeights(x))}function R(V){let H;if(m.scene.terrainProvider.constructor.name==="EllipsoidTerrainProvider")H=m.camera.pickEllipsoid(V,m.scene.globe.ellipsoid);else{let ie=m.scene.camera.getPickRay(V);H=m.scene.globe.pick(ie,m.scene)}if(m.scene.pick(V)){let ie=m.scene.pickPosition(V);if(ie){H=ie;let Z=C.Cartographic.fromCartesian(H),oe=m.scene.globe.getHeight(Z);Z.height=oe,H=C.Cartographic.toCartesian(Z)}}return H}function k(V){let H=m.scene.globe,q=V.concat();q.splice(q.length-1,1);for(let Z=0;Z<q.length-1;Z++)q[Z].x===q[Z+1].x&&q[Z].y===q[Z+1].y&&(q.splice(Z,1),Z--);let ie=q.length;if(U(q)&&q.reverse(),T.irregularCut){T.terrainFlatten.clearPolygon();let Z=[],oe=m.scene.globe.ellipsoid;for(let ne=0;ne<q.length;ne++){let se=oe.cartesianToCartographic(q[ne]),ce=C.Math.toDegrees(se.longitude),j=C.Math.toDegrees(se.latitude),de=se.height;Z.push(ce,j,de)}T.terrainFlatten.addPolygon(Z),T.terrainFlatten.update(),T.terrainFlatten.clipPlaneOfFlatten=!0}else{let Z=[];for(let oe=0;oe<ie;++oe){let ne=(oe+1)%ie,se=C.Cartesian3.add(q[oe],q[ne],new C.Cartesian3);se=C.Cartesian3.multiplyByScalar(se,.5,se);let ce=C.Cartesian3.normalize(se,new C.Cartesian3),j=C.Cartesian3.subtract(q[ne],se,new C.Cartesian3);j=C.Cartesian3.normalize(j,j);let de=C.Cartesian3.cross(j,ce,new C.Cartesian3);de=C.Cartesian3.normalize(de,de);let me=new C.Plane(de,0),_e=C.Plane.getPointDistance(me,se);Z.push(new C.ClippingPlane(de,_e))}H.clippingPlanes=new C.ClippingPlaneCollection({planes:Z})}}function U(V){if(V.length>=3)return!((V[1].x-V[0].x)*(V[2].y-V[1].y)-(V[1].y-V[0].y)*(V[2].x-V[1].x)>0)}return this};Gx.prototype.getPoint=function(o,A,f,m,C,y){let x=this,v=160,E=je.lerp(o,f,1/v)-o,I=je.lerp(A,m,1/v)-A,w=[],Q=[],M=[],B;w.push(o,A),B=ee.fromDegrees(o,A),Q.push(Kt.fromCartesian(B));for(let T=0;T<v;T++){let D=o+(T+1)*E,F=A+(T+1)*I;w.push(D,F),B=ee.fromDegrees(D,F),Q.push(Kt.fromCartesian(B))}return w.push(f,m),B=ee.fromDegrees(f,m),Q.push(Kt.fromCartesian(B)),{wallJwd:w,positions:Q}};Gx.prototype.getHeightsFromLonLat=function(o,A){let f=this._viewer,m=f.camera,C=[];if(this.isHaveTerrain(f))if(O(f.terrainProvider.availability)){let y=EQ(f.terrainProvider,o);Promise.resolve(y).then(function(x){x.forEach(function(v){C.push(v.height)}),typeof A=="function"&&A(C)})}else o.forEach(function(y){let x=f.scene.globe.getHeight(y);C.push(x)}),typeof A=="function"&&A(C);else o.forEach(function(y){C.push(f.scene.globe.getHeight(y))}),typeof A=="function"&&A(C)};Gx.prototype.isHaveTerrain=function(){return!!(this._viewer.scene&&this._viewer.scene.terrainProvider&&this._viewer.scene.terrainProvider._layers)};Gx.prototype.drawwall=function(o,A,f){let m=this,C=m._viewer.entities.add({wall:{positions:new Bn(function(){return ee.fromDegreesArray(o)},!1),maximumHeights:A,minimumHeights:f}}),y=C.wall;y.material=new V0({image:Ae(m._option.wallImgUrl,`${window.SmartEarthRootUrl}Workers/image/dzmc.jpg`),repeat:new It(1,1)}),m.wallArr.push(C)};Gx.prototype.setDeepth=function(o){this.FlattenPolygon[0]&&this.FlattenPolygon[0].polygon.height.setValue(this.originHeight-o),this.wallArr.forEach(A=>{let f=A.wall.minimumHeights.getValue();f=Array(f.length),f.fill(this.originHeight-o),A.wall.minimumHeights.setValue(f)})};Gx.prototype.edit=function(o){let A=this,f=A.editPoint,m=A.nowPoint;if(A._earthCtrl.coreMap.scene.globe.depthTestAgainstTerrain=!1,m){for(let x of A.editPoint)x&&(x.show=!0);A.update(m,f,o);return}for(let x=2;x<A.hierarchy.length;x=x+3)A.hierarchy[x]=A.originHeight-A.deepth;A.FlattenPolygon[0]&&A._viewer.entities.remove(A.FlattenPolygon[0]),A.FlattenPolygon=[];let C=this._viewer.entities.add({name:null,id:A._earthCtrl.factory.createUUID(),polygon:{hierarchy:new Un(ee.fromDegreesArrayHeights(A.hierarchy)),material:new V0({image:Ae(A._option.bottomImgUrl,`${window.SmartEarthRootUrl}Workers/image/bottomplane.jpg`),repeat:new It(1,1)}),perPositionHeight:!0}});A.FlattenPolygon.push(C);let y=A.FlattenPolygon[0].polygon.hierarchy.getValue();for(let x of y.positions){let v=this._viewer.entities.add({id:A._earthCtrl.factory.createUUID(),position:x,point:{color:At.WHITE,pixelSize:12,outlineColor:At.BLACK,outlineWidth:1}});f.push(v)}A._earthCtrl.measure.pickObject(null,function(x){let v=x.pickedObject.id;for(let E of f)if(v.id===E.id){A.nowPoint=E,A.update(E,f,o);return}})};Gx.prototype.endEdit=function(){let o=this;if(o._earthCtrl.coreMap.scene.globe.depthTestAgainstTerrain=!0,o.editPoint.length>0)for(let A of o.editPoint)A&&(A.show=!1)};Gx.prototype.excavationAndFill=function(){this.removeLabel();let o=this;this.endEdit(),o.topPositions&&(this.isLoading(!0),setTimeout(()=>{let A=null,f=null,m=!1;if(o.editPosition.length>0){let v=[];f=[];for(let E=0;E<o.editPosition.length-1;E++){let I=Kt.fromCartesian(o.editPosition[E]),w=je.toDegrees(I.longitude),Q=je.toDegrees(I.latitude),M=I.height;v.push(M),f.push(w,Q,M)}v.sort(function(E,I){return I-E}),A=v[0],m=!0}else A=o.heightsort[0]-o.deepth;let y=new wse(o._earthCtrl,{positions:o.topPositions,baseHeight:A,basePositions:f,countBase:m}).start(),x=o.computeCentroidOfPolygon(o.topPositions);this._volumeLabel=this._viewer.entities.add({position:ee.fromRadians(x.longitude,x.latitude,o.heightsort[o.heightsort.length-1]),label:{text:`\u6316\u65B9\u4F53\u79EF\uFF1A${y.cutVolume}\u7ACB\u65B9\u7C73`,pixelOffset:{x:0,y:-30},font:"16px \u5B8B\u4F53",fillColor:At.GOLD,verticalOrigin:bn.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),this._volumeLabel1=this._viewer.entities.add({position:ee.fromRadians(x.longitude,x.latitude,o.heightsort[o.heightsort.length-1]),label:{text:`\u586B\u65B9\u4F53\u79EF\uFF1A${y.fillVolume}\u7ACB\u65B9\u7C73`,pixelOffset:{x:0,y:-70},font:"16px \u5B8B\u4F53",fillColor:At.GOLD,verticalOrigin:bn.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),this.isLoading(!1),console.log(y.result)},100))};Gx.prototype.computeCentroidOfPolygon=function(o){let A=[],f=[],m=0,C=0;for(let v=0;v<o.length;v++){let E=Kt.fromCartesian(o[v]);m+=E.longitude,C+=E.latitude,A.push(E.longitude),f.push(E.latitude)}let y=0,x=0;return y=m/o.length,x=C/o.length,new Kt(y,x)};Gx.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=this.loadingImg,o.appendChild(A),this.loading=o,this._viewer.container.appendChild(o)};Gx.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};Gx.prototype.update=function(o,A,f){let m=this,C=o.position.getValue(),x=m._scene.globe.ellipsoid.cartesianToCartographic(C),v=je.toDegrees(x.longitude),E=je.toDegrees(x.latitude),I=x.height;o.position.setValue(ee.fromDegrees(v,E,I+f)),m.editPoint=A,m.editPosition=[];let w=[];for(let M of A){let B=M.position.getValue();w.push(B),m.editPosition.push(B)}m.FlattenPolygon[0].polygon.hierarchy=new Bn(function(){return new Un(w)},!0);let Q=m.editPosition;Q.push(Q[0]);for(let M=0;M<Q.length-1;M++){let T=[];for(let D=0;D<=160;D++){let F=ee.lerp(Q[M],Q[M+1],D/160,new ee),L=Kt.fromCartesian(F);T.push(L.height)}m.wallArr[M].wall.minimumHeights.setValue(T)}};Gx.prototype.removeFromMap=function(){this.endEdit(),this._earthCtrl.tools.clearTool(),this.editPoint=[],this.nowPoint=null;let o=this._viewer;if(this.wallArr.length>0){for(let A=0;A<this.wallArr.length;A++)o.entities.remove(this.wallArr[A]);this.wallArr=[]}o.scene.globe.clippingPlanes&&o.scene.globe.clippingPlanes.removeAll(),this.FlattenPolygon&&this.FlattenPolygon.length>0&&(this.FlattenPolygon.forEach(function(A){o.entities.remove(A)}),this.FlattenPolygon=[]),this.FlattenIsDraw=!1,this.removeLabel(),this.terrainFlatten&&this.terrainFlatten.clearPolygon()};Gx.prototype.removeLabel=function(){this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0)};var aMe=Gx;function _C(o,A={}){this._earthCtrl=o,this._viewer=o.coreMap,this._scene=o.coreMap.scene,this.options=Ae(A,{}),this._Tooltip=new pw(o),this._tooltip=this._Tooltip.CreateTooltip(),this._drawColor={point:Ae(this.options.drawColor?.point,At.BLUE),polyline:Ae(this.options.drawColor?.polyline,At.YELLOW),polygon:Ae(this.options.drawColor?.point,At.YELLOW.withAlpha(.5))},this.selectDatum=!0,this.onlyTerrain=!0,this.tin=!1,this._volumeTin=[],this.loadingImg=`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`,this.unit=Ae(A.unit,"km\xB3")}_C.prototype.removeFromMap=function(){this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._prevEntity1!==void 0&&(this._viewer.entities.remove(this._prevEntity1),this._prevEntity1=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._volumeTin.forEach(o=>{this._viewer.entities.remove(o)}),this._volumeTin=[],this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=void 0),this.Triangulation=[],this.tinData=void 0,this._tooltip.show(!1)};_C.prototype.deleteObject=_C.prototype.removeFromMap;_C.prototype.startDrawing=function(o={},A="auto",f){let m=this._scene,C=this._tooltip,y=3,x=[],v=[],E=[],I;this._positions=v,this._degreesArr=E,this._drawColor.point=o.point||this._drawColor.point,this._drawColor.polyline=o.polyline||this._drawColor.polyline,this._drawColor.polygon=o.polygon||this._drawColor.polygon,this.loadingImg=o.loading||this.loadingImg,this.tin=Ae(o.tin,!0),this.onlyTerrain=Ae(o.onlyTerrain,!1),this.selectDatum=Ae(o.selectDatum,!0);let w=this;this._mouseHandler&&this._mouseHandler.destroy(),this.loading||this.addLoading();let Q=new Ur(m.canvas);this._mouseHandler=Q,this.removeFromMap(),this._viewer.container.style.cursor=`url(${globalThis.GEOWORLD_BASE_URL} 'Workers/image/cursor/draw.cur')`;let M;Q.setInputAction(function(T){if(T.position!==null){let D=m.camera.getPickRay(T.position),F=m.globe.pick(D,m);if(this._viewer.scene.pick(T.position)){let R=this._viewer.scene.pickPosition(T.position);R&&(F=R)}if(F){let R=Kt.fromCartesian(F),k=je.toDegrees(R.longitude),U=je.toDegrees(R.latitude);if(x.length===0&&(x.push(k,U),E.push([k,U]),v.push(F),I=F),v.length>=4){let V=Ss.wgs84ToWindowCoordinates(this._viewer.scene,I);if(V!==void 0){let H=V.x-T.position.x,q=V.y-T.position.y;if(H*H+q*q<16){x.splice(x.length-2,2),v.pop(),this.stopDrawing(f);return}}}x.push(k,U),E.push([k,U]),v.push(F),v.length===2&&!M&&(M=this._viewer.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new Bn(function(){return v},!1),clampToGround:!0,material:w._drawColor.polygon,width:3}})),v.length===y&&(M&&this._viewer.entities.remove(M),this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:new Un(ee.fromDegreesArray(x)),material:w._drawColor.polygon,fill:!0}}),this._prevEntity.polygon.hierarchy=new Bn(B,!1))}}}.bind(this),Ki.LEFT_CLICK),Q.setInputAction(function(T){let D=T.endPosition;if(D!==null)if(v.length===0)C.showAt(D,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7B2C\u4E00\u4E2A\u70B9");else{let F=m.camera.getPickRay(D),L=m.globe.pick(F,m),R=this._viewer.scene.pick(D),k=!1;if(R){let U=this._viewer.scene.pickPosition(D);U&&(L=U),k=!0}if(L){let U=Kt.fromCartesian(L),V=je.toDegrees(U.longitude),H=je.toDegrees(U.latitude);if(x.splice(x.length-2,2),E.pop(),v.pop(),x.push(V,H),E.push([V,H]),v.push(L),C.showAt(D,"\u53F3\u952E\u7ED3\u675F\u7ED8\u5236"),v.length>=3&&v.length>=4){let q=Ss.wgs84ToWindowCoordinates(this._viewer.scene,I);if(q!==void 0){let ie=q.x-D.x,Z=q.y-D.y;ie*ie+Z*Z<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}}.bind(this),Ki.MOUSE_MOVE),Q.setInputAction(function(T){this.end&&this.end()}.bind(this),Ki.RIGHT_CLICK);function B(){return new Un(ee.fromDegreesArray(x))}return this.end=T=>{if(this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),w._viewer.container.style.cursor="default",this._tooltip.show(!1),M&&this._viewer.entities.remove(M),this.end=void 0,!(v.length<y)){if(this._prevEntity&&(this._prevEntity.polygon.hierarchy=ee.fromDegreesArray(x)),T==="cancel"){this._prevEntity&&this._viewer.entities.remove(this._prevEntity);return}this.stopDrawing(A,f)}},this};_C.prototype.stopDrawing=function(o,A){this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._volumeTin.forEach(f=>{this._viewer.entities.remove(f)}),this._volumeTin=[],this.isLoading(!0),setTimeout(()=>{let f=this.computeCutVolume(o,this.onlyTerrain),m=C=>{let y=C.maxHeight,x=C.minHeight;this._prevEntity.polygon.height=C.minHeight,this._prevEntity.polygon.heightReference=0;let v={id:this._earthCtrl.factory.createUUID(),polygon:{hierarchy:{positions:this._positions},height:x,extrudedHeight:y,closeTop:!1,closeBottom:!1,material:At.CYAN.withAlpha(.2),outline:!0,outlineColor:At.RED,outlineWidth:2}};if(this._prevEntity1=this._viewer.entities.add(v),typeof A=="function"&&A(C),this.selectDatum){let E=()=>{this.addPoint(I=>{this.setDatum(I,w=>{typeof A=="function"&&A({...C,...w}),E()})})};E()}};this.onlyTerrain?f.then(C=>{m(C)}):m(f)},100)};_C.prototype.computeCentroidOfPolygon=function(o){let A=[],f=[],m=0,C=0;for(let v=0;v<o.length;v++){let E=Kt.fromCartesian(o[v]);m+=E.longitude,C+=E.latitude,A.push(E.longitude),f.push(E.latitude)}let y=0,x=0;return y=m/o.length,x=C/o.length,new Kt(y,x)};_C.prototype.computeCutVolume=function(o,A){let f=this,m=15e3,C=-15e3;if(o==="auto"){let E=wi.fromPoints(this._positions);console.log("BoundingSphere.radius",E.radius),o=E.radius/20}let y=this.getPointsInPolygon(this._degreesArr,o,!0),x=Zl.polygon([this._degreesArr]),v=()=>{let{tin:E}=this.tinFromPoints(y,{getArea:!0,polygon:x});this.tinData=E;let I={fill:0,dig:0},w,Q,M,B,T;this.Triangulation=[],E.features.forEach(L=>{if(L.positions){if(this.tin){let k=this._viewer.entities.add({polygon:{hierarchy:new Un(L.positions),material:this._drawColor.polygon,perPositionHeight:!0,outline:!0,outlineColor:At.YELLOW}});this._volumeTin.push(k)}let R=L.geometry.coordinates[0];w=R[0][2],Q=R[1][2],M=R[2][2],T=L.area,this.Triangulation.push({bottomArea:T,height:[w,Q,M]}),B=(w-m+Q-m+M-m)/3,B>0?I.dig=I.dig+T*B:I.fill=I.fill-T*B}});let D=this.computeCentroidOfPolygon(this._positions);this.unit!=="m\xB3"&&(I.dig=I.dig/1e9,I.fill=I.fill/1e9);let F=this.unit==="m\xB3"?"\u7ACB\u65B9\u7C73":"\u7ACB\u65B9\u5343\u7C73";return this._volumeLabel=this._viewer.entities.add({position:ee.fromRadians(D.longitude,D.latitude,C),label:{text:`\u6316\u65B9\u4F53\u79EF\uFF1A${I.dig.toFixed(4)}${F}`,pixelOffset:{x:0,y:-30},font:"16px \u5B8B\u4F53",fillColor:At.GOLD,verticalOrigin:bn.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),this._volumeLabel1=this._viewer.entities.add({position:ee.fromRadians(D.longitude,D.latitude,C),label:{text:`\u586B\u65B9\u4F53\u79EF\uFF1A${I.fill.toFixed(4)}${F}`,pixelOffset:{x:0,y:-70},font:"16px \u5B8B\u4F53",fillColor:At.GOLD,verticalOrigin:bn.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),this.isLoading(!1),{maxHeight:C,minHeight:m,volume:I,unit:this.unit,spacing:o}};if(A){let E=[];return y.features.forEach(w=>{let Q=w.geometry.coordinates;E.push(Kt.fromDegrees(Q[0],Q[1]))}),EQ(this._viewer.scene.globe.terrainProvider,E).then(w=>(y.features.forEach((Q,M)=>{let B=Q.geometry.coordinates;B[2]=w[M]&&w[M].height?w[M].height:0,C<B[2]&&(C=B[2]),m>B[2]&&(m=B[2])}),v()))}return y.features.forEach(E=>{let I=E.geometry.coordinates,w=new Kt(je.toRadians(I[0]),je.toRadians(I[1]));I[2]=this._viewer.scene.sampleHeight(w)||0,C<I[2]&&(C=I[2]),m>I[2]&&(m=I[2])}),v()};_C.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=this.loadingImg,o.appendChild(A),this.loading=o,this._viewer.container.appendChild(o)};_C.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};_C.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};_C.prototype.addPoint=function(o){this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=null),this._prevEntity1&&(this.addPointHandle=new Ur(this._viewer.scene.canvas),this.addPointHandle.setInputAction(function(A){let f=this._viewer.scene.pick(A.position);if(f&&f.id&&f.id.id===this._prevEntity1.id){let m=this._viewer.scene.pickPosition(A.position);if(m){let C=Kt.fromCartesian(m);this.addPointHandle.destroy(),this.addPointHandle=null,o&&typeof o=="function"&&o(C.height.toFixed(1))}}}.bind(this),Ki.LEFT_CLICK),this.addPointHandle.setInputAction(function(A){let f=this._viewer.scene.pick(A.endPosition);f&&f.id&&f.id.id===this._prevEntity1.id?this._tooltip.showAt(A.endPosition,"\u70B9\u51FB\u4FEE\u6539\u57FA\u51C6\u9762\u9AD8\u5EA6"):this._tooltip.show(!1)}.bind(this),Ki.MOUSE_MOVE))};_C.prototype.showTin=function(o){this.tin=o,this._volumeTin.forEach(A=>{this._viewer.entities.remove(A)}),this._volumeTin=[],o&&this.tinData&&this.tinData.features.forEach(A=>{if(A.positions){let f=this._viewer.entities.add({polygon:{hierarchy:new Un(A.positions),material:this._drawColor.polygon,perPositionHeight:!0,outline:!0,outlineColor:At.YELLOW}});this._volumeTin.push(f)}})};_C.prototype.setDatum=function(o,A){if(this.Triangulation&&this.Triangulation.length>0){let f,m,C,y={fill:0,dig:0};this.Triangulation.forEach(function(v){f=v.bottomArea,m=v.height,C=(m[0]-o+m[1]-o+m[2]-o)/3,C>0?y.dig=y.dig+f*C*scale.dig:y.fill=y.fill-f*C*scale.fill}),this.unit!=="m\xB3"&&(y.dig=y.dig/1e9,y.fill=y.fill/1e9);let x=this.unit==="m\xB3"?"\u7ACB\u65B9\u7C73":"\u7ACB\u65B9\u5343\u7C73";this._volumeLabel.label.text=`\u6316\u65B9\u4F53\u79EF\uFF1A${y.dig.toFixed(4)}${x}`,this._volumeLabel1.label.text=`\u586B\u65B9\u4F53\u79EF\uFF1A${y.fill.toFixed(4)}${x}`,this._prevEntity.polygon.height=o,A&&typeof A=="function"&&A({volume:y,unit:this.unit})}};_C.prototype.getPointsInPolygon=function(o,A=50,f=!0){if(o.length<3)return;o.push(o[0]);let m=Zl.lineString(o),C=Zl.bbox(m),y=Zl.pointGrid(C,A,{units:"meters"}),x=Zl.polygon([o]),v=Zl.pointsWithinPolygon(y,x);if(f)for(let E=0;E<o.length-1;E++){let I=Zl.lineString([o[E],o[E+1]]),w={units:"meters"},Q=Zl.length(I,w),M;for(let B=A;;B+=A)if(B<=Q)M=Zl.along(I,B,w),v.features.push(M);else{M=Zl.along(I,Q,w),v.features.push(M);break}}return v};_C.prototype.tinFromPoints=function(o,A={}){let{polygon:f,getArea:m}=A,C=Zl.tin(o),y=0;return C&&C.features&&C.features.forEach(x=>{let v=!0;if(f){let E=Zl.centerOfMass(x);v=Zl.booleanPointInPolygon(E,f)}if(v){let E=x.geometry.coordinates[0],I=[],w=[];for(let Q=0;Q<3;Q++)I.push([E[Q][0],E[Q][1]]),w.push(ee.fromDegrees(E[Q][0],E[Q][1],E[Q][2]));x.positions=w,m&&(x.area=this.getArea(I,w,!0),y+=x.area)}}),{tin:C,area:y}};_C.prototype.getArea=function(o,A,f){if(o.length<3)return;o.push(o[0]);let m=o,C=0,y=Zl.polygon([m]),x;m.length===4?x=[y]:x=Zl.tesselate(y).features;let v,E,I,w;return x.forEach(Q=>{v=Q.geometry.coordinates[0],E=m.findIndex(F=>F.toString()===v[0].toString()),I=m.findIndex(F=>F.toString()===v[1].toString()),w=m.findIndex(F=>F.toString()===v[2].toString());let M=this.getdistance(A[E],A[I]),B=this.getdistance(A[I],A[w]),T=this.getdistance(A[E],A[w]),D=(M+B+T)/2;C+=Math.sqrt(D*((D-M)*(D-B)*(D-T)))}),f||(C<1e6?C=`${C.toFixed(2)}\u5E73\u65B9\u7C73`:C=`${(C/1e6).toFixed(2)}\u5E73\u65B9\u5343\u7C73`),C};_C.prototype.getdistance=function(o,A){let f=Kt.fromCartesian(o),m=Kt.fromCartesian(A),C=Di.MOON2000,x=new l0(f,m,C).surfaceDistance;return x=Math.sqrt(Math.pow(x,2)+Math.pow(m.height-f.height,2)),x};var pAt=_C;function bse(o){this.mEarthCtrl=o,this._polylines=[],this._resPolylines=[],this._points=[],this.entities=this.mEarthCtrl.entities,this.camera=this.mEarthCtrl.coreMap.camera,this.scene=this.mEarthCtrl.coreMap.scene}bse.prototype.createLineOfSight=function(o){let A=[],f=this,m=[],C=[],y={polyline:[]};f.objectsToExclude=null;let x,v=function(){function M(B){this.options={polyline:{show:!0,positions:[],material:At.YELLOW,width:3,clampToGround:!1}},this.positionsp=B,this._init()}return M.prototype._init=function(){let B=this,T=function(){return B.positionsp};this.options.polyline.positions=new Bn(T,!1),this.polyline=f.entities.add(this.options),f.item=this.polyline,C.push(this.polyline)},M}(),E=new Ur(f.scene.canvas),I=[],w;if(this._points.length>0)for(let M=0;M<this._points.length;M++)this.entities.remove(this._points[M]);let Q=[];return E.setInputAction(function(M){let B,T=new ee(0,0,0);if(new es(f.mEarthCtrl).pickVector(M.position,T)&&(B=T),!!B)if(I.length===0){I.push(B.clone(),B.clone());let F={leftX:M.position.x,leftY:M.position.y};Q.push(F),x=B.clone()}else{let F={rightX:M.position.x,rightY:M.position.y};Q.push(F);let L={postion:I,entity:C,cartesian:Q};m.push(L),Q=[],w=void 0,I=[],I.push(x.clone()),I.push(x.clone()),w=new v(I),A.push(w)}},Ki.LEFT_CLICK),E.setInputAction(function(M){let B,T=f.camera.getPickRay(M.endPosition);if(B=f.scene.globe.pick(T,f.scene),f.scene.pick(M.endPosition)){let F=f.scene.pickPosition(M.endPosition);F&&(B=F)}!B||I.length>=2&&(O(w)?B!==void 0&&(I.pop(),I.push(B)):(w=new v(I),A.push(w)))},Ki.MOUSE_MOVE),E.setInputAction(function(M){let B=f.entities.add(new UA);f.objectsToExclude=[B];let T=!0;for(let D=0;D<m.length;D++)D===0?T=f.tsjx(m[0].postion[0],m[0].postion[1]):T=f.tsjx(m[D].postion[0],m[D].postion[1]);I.pop(),f._polylines=y.polyline,E.destroy();for(let D=0;D<C.length;D++)f.entities.remove(C[D]);O(o)&&typeof o=="function"&&o(y)},Ki.RIGHT_CLICK),this};bse.prototype.tsjx=function(o,A){let f=this,m=ee.normalize(ee.subtract(A,o,new ee),new ee),C=new ls(o,m),y=f.scene.globe.pick(C,f.scene);y!=null?(x(y,o,At.GREEN),x(y,A,At.RED)):x(o,A,At.GREEN);function x(v,E,I){let w=f.entities.add({polyline:{positions:[v,E],width:1,material:I,depthFailMaterial:I}});f._resPolylines.push(w)}return!1};bse.prototype.deleteObject=function(){if(this._points.length>0){this.objectsToExclude=null;for(let o=0;o<this._points.length;o++)this.entities.remove(this._points[o])}if(this._resPolylines.length>0){for(let o=0;o<this._resPolylines.length;o++)this.entities.remove(this._resPolylines[o]);this._resPolylines=[]}};var mAt=bse;function _h(o,A={}){this._earthCtrl=o,this._viewer=o.coreMap,this._scene=o.coreMap.scene,this.options=Ae(A,{}),this._Tooltip=new pw(o),this._tooltip=this._Tooltip.CreateTooltip(),this._drawColor={point:Ae(this.options.drawColor?.point,At.BLUE),polyline:Ae(this.options.drawColor?.polyline,At.YELLOW),polygon:Ae(this.options.drawColor?.polygon,At.YELLOW.withAlpha(.5))},this.selectDatum=!0,this.onlyTerrain=!0,this.tin=!1,this._volumeTin=[],this.loadingImg=`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`,this.wallArr=[],this.FlattenPolygon=[],this._Apositions=[],this._heightsort=null,this._deepth=100,this._positions=[],this._modelArr=Ae(A.modelArr,[]),this._isFlattening=Ae(A.isFlattening,!0),this.modelCuttingPolygon=null,this.wallImgUrl=Ae(A.wallImgUrl,null),this.bottomImgUrl=Ae(A.bottomImgUrl,null),this.calculate=Ae(A.calculate,!0),this._Loading=Ae(A.loading,!0),this.editPoint=[],this.nowPoint=null,this.hierarchy=[],this._originHeight=null}_h.prototype.removeMeasureFromMap=function(){this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._prevEntity1!==void 0&&(this._viewer.entities.remove(this._prevEntity1),this._prevEntity1=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._volumeTin.forEach(o=>{this._viewer.entities.remove(o)}),this._volumeTin=[],this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=void 0),this.Triangulation=[],this.tinData=void 0,this._tooltip.show(!1)};_h.prototype.removeFromMap=function(){if(this.endEdit(),this.removeMeasureFromMap(),this.wallArr.length>0){for(let o=0;o<this.wallArr.length;o++)this._viewer.entities.remove(this.wallArr[o]);this.wallArr=[]}if(this.FlattenPolygon&&this.FlattenPolygon.length>0){for(let o=0;o<this.FlattenPolygon.length;o++)this._viewer.entities.remove(this.FlattenPolygon[o]);this.FlattenPolygon=[]}this.removeModelCutting()};_h.prototype.deleteObject=_h.prototype.removeFromMap;_h.prototype.startDrawing=function(o={},A){let f=Ae(o.spacing,"auto"),m=this._scene,C=this._tooltip,y=3,x=[],v=[],E=[],I=[],w=[],Q;this._Apositions=o.positions,this._positions=v,this._hierarchy=E,this._heightsort=I,this._degreesArr=w,this._deepth=Ae(o.deepth,100),this._drawColor.point=o.point||this._drawColor.point,this._drawColor.polyline=o.polyline||this._drawColor.polyline,this._drawColor.polygon=o.polygon||this._drawColor.polygon,this.loadingImg=o.loading||this.loadingImg,this.tin=Ae(o.tin,!1),this.onlyTerrain=Ae(o.onlyTerrain,!1),this.selectDatum=Ae(o.selectDatum,!1);let M=this;if(this._mouseHandler&&this._mouseHandler.destroy(),this.loading||this.addLoading(),o.positions){let B=ee.fromDegreesArray(o.positions);for(let T of B)v.push(T);if(!(v.length<y)){for(let T=0;T<o.positions.length;T+=2)w.push([o.positions[T],o.positions[T+1]]);this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:ee.fromDegreesArray(o.positions),material:M._drawColor.polygon,fill:!0}});for(let T=0;T<o.positions.length;T+=2){let D=M._viewer.scene.sampleHeight(new Kt(je.toRadians(o.positions[T]),je.toRadians(o.positions[T+1])));I.push(D),E.push(o.positions[T],o.positions[T+1],D)}this.stopDrawing(f,T=>{A&&A(T)})}}else{let B=new Ur(m.canvas);this._mouseHandler=B,this.removeMeasureFromMap(),this._viewer.container.style.cursor=`url(${globalThis.GEOWORLD_BASE_URL} 'Workers/image/cursor/draw.cur')`;let T;B.setInputAction(function(F){if(F.position!==null){let L=m.camera.getPickRay(F.position),R=m.globe.pick(L,m);if(this._viewer.scene.pick(F.position)){let U=this._viewer.scene.pickPosition(F.position);U&&(R=U)}if(R){let U=Kt.fromCartesian(R),V=je.toDegrees(U.longitude),H=je.toDegrees(U.latitude);if(x.length===0&&(x.push(V,H),w.push([V,H]),v.push(R),Q=R),v.length>=4){let q=Ss.wgs84ToWindowCoordinates(this._viewer.scene,Q);if(q!==void 0){let ie=q.x-F.position.x,Z=q.y-F.position.y;if(ie*ie+Z*Z<16){x.splice(x.length-2,2),v.pop(),this.stopDrawing(A);return}}}x.push(V,H),w.push([V,H]),v.push(R),v.length===2&&!T&&(T=this._viewer.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new Bn(function(){return v},!1),clampToGround:!0,material:M._drawColor.polygon,width:3}})),v.length===y&&(T&&this._viewer.entities.remove(T),this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:new Un(ee.fromDegreesArray(x)),material:M._drawColor.polygon,fill:!0}}),this._prevEntity.polygon.hierarchy=new Bn(()=>new Un(ee.fromDegreesArray(x)),!1))}}}.bind(this),Ki.LEFT_CLICK),B.setInputAction(function(F){let L=F.endPosition;if(L!==null)if(v.length===0)C.showAt(L,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7B2C\u4E00\u4E2A\u70B9");else{let R=m.camera.getPickRay(L),k=m.globe.pick(R,m),U=this._viewer.scene.pick(L),V=!1;if(U){let H=this._viewer.scene.pickPosition(L);H&&(k=H),V=!0}if(k){let H=Kt.fromCartesian(k),q=je.toDegrees(H.longitude),ie=je.toDegrees(H.latitude);if(x.splice(x.length-2,2),w.pop(),v.pop(),x.push(q,ie),w.push([q,ie]),v.push(k),C.showAt(L,"\u53F3\u952E\u7ED3\u675F\u7ED8\u5236"),v.length>=3&&v.length>=4){let Z=Ss.wgs84ToWindowCoordinates(this._viewer.scene,Q);if(Z!==void 0){let oe=Z.x-L.x,ne=Z.y-L.y;oe*oe+ne*ne<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}}.bind(this),Ki.MOUSE_MOVE);let D=null;B.setInputAction(function(F){D=window.setTimeout(()=>{console.log("\u5355\u51FB"),this.end&&this.end()},200)}.bind(this),Ki.RIGHT_CLICK),B.setInputAction(function(F){console.log("\u53CC\u51FB......"),clearTimeout(D)},Ki.LEFT_DOUBLE_CLICK),this.end=F=>{if(this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),M._viewer.container.style.cursor="default",this._tooltip.show(!1),T&&this._viewer.entities.remove(T),this.end=void 0,console.log(w,"?????????"),!(v.length<y)){if(this._prevEntity&&(this._prevEntity.polygon.hierarchy=ee.fromDegreesArray(x)),F==="cancel"){this._prevEntity&&this._viewer.entities.remove(this._prevEntity);return}for(let L=0;L<x.length;L+=2){let R=M._viewer.scene.sampleHeight(new Kt(je.toRadians(x[L]),je.toRadians(x[L+1])));I.push(R),E.push(x[L],x[L+1],R)}this._Apositions=x,this.stopDrawing(f,A)}}}return this};_h.prototype.stopDrawing=function(o,A){let f=this;this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._volumeTin.forEach(m=>{this._viewer.entities.remove(m)}),this._volumeTin=[],this._Loading&&this.isLoading(!0),setTimeout(()=>{f._heightsort.sort(function(T,D){return T-D});let m=this._viewer.entities.add({name:null,id:f._earthCtrl.factory.createUUID(),polygon:{hierarchy:new Bn(function(){return new Un(ee.fromDegreesArrayHeights(f._hierarchy))},!1),material:new V0({image:Ae(f.bottomImgUrl,`${window.SmartEarthRootUrl}Workers/image/bottomplane.jpg`),repeat:new It(1,1)})}});f.FlattenPolygon.push(m),f.originHeight=f._heightsort[0];let C=ee.fromDegreesArrayHeights(f._hierarchy);C.push(C[0]),f._positionsB=C;let y=null,x,v,E,I,w,Q;for(let T=0;T<C.length-1;T++){x=Kt.fromCartesian(C[T]),v=Kt.fromCartesian(C[T+1]),E=je.toDegrees(x.longitude),w=je.toDegrees(x.latitude),I=je.toDegrees(v.longitude),Q=je.toDegrees(v.latitude),y?y=y>v.height?v.height:y:y=x.height>v.height?v.height:x.height;let D=f.getPoint(E,w,I,Q,x.height,v.height),F=[],L=[];f.getHeightsFromLonLat(D.positions,function(R){if(R){F=R;for(let k=0;k<F.length;k++)L.push(f._heightsort[0]-f._deepth);f.drawwall(D.wallJwd,F,L)}})}if(f._baseHeight=f._heightsort[0]-f._deepth,m.polygon.height=f._baseHeight,!this.calculate)return f._isFlattening&&f.modelCutting(),A&&A(!0),this.isLoading(!1);let M=this.computeCutVolume(o,this.onlyTerrain),B=T=>{let D=T.maxHeight,F=T.minHeight;if(this._prevEntity.polygon.height=T.minHeight,this._prevEntity.polygon.heightReference=0,this.selectDatum){let L=()=>{this.addPoint(R=>{this.setDatum(R,k=>{typeof A=="function"&&A({...T,...k}),L()})})};L()}};this.onlyTerrain?M.then(T=>{B(T)}):B(M),f.setDatum(f._baseHeight,T=>{f._isFlattening&&f.modelCutting(),A&&A(T),this._Loading&&this.isLoading(!1)})},100)};_h.prototype.modelCutting=function(){let o=this;if(o._modelCuttingPolygon=rh.fromPositions({positions:ee.fromDegreesArray(o._Apositions),height:o._baseHeight}),o._modelArr.length>0)for(let A of o._modelArr)A.addFlattenPolygon(o._modelCuttingPolygon),A.needUpdateFlatten=!0,A.clipPlaneOfFlatten=!0;else console.info("\u8BF7\u6DFB\u52A0\u6A21\u578B\uFF01")};_h.prototype.removeModelCutting=function(){let o=this;if(o._modelArr.length>0){for(let A of o._modelArr)A.removeFlattenPolygon(o._modelCuttingPolygon);o._modelCuttingPolygon=null,o._modelArr=[]}else console.info("\u8BF7\u6DFB\u52A0\u6A21\u578B\uFF01")};_h.prototype.computeCentroidOfPolygon=function(o){let A=[],f=[],m=0,C=0;for(let v=0;v<o.length;v++){let E=Kt.fromCartesian(o[v]);m+=E.longitude,C+=E.latitude,A.push(E.longitude),f.push(E.latitude)}let y=0,x=0;return y=m/o.length,x=C/o.length,new Kt(y,x)};_h.prototype.edit=function(o,A,f){let m=this,C=m.editPoint,y=m.nowPoint;if(m._earthCtrl.coreMap.scene.globe.depthTestAgainstTerrain=!1,y){for(let E of m.editPoint)E&&(E.show=!0);m.update(y,C,o);return}for(let E=2;E<m._hierarchy.length;E=E+3)m._hierarchy[E]=m.originHeight-m._deepth;m.FlattenPolygon[0]&&m._viewer.entities.remove(m.FlattenPolygon[0]),m.FlattenPolygon=[];let x=this._viewer.entities.add({name:null,id:m._earthCtrl.factory.createUUID(),polygon:{hierarchy:new Un(ee.fromDegreesArrayHeights(m._hierarchy)),material:new V0({image:Ae(m.bottomImgUrl,`${window.SmartEarthRootUrl}Workers/image/bottomplane.jpg`),repeat:new It(1,1)}),perPositionHeight:!0}});m.FlattenPolygon.push(x);let v=m.FlattenPolygon[0].polygon.hierarchy.getValue();for(let E of v.positions){let I=this._viewer.entities.add({id:m._earthCtrl.factory.createUUID(),position:E,point:{color:At.WHITE,pixelSize:12,outlineColor:At.BLACK,outlineWidth:1}});C.push(I)}if(o)if(A){for(let E of C)if(A===E.id){m.nowPoint=E,m.update(E,C,o);return}}else m._earthCtrl.measure.pickObject(null,function(E){let I=E.pickedObject.id;for(let w of C)if(I.id===w.id){m.nowPoint=w,m.update(w,C,o);return}});else f&&f(C)};_h.prototype.update=function(o,A,f){let m=this,C=o.position.getValue(),x=m._scene.globe.ellipsoid.cartesianToCartographic(C),v=je.toDegrees(x.longitude),E=je.toDegrees(x.latitude),I=x.height;o.position.setValue(ee.fromDegrees(v,E,I+f)),m.editPoint=A,m.editPosition=[];let w=[];for(let M of A){let B=M.position.getValue();w.push(B),m.editPosition.push(B)}m.FlattenPolygon[0].polygon.hierarchy=new Bn(function(){return new Un(w)},!0);let Q=m.editPosition;Q.push(Q[0]);for(let M=0;M<Q.length-1;M++){let T=[];for(let D=0;D<=160;D++){let F=ee.lerp(Q[M],Q[M+1],D/160,new ee),L=Kt.fromCartesian(F);T.push(L.height)}m.wallArr[M].wall.minimumHeights.setValue(T)}};_h.prototype.endEdit=function(){let o=this;if(o._earthCtrl.coreMap.scene.globe.depthTestAgainstTerrain=!0,o.editPoint.length>0)for(let A of o.editPoint)A&&(A.show=!1)};_h.prototype.computeCutVolume=function(o,A){let f=this,m=15e3,C=-15e3;o==="auto"&&(o=wi.fromPoints(this._positions).radius/20);let y=this.getPointsInPolygon(this._degreesArr,o,!0),x=Zl.polygon([this._degreesArr]),v=()=>{let{tin:E}=this.tinFromPoints(y,{getArea:!0,polygon:x});this.tinData=E;let I={fill:0,dig:0},w={fill:"\u7ACB\u65B9\u7C73",dig:"\u7ACB\u65B9\u7C73"},Q,M,B,T,D,F={fill:1,dig:1};this.Triangulation=[],E.features.forEach(R=>{if(R.positions){if(this.tin){let U=this._viewer.entities.add({polygon:{hierarchy:new Un(R.positions),material:this._drawColor.polygon,perPositionHeight:!0,outline:!0,outlineColor:At.YELLOW}});this._volumeTin.push(U)}let k=R.geometry.coordinates[0];Q=k[0][2],M=k[1][2],B=k[2][2],D=R.area,this.Triangulation.push({bottomArea:D,height:[Q,M,B]}),T=(Q-m+M-m+B-m)/3,T>0?I.dig=I.dig+D*T*F.dig:I.fill=I.fill-D*T*F.fill,I.dig>1e10&&w.dig==="\u7ACB\u65B9\u7C73"&&(I.dig=I.dig/1e9,w.dig="\u7ACB\u65B9\u5343\u7C73",F.dig=1e-9),I.fill>1e10&&w.fill==="\u7ACB\u65B9\u7C73"&&(I.fill=I.fill/1e9,w.fill="\u7ACB\u65B9\u5343\u7C73",F.fill=1e-9)}});let L=this.computeCentroidOfPolygon(this._positions);return this._volumeLabel=this._viewer.entities.add({position:ee.fromRadians(L.longitude,L.latitude,C),label:{text:`\u6316\u65B9\u4F53\u79EF\uFF1A${I.dig.toFixed(4)}${w.dig}`,pixelOffset:{x:0,y:-30},font:"16px \u5B8B\u4F53",fillColor:At.GOLD,verticalOrigin:bn.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),this._volumeLabel1=this._viewer.entities.add({position:ee.fromRadians(L.longitude,L.latitude,C),label:{text:`\u586B\u65B9\u4F53\u79EF\uFF1A${I.fill.toFixed(4)}${w.fill}`,pixelOffset:{x:0,y:-70},font:"16px \u5B8B\u4F53",fillColor:At.GOLD,verticalOrigin:bn.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),{maxHeight:C,minHeight:m,volume:I,unit:w,spacing:o}};if(A){let E=[];return y.features.forEach(w=>{let Q=w.geometry.coordinates;E.push(Kt.fromDegrees(Q[0],Q[1]))}),EQ(this._viewer.scene.globe.terrainProvider,E).then(w=>(y.features.forEach((Q,M)=>{let B=Q.geometry.coordinates;B[2]=w[M]&&w[M].height?w[M].height:0,C<B[2]&&(C=B[2]),m>B[2]&&(m=B[2])}),v()))}return y.features.forEach(E=>{let I=E.geometry.coordinates,w=new Kt(je.toRadians(I[0]),je.toRadians(I[1]));I[2]=this._viewer.scene.sampleHeight(w)||0,C<I[2]&&(C=I[2]),m>I[2]&&(m=I[2])}),v()};_h.prototype.getPoint=function(o,A,f,m,C,y){let x=this,v=160,E=je.lerp(o,f,1/v)-o,I=je.lerp(A,m,1/v)-A,w=[],Q=[],M=[],B;w.push(o,A),B=ee.fromDegrees(o,A),Q.push(Kt.fromCartesian(B));for(let T=0;T<v;T++){let D=o+(T+1)*E,F=A+(T+1)*I;w.push(D,F),B=ee.fromDegrees(D,F),Q.push(Kt.fromCartesian(B))}return w.push(f,m),B=ee.fromDegrees(f,m),Q.push(Kt.fromCartesian(B)),{wallJwd:w,positions:Q}};_h.prototype.getHeightsFromLonLat=function(o,A){let f=this._viewer,m=[];o.forEach(function(C){m.push(f.scene.sampleHeight(new Kt(C.longitude,C.latitude)))}),typeof A=="function"&&A(m)};_h.prototype.isHaveTerrain=function(){return!!(this._viewer.scene&&this._viewer.scene.terrainProvider&&this._viewer.scene.terrainProvider._layers)};_h.prototype.drawwall=function(o,A,f){let m=this,C=m._viewer.entities.add({wall:{positions:new Bn(function(){return ee.fromDegreesArray(o)},!1),maximumHeights:A,minimumHeights:f}}),y=C.wall;y.material=new V0({image:Ae(m.wallImgUrl,`${window.SmartEarthRootUrl}Workers/image/dzmc.jpg`),repeat:new It(1,1)}),m.wallArr.push(C)};_h.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=this.loadingImg,o.appendChild(A),this.loading=o,this._viewer.container.appendChild(o)};_h.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};_h.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};_h.prototype.addPoint=function(o){this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=null),this._prevEntity1&&(this.addPointHandle=new Ur(this._viewer.scene.canvas),this.addPointHandle.setInputAction(function(A){let f=this._viewer.scene.pick(A.position);if(f&&f.id&&f.id.id===this._prevEntity1.id){let m=this._viewer.scene.pickPosition(A.position);if(m){let C=Kt.fromCartesian(m);this.addPointHandle.destroy(),this.addPointHandle=null,o&&typeof o=="function"&&o(C.height.toFixed(1))}}}.bind(this),Ki.LEFT_CLICK),this.addPointHandle.setInputAction(function(A){let f=this._viewer.scene.pick(A.endPosition);f&&f.id&&f.id.id===this._prevEntity1.id?this._tooltip.showAt(A.endPosition,"\u70B9\u51FB\u4FEE\u6539\u57FA\u51C6\u9762\u9AD8\u5EA6"):this._tooltip.show(!1)}.bind(this),Ki.MOUSE_MOVE))};_h.prototype.showTin=function(o){this.tin=o,this._volumeTin.forEach(A=>{this._viewer.entities.remove(A)}),this._volumeTin=[],o&&this.tinData&&this.tinData.features.forEach(A=>{if(A.positions){let f=this._viewer.entities.add({polygon:{hierarchy:new Un(A.positions),material:this._drawColor.polygon,perPositionHeight:!0,outline:!0,outlineColor:At.YELLOW}});this._volumeTin.push(f)}})};_h.prototype.setDatum=function(o,A){if(this.Triangulation&&this.Triangulation.length>0){let f,m,C,y={fill:0,dig:0},x={fill:"\u7ACB\u65B9\u7C73",dig:"\u7ACB\u65B9\u7C73"},v={fill:1,dig:1};this.Triangulation.forEach(function(E){f=E.bottomArea,m=E.height,C=(m[0]-o+m[1]-o+m[2]-o)/3,C>0?y.dig=y.dig+f*C*v.dig:y.fill=y.fill-f*C*v.fill,y.dig>1e10&&x.dig==="\u7ACB\u65B9\u7C73"&&(y.dig=y.dig/1e9,x.dig="\u7ACB\u65B9\u5343\u7C73",v.dig=1e-9),y.fill>1e10&&x.fill==="\u7ACB\u65B9\u7C73"&&(y.fill=y.fill/1e9,x.fill="\u7ACB\u65B9\u5343\u7C73",v.fill=1e-9)}),this._volumeLabel.label.text=`\u6316\u65B9\u4F53\u79EF\uFF1A${y.dig.toFixed(4)}${x.dig}`,this._volumeLabel1.label.text=`\u586B\u65B9\u4F53\u79EF\uFF1A${y.fill.toFixed(4)}${x.fill}`,this._prevEntity.polygon.height=o,A&&typeof A=="function"&&A({volume:y,unit:x})}};_h.prototype.getPointsInPolygon=function(o,A=50,f=!0){if(o.length<3)return;o.push(o[0]);let m=Zl.lineString(o),C=Zl.bbox(m),y=Zl.pointGrid(C,A,{units:"meters"}),x=Zl.polygon([o]),v=Zl.pointsWithinPolygon(y,x);if(f)for(let E=0;E<o.length-1;E++){let I=Zl.lineString([o[E],o[E+1]]),w={units:"meters"},Q=Zl.length(I,w),M;for(let B=A;;B+=A)if(B<=Q)M=Zl.along(I,B,w),v.features.push(M);else{M=Zl.along(I,Q,w),v.features.push(M);break}}return v};_h.prototype.tinFromPoints=function(o,A={}){let{polygon:f,getArea:m}=A,C=Zl.tin(o),y=0;return C&&C.features&&C.features.forEach(x=>{let v=!0;if(f){let E=Zl.centerOfMass(x);v=Zl.booleanPointInPolygon(E,f)}if(v){let E=x.geometry.coordinates[0],I=[],w=[];for(let Q=0;Q<3;Q++)I.push([E[Q][0],E[Q][1]]),w.push(ee.fromDegrees(E[Q][0],E[Q][1],E[Q][2]));x.positions=w,m&&(x.area=this.getArea(I,w,!0),y+=x.area)}}),{tin:C,area:y}};_h.prototype.getArea=function(o,A,f){if(o.length<3)return;o.push(o[0]);let m=o,C=0,y=Zl.polygon([m]),x;m.length===4?x=[y]:x=Zl.tesselate(y).features;let v,E,I,w;return x.forEach(Q=>{v=Q.geometry.coordinates[0],E=m.findIndex(F=>F.toString()===v[0].toString()),I=m.findIndex(F=>F.toString()===v[1].toString()),w=m.findIndex(F=>F.toString()===v[2].toString());let M=this.getdistance(A[E],A[I]),B=this.getdistance(A[I],A[w]),T=this.getdistance(A[E],A[w]),D=(M+B+T)/2;C+=Math.sqrt(D*((D-M)*(D-B)*(D-T)))}),f||(C<1e6?C=`${C.toFixed(2)}\u5E73\u65B9\u7C73`:C=`${(C/1e6).toFixed(2)}\u5E73\u65B9\u5343\u7C73`),C};_h.prototype.getdistance=function(o,A){let f=Kt.fromCartesian(o),m=Kt.fromCartesian(A),C=new l0;C.setEndPoints(f,m);let y=C.surfaceDistance;return y=Math.sqrt(Math.pow(y,2)+Math.pow(m.height-f.height,2)),y};var CAt=_h;function T2(o,A={}){this._earthCtrl=o,this._viewer=o.coreMap,this._scene=o.coreMap.scene,this.options=Ae(A,{}),this._modelArr=[],this._Apositions=[],this.FlattenPolygon=[],this._Loading=Ae(A.loading,!1),this._bottom=Ae(A.bottom,!1),this.loadingImg=Ae(A.loadingImg,`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`),this._Tooltip=new pw(o),this._tooltip=this._Tooltip.CreateTooltip(),this._positions=[],this._deepth=100,this._drawColor={point:Ae(this.options.drawColor?.point,At.BLUE),polyline:Ae(this.options.drawColor?.polyline,At.YELLOW),polygon:Ae(this.options.drawColor?.polygon,At.YELLOW.withAlpha(.5))}}T2.prototype.removeMeasureFromMap=function(){this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=void 0),this.Triangulation=[],this.tinData=void 0,this._tooltip.show(!1)};T2.prototype.startDrawing=function(o={},A){let f=this._scene,m=this._tooltip,C=3,y,x=[],v=[],E=[],I=[],w=[];this._positions=v,this._hierarchy=E,this._heightsort=I,this._degreesArr=w,this._deepth=Ae(o.deepth,100),this._modelArr=Ae(o.modelArr,[]);let Q=this;if(this._mouseHandler&&this._mouseHandler.destroy(),this.loading||this.addLoading(),o.positions){let M=ee.fromDegreesArray(o.positions);for(let B of M)v.push(B);if(!(v.length<C)){for(let B=0;B<o.positions.length;B+=2)w.push([o.positions[B],o.positions[B+1]]);console.log(v,"\u4F4D\u7F6E\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A"),this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:ee.fromDegreesArray(o.positions),material:Q._drawColor.polygon,fill:!0}});for(let B=0;B<o.positions.length;B+=2){let T=Q._viewer.scene.sampleHeight(new Kt(je.toRadians(o.positions[B]),je.toRadians(o.positions[B+1])));I.push(T),E.push(o.positions[B],o.positions[B+1],T)}this._Apositions=o.positions,this.stopDrawing(B=>{A&&A(B)})}}else{let M=new Ur(f.canvas);this._mouseHandler=M,this.removeMeasureFromMap(),this._viewer.container.style.cursor=`url(${globalThis.GEOWORLD_BASE_URL} 'Workers/image/cursor/draw.cur')`;let B;M.setInputAction(function(T){if(T.position!==null){let D=f.camera.getPickRay(T.position),F=f.globe.pick(D,f);if(this._viewer.scene.pick(T.position)){let R=this._viewer.scene.pickPosition(T.position);R&&(F=R)}if(F){let R=Kt.fromCartesian(F),k=je.toDegrees(R.longitude),U=je.toDegrees(R.latitude);if(x.length===0&&(x.push(k,U),w.push([k,U]),v.push(F),y=F),v.length>=4){let V=Ss.wgs84ToWindowCoordinates(this._viewer.scene,y);if(V!==void 0){let H=V.x-T.position.x,q=V.y-T.position.y;if(H*H+q*q<16){x.splice(x.length-2,2),v.pop(),this.stopDrawing(A);return}}}x.push(k,U),w.push([k,U]),v.push(F),v.length===2&&!B&&(B=this._viewer.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new Bn(function(){return v},!1),clampToGround:!0,material:Q._drawColor.polygon,width:3}})),v.length===C&&(B&&this._viewer.entities.remove(B),this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:new Un(ee.fromDegreesArray(x)),material:Q._drawColor.polygon,fill:!0}}),this._prevEntity.polygon.hierarchy=new Bn(()=>new Un(ee.fromDegreesArray(x)),!1))}}}.bind(this),Ki.LEFT_CLICK),M.setInputAction(function(T){let D=T.endPosition;if(D!==null)if(v.length===0)m.showAt(D,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7B2C\u4E00\u4E2A\u70B9");else{let F=f.camera.getPickRay(D),L=f.globe.pick(F,f),R=this._viewer.scene.pick(D),k=!1;if(R){let U=this._viewer.scene.pickPosition(D);U&&(L=U),k=!0}if(L){let U=Kt.fromCartesian(L),V=je.toDegrees(U.longitude),H=je.toDegrees(U.latitude);if(x.splice(x.length-2,2),w.pop(),v.pop(),x.push(V,H),w.push([V,H]),v.push(L),m.showAt(D,"\u53F3\u952E\u7ED3\u675F\u7ED8\u5236"),v.length>=3&&v.length>=4){let q=Ss.wgs84ToWindowCoordinates(this._viewer.scene,y);if(q!==void 0){let ie=q.x-D.x,Z=q.y-D.y;ie*ie+Z*Z<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}}.bind(this),Ki.MOUSE_MOVE),M.setInputAction(function(T){this.end&&this.end()}.bind(this),Ki.RIGHT_CLICK),this.end=T=>{if(this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),Q._viewer.container.style.cursor="default",this._tooltip.show(!1),B&&this._viewer.entities.remove(B),this.end=void 0,console.log(w,"?????????"),!(v.length<C)){if(this._prevEntity&&(this._prevEntity.polygon.hierarchy=ee.fromDegreesArray(x)),T==="cancel"){this._prevEntity&&this._viewer.entities.remove(this._prevEntity);return}for(let D=0;D<x.length;D+=2){let F=Q._viewer.scene.sampleHeight(new Kt(je.toRadians(x[D]),je.toRadians(x[D+1])));I.push(F),E.push(x[D],x[D+1],F)}this._Apositions=x,this.stopDrawing(A)}}}};T2.prototype.stopDrawing=function(o){let A=this;this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._Loading&&this.isLoading(!0),setTimeout(()=>{A._heightsort.sort(function(m,C){return m-C});let f=null;A._bottom?(f=this._viewer.entities.add({name:null,id:A._earthCtrl.factory.createUUID(),polygon:{hierarchy:new Bn(function(){return new Un(ee.fromDegreesArrayHeights(A._hierarchy))},!1),material:new V0({image:Ae(A.bottomImgUrl,`${window.SmartEarthRootUrl}Workers/image/bottomplane.jpg`),repeat:new It(1,1)})}}),A._baseHeight=A._heightsort[0]-A._deepth,f.polygon.height=A._baseHeight):f=this._viewer.entities.add({name:null,id:A._earthCtrl.factory.createUUID(),polygon:{hierarchy:new Bn(function(){return new Un(ee.fromDegreesArrayHeights(A._hierarchy))},!1),material:At.YELLOW.withAlpha(0)}}),A.FlattenPolygon.push(f),A.modelCutting()})};T2.prototype.modelCutting=function(){let o=this;if(o._modelCuttingPolygon=rh.fromPositions({positions:ee.fromDegreesArray(o._Apositions),height:o._baseHeight}),o._modelArr.length>0)for(let A of o._modelArr)A.addFlattenPolygon(o._modelCuttingPolygon),A.needUpdateFlatten=!0,A.clipPlaneOfFlatten=!0;else console.info("\u8BF7\u6DFB\u52A0\u6A21\u578B\uFF01")};T2.prototype.removeModelCutting=function(){let o=this;if(o._modelArr.length>0){for(let A of o._modelArr)A.removeFlattenPolygon(o._modelCuttingPolygon);o._modelCuttingPolygon=null,o._modelArr=[]}};T2.prototype.removeFromMap=function(){if(this.removeMeasureFromMap(),this.FlattenPolygon&&this.FlattenPolygon.length>0){for(let o=0;o<this.FlattenPolygon.length;o++)this._viewer.entities.remove(this.FlattenPolygon[o]);this.FlattenPolygon=[]}this.removeModelCutting()};T2.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=this.loadingImg,o.appendChild(A),this.loading=o,this._viewer.container.appendChild(o)};T2.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};T2.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};var yAt=T2;function M2(o,A={}){this._earthCtrl=o,this._viewer=o.coreMap,this._scene=o.coreMap.scene,this.options=Ae(A,{}),this._Apositions=[],this.FlattenPolygon=[],this._terrainFlatten=new _N(o.coreMap.scene),this._Loading=Ae(A.loading,!1),this._bottom=Ae(A.bottom,!1),this.loadingImg=Ae(A.loadingImg,`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`),this._Tooltip=new pw(o),this._tooltip=this._Tooltip.CreateTooltip(),this._positions=[],this._deepth=10,this._drawColor={point:Ae(this.options.drawColor?.point,At.BLUE),polyline:Ae(this.options.drawColor?.polyline,At.YELLOW),polygon:Ae(this.options.drawColor?.polygon,At.YELLOW.withAlpha(.5))}}M2.prototype.removeMeasureFromMap=function(){this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=void 0),this.Triangulation=[],this.tinData=void 0,this._tooltip.show(!1)};M2.prototype.startDrawing=function(o={},A){let f=this._scene,m=this._tooltip,C=3,y,x=[],v=[],E=[],I=[],w=[];this._positions=v,this._hierarchy=E,this._heightsort=I,this._degreesArr=w,this._deepth=Ae(o.deepth,100);let Q=this;if(this._mouseHandler&&this._mouseHandler.destroy(),this.loading||this.addLoading(),o.positions){let M=ee.fromDegreesArray(o.positions);for(let B of M)v.push(B);if(!(v.length<C)){for(let B=0;B<o.positions.length;B+=2)w.push([o.positions[B],o.positions[B+1]]);this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:ee.fromDegreesArray(o.positions),material:Q._drawColor.polygon,fill:!0}});for(let B=0;B<o.positions.length;B+=2){let T=Q._viewer.scene.sampleHeight(new Kt(je.toRadians(o.positions[B]),je.toRadians(o.positions[B+1])));I.push(T),E.push(o.positions[B],o.positions[B+1],T)}this._Apositions=o.positions,this.stopDrawing(B=>{A&&A(B)})}}else{let M=new Ur(f.canvas);this._mouseHandler=M,this.removeMeasureFromMap(),this._viewer.container.style.cursor=`url(${globalThis.GEOWORLD_BASE_URL} 'Workers/image/cursor/draw.cur')`;let B;M.setInputAction(function(T){if(T.position!==null){let D=f.camera.getPickRay(T.position),F=f.globe.pick(D,f);if(this._viewer.scene.pick(T.position)){let R=this._viewer.scene.pickPosition(T.position);R&&(F=R)}if(F){let R=Kt.fromCartesian(F),k=je.toDegrees(R.longitude),U=je.toDegrees(R.latitude);if(x.length===0&&(x.push(k,U),w.push([k,U]),v.push(F),y=F),v.length>=4){let V=Ss.wgs84ToWindowCoordinates(this._viewer.scene,y);if(V!==void 0){let H=V.x-T.position.x,q=V.y-T.position.y;if(H*H+q*q<16){x.splice(x.length-2,2),v.pop(),this.stopDrawing(A);return}}}x.push(k,U),w.push([k,U]),v.push(F),v.length===2&&!B&&(B=this._viewer.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new Bn(function(){return v},!1),clampToGround:!0,material:Q._drawColor.polygon,width:3}})),v.length===C&&(B&&this._viewer.entities.remove(B),this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:new Un(ee.fromDegreesArray(x)),material:Q._drawColor.polygon,fill:!0}}),this._prevEntity.polygon.hierarchy=new Bn(()=>new Un(ee.fromDegreesArray(x)),!1))}}}.bind(this),Ki.LEFT_CLICK),M.setInputAction(function(T){let D=T.endPosition;if(D!==null)if(v.length===0)m.showAt(D,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7B2C\u4E00\u4E2A\u70B9");else{let F=f.camera.getPickRay(D),L=f.globe.pick(F,f),R=this._viewer.scene.pick(D),k=!1;if(R){let U=this._viewer.scene.pickPosition(D);U&&(L=U),k=!0}if(L){let U=Kt.fromCartesian(L),V=je.toDegrees(U.longitude),H=je.toDegrees(U.latitude);if(x.splice(x.length-2,2),w.pop(),v.pop(),x.push(V,H),w.push([V,H]),v.push(L),m.showAt(D,"\u53F3\u952E\u7ED3\u675F\u7ED8\u5236"),v.length>=3&&v.length>=4){let q=Ss.wgs84ToWindowCoordinates(this._viewer.scene,y);if(q!==void 0){let ie=q.x-D.x,Z=q.y-D.y;ie*ie+Z*Z<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}}.bind(this),Ki.MOUSE_MOVE),M.setInputAction(function(T){this.end&&this.end()}.bind(this),Ki.RIGHT_CLICK),this.end=T=>{if(this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),Q._viewer.container.style.cursor="default",this._tooltip.show(!1),B&&this._viewer.entities.remove(B),this.end=void 0,console.log(w,"?????????"),!(v.length<C)){if(this._prevEntity&&(this._prevEntity.polygon.hierarchy=ee.fromDegreesArray(x)),T==="cancel"){this._prevEntity&&this._viewer.entities.remove(this._prevEntity);return}for(let D=0;D<x.length;D+=2){let F=Q._viewer.scene.sampleHeight(new Kt(je.toRadians(x[D]),je.toRadians(x[D+1])));I.push(F),E.push(x[D],x[D+1],F)}this._Apositions=x,this.stopDrawing(A)}}}};M2.prototype.stopDrawing=function(o){let A=this;this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._Loading&&this.isLoading(!0),setTimeout(()=>{A._heightsort.sort(function(C,y){return C-y});let f=null;A._bottom?(f=this._viewer.entities.add({name:null,id:A._earthCtrl.factory.createUUID(),polygon:{hierarchy:new Bn(function(){return new Un(ee.fromDegreesArrayHeights(A._hierarchy))},!1),material:new V0({image:Ae(A.bottomImgUrl,`${window.SmartEarthRootUrl}Workers/image/bottomplane.jpg`),repeat:new It(1,1)})}}),A._baseHeight=A._heightsort[0]-A._deepth,f.polygon.height=A._baseHeight):f=this._viewer.entities.add({name:null,id:A._earthCtrl.factory.createUUID(),polygon:{hierarchy:new Bn(function(){return new Un(ee.fromDegreesArrayHeights(A._hierarchy))},!1),material:At.YELLOW.withAlpha(0)}}),A.FlattenPolygon.push(f);let m=[];A._baseHeight=A._heightsort[0]-A._deepth;for(let C=0;C<A._hierarchy.length;C+=3)m.push(A._hierarchy[C],A._hierarchy[C+1],A._baseHeight);console.log(m,"\u4F4D\u7F6E\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A"),A.terrainCutting(m)})};M2.prototype.terrainCutting=function(o){let A=this;A._terrainFlatten.addPolygon(o),A._terrainFlatten.update(),A._terrainFlatten.clipPlaneOfFlatten=!0};M2.prototype.removeTerrainCutting=function(){this._terrainFlatten.clearPolygon()};M2.prototype.removeFromMap=function(){if(this.removeMeasureFromMap(),this.FlattenPolygon&&this.FlattenPolygon.length>0){for(let o=0;o<this.FlattenPolygon.length;o++)this._viewer.entities.remove(this.FlattenPolygon[o]);this.FlattenPolygon=[]}this.removeTerrainCutting()};M2.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=this.loadingImg,o.appendChild(A),this.loading=o,this._viewer.container.appendChild(o)};M2.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};M2.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};var xAt=M2;function mw(o,A={}){this._earthCtrl=o,this._terrainFlatten=new _N(this._earthCtrl.coreMap.scene),this._viewer=o.coreMap,this._scene=o.coreMap.scene,this.options=Ae(A,{}),this._Tooltip=new pw(o),this._tooltip=this._Tooltip.CreateTooltip(),this._drawColor={point:Ae(this.options.drawColor?.point,At.BLUE),polyline:Ae(this.options.drawColor?.polyline,At.YELLOW),polygon:Ae(this.options.drawColor?.polygon,At.YELLOW.withAlpha(.5))},this.loadingImg=`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`,this.wallArr=[],this.FlattenPolygon=[],this._Apositions=[],this._heightsort=null,this._deepth=100,this._positions=[],this._modelArr=Ae(A.modelArr,[]),this._isFlattening=Ae(A.isFlattening,!0),this.modelCuttingPolygon=null,this.wallImgUrl=Ae(A.wallImgUrl,null),this.bottomImgUrl=Ae(A.bottomImgUrl,null),this._Loading=Ae(A.loading,!0)}mw.prototype.removeMeasureFromMap=function(){this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=void 0),this.Triangulation=[],this.tinData=void 0,this._tooltip.show(!1)};mw.prototype.removeFromMap=function(){if(this.removeMeasureFromMap(),this.wallArr.length>0){for(let o=0;o<this.wallArr.length;o++)this._viewer.entities.remove(this.wallArr[o]);this.wallArr=[]}if(this.FlattenPolygon&&this.FlattenPolygon.length>0){for(let o=0;o<this.FlattenPolygon.length;o++)this._viewer.entities.remove(this.FlattenPolygon[o]);this.FlattenPolygon=[]}this.removeModelCutting()};mw.prototype.deleteObject=mw.prototype.removeFromMap;mw.prototype.startDrawing=function(o={},A){let f=Ae(o.spacing,"auto"),m=this._scene,C=this._tooltip,y=3,x=this._positions,v=[],E;this._Apositions=o.positions,this._heightsort=v,this._deepth=Ae(o.deepth,100),this._sampleStep=Ae(o.sampleStep,100),this._maxSampleCount=Ae(o.maxSampleCount,200),this._drawColor.point=o.point||this._drawColor.point,this._drawColor.polyline=o.polyline||this._drawColor.polyline,this._drawColor.polygon=o.polygon||this._drawColor.polygon,this.loadingImg=o.loading||this.loadingImg;let I=this;if(this._mouseHandler&&this._mouseHandler.destroy(),this.loading||this.addLoading(),!o.positions){let w=new Ur(m.canvas);this._mouseHandler=w,this.removeMeasureFromMap(),this._viewer.container.style.cursor=`url(${globalThis.GEOWORLD_BASE_URL} 'Assets/image/cursor/draw.cur')`;let Q;w.setInputAction(function(B){if(B.position!==null){let T=this._viewer.scene.pickPosition(B.position);if(T){let D=Kt.fromCartesian(T);if(x.length===0&&(x.push(D),E=T),x.length>=4){let F=Ss.wgs84ToWindowCoordinates(this._viewer.scene,E);if(F!==void 0){let L=F.x-B.position.x,R=F.y-B.position.y;if(L*L+R*R<16){x.splice(x.length-2,2),this.stopDrawing(A);return}}}x.push(D),x.length===2&&!Q&&(Q=this._viewer.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new Bn(function(){let F=[];for(let L=0;L<x.length;L++){let R=x[L];F.push(R.longitude,R.latitude,R.height)}return ee.fromRadiansArrayHeights(F)},!1),clampToGround:!1,material:I._drawColor.polygon,width:3}})),x.length===y&&(Q&&this._viewer.entities.remove(Q),this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:new Bn(()=>{let F=[];for(let L=0;L<x.length;L++){let R=x[L];F.push(R.longitude,R.latitude,R.height)}return new Un(ee.fromRadiansArrayHeights(F))},!1),material:I._drawColor.polygon,fill:!0}}))}}}.bind(this),Ki.LEFT_CLICK),w.setInputAction(function(B){let T=B.endPosition;if(T!==null)if(x.length===0)C.showAt(T,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7B2C\u4E00\u4E2A\u70B9");else{let D=this._viewer.scene.pickPosition(T);if(D){let F=Kt.fromCartesian(D);if(x.splice(x.length-1,1),x.push(F),C.showAt(T,"\u53F3\u952E\u7ED3\u675F\u7ED8\u5236"),x.length>=3&&x.length>=4){let L=Ss.wgs84ToWindowCoordinates(this._viewer.scene,E);if(L!==void 0){let R=L.x-T.x,k=L.y-T.y;R*R+k*k<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}}.bind(this),Ki.MOUSE_MOVE);let M=null;w.setInputAction(function(B){M=window.setTimeout(()=>{console.log("\u5355\u51FB"),this.end&&this.end()},200)}.bind(this),Ki.RIGHT_CLICK),w.setInputAction(function(B){console.log("\u53CC\u51FB......"),clearTimeout(M)},Ki.LEFT_DOUBLE_CLICK),this.end=B=>{if(this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),I._viewer.container.style.cursor="default",this._tooltip.show(!1),Q&&this._viewer.entities.remove(Q),this.end=void 0,!(x.length<y)){if(this._prevEntity&&this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0,B==="cancel")return;for(let T=0;T<x.length;T+=2){let D=x[T].height;v.push(D)}this._Apositions=x,this.stopDrawing(f,A)}}}return this};function gLi(o,A,f){let m=je.lerp(o.longitude,A.longitude,1/f)-o.longitude,C=je.lerp(o.latitude,A.latitude,1/f)-o.latitude,y=[];y.push(o);for(let x=0;x<f;x++){let v=o.longitude+(x+1)*m,E=o.latitude+(x+1)*C;y.push(new Kt(v,E))}return y.push(A),y}function pLi(o,A,f,m,C){let y=[];A.forEach(function(x){let v=Kt.toCartesian(new Kt(x.longitude,x.latitude,m)),E=Kt.toCartesian(new Kt(x.longitude,x.latitude,f)),I=ee.normalize(ee.subtract(E,v,new ee),new ee),w=new ls(v,I),Q=null,M=[],B=o.scene.drillPickFromRay(w,1,M);o.scene.globe.show=!1,B.length>0&&!B[0].object&&B[0].position?(Q=o.scene.drillPickFromRay(w,100,M),Q.unshift(B[0])):Q=o.scene.drillPickFromRay(w,100,M),o.scene.globe.show=!0,y.push(Q)}),typeof C=="function"&&C(y)}function mLi(o,A,f){for(let y=0;y<o.length;y++){let x=o[y];for(let v=0;v<x.length;v++){let E=x[v].position,I=Kt.fromCartesian(E);if(I.height<A){x.splice(v,x.length-v);let w=ee.fromRadians(I.latitude,I.longitude,A);x.push({object:null,position:w});break}}{let v=x[x.length-1].position,E=Kt.fromCartesian(v);if(Math.abs(E.height-A)>.01){let I=ee.fromRadians(E.latitude,E.longitude,A);x.push({object:null,position:I})}}{let v=x[x.length-1].position,E=Kt.fromCartesian(v);console.log("di",E.height)}}for(let y=0;y<o.length;y++){let x=o[y],v=x[x.length-1];f.push(v.position)}let m=0;o.forEach(function(y){m=m<y.length?y.length:m}),o.forEach(function(y){if(m-y.length>0){let v=y.length;y.length=m,y.fill(null,v,y.length)}});let C=[];for(let y=0;y<m-1;y++){let x=[],v=[];for(let E=0;E<o.length;E++){let I=o[E][y],w=o[E][y+1];I&&w&&(x.push(I),v.push(w))}C.push({ups:x,bottoms:v})}return C}mw.prototype.stopDrawing=function(o,A){let f=this;this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._Loading&&this.isLoading(!0);let m=this._positions,C=this._viewer,y=this.wallArr,x=this._deepth,v=this._sampleStep,E=this._maxSampleCount;m.push(m[0]);let I=0;for(let w=0;w<m.length-1;w++){let Q=ee.fromRadians(m[w].longitude,m[w].latitude,m[w].height),M=ee.fromRadians(m[w+1].longitude,m[w+1].latitude,m[w+1].height),T=ee.distance(M,Q)/v;I=I<T?T:I}I=E<I?E:I,I=260,setTimeout(()=>{f._heightsort.sort(function(D,F){return D-F});let w=f._heightsort[0]+2e3,Q=f._heightsort[0]-2e3,M=[];for(let D=0;D<m.length-1;D++){let F=m[D],L=m[D+1],R=gLi(F,L,I);pLi(C,R,Q,w,function(k){let U=mLi(k,x,M);for(let V=0;V<U.length;V++){let H=U[V];y.push(CLi(C,H,V))}})}let B=[];for(let D=0;D<m.length;D++){let F=m[D];B.push(F.longitude,F.latitude,x)}let T=C.entities.add({polygon:{hierarchy:{positions:ee.fromRadiansArrayHeights(B)},perPositionHeight:!0,granularity:je.RADIANS_PER_DEGREE*100,material:new V0({image:`${globalThis.GEOWORLD_BASE_URL}Workers/image/bottomplane.jpg`,repeat:new It(1,1)}),fill:!0}});return y.push(T),f._isFlattening&&f.modelCutting(),A&&A(!0),this.isLoading(!1)},20)};mw.prototype.modelCutting=function(){let o=this,A=this._deepth,f=this._positions,m=[],C=[];for(let y=0;y<f.length;y++){let x=f[y];m.push(x.longitude,x.latitude,x.height-10),C.push(je.toDegrees(x.longitude),je.toDegrees(x.latitude),x.height-10)}if(o._modelCuttingPolygon=rh.fromPositions({positions:ee.fromRadiansArrayHeights(m),height:A-10}),o._terrainFlatten.addPolygon(C),o._terrainFlatten.update(),o._terrainFlatten.clipPlaneOfFlatten=!0,o._modelArr.length>0)for(let y of o._modelArr)y.addFlattenPolygon(o._modelCuttingPolygon),y.needUpdateFlatten=!0,y.clipPlaneOfFlatten=!0;else console.info("\u8BF7\u6DFB\u52A0\u6A21\u578B\uFF01")};mw.prototype.removeModelCutting=function(){let o=this;if(o._modelArr.length>0){for(let A of o._modelArr)A.removeFlattenPolygon(o._modelCuttingPolygon);o._modelCuttingPolygon=null,o._modelArr=[],o._terrainFlatten.clearPolygon(),o._terrainFlatten.clipPlaneOfFlatten=!1}else console.info("\u8BF7\u6DFB\u52A0\u6A21\u578B\uFF01")};function CLi(o,A,f){let m=[],C=[];for(let I=0;I<A.ups.length;I++){let w=A.ups[I];m.push(w.position);let Q=Kt.fromCartesian(w.position);C.push(Q.height)}let y=[];for(let I=0;I<A.bottoms.length;I++){let w=A.bottoms[I],Q=Kt.fromCartesian(w.position);y.push(Q.height)}let x=`${globalThis.GEOWORLD_BASE_URL}Workers/image/MTY0001.jpg`,v=`${globalThis.GEOWORLD_BASE_URL}Workers/image/MTY0002.jpg`,E=o.entities.add({wall:{positions:m,material:new V0({image:f%2?x:v,repeat:new It(.01,.01)}),maximumHeights:C,minimumHeights:y,granularity:je.RADIANS_PER_DEGREE*100}});return E.show=!0,E}mw.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=this.loadingImg,o.appendChild(A),this.loading=o,this._viewer.container.appendChild(o)};mw.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};mw.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};var vAt=mw;function id(o){this._earthCtrl=o,this._coreMap=o.coreMap,this.tools=[],this.vols=[],this.saveResult=!1}id.prototype.getDistanceSpace=function(o){this.saveResult===!1&&this.deleteObject(),this._tool=new FW(this._earthCtrl),this._tool.spaceDistance(o),this.tools.push(this._tool)};id.prototype.getDistanceHorizontal=function(o){this.saveResult===!1&&this.deleteObject(),this._tool=new FW(this._earthCtrl),this._tool.horizontalDistance(o),this.tools.push(this._tool)};id.prototype.deleteObject=function(){O(this._tool)&&this._tool.deleteObject(),this.saveResult===!1&&this.tools.pop()};id.prototype.deleteAll=function(){this.tools.forEach(function(o){o.deleteObject()}),this.vols.forEach(function(o){o.cleanUp()}),this._earthCtrl.measure.tools.forEach(function(o){o.clearResult()}),this.tools=[],this.vols=[],this._earthCtrl.measure.tools=[]};id.prototype.saveResults=function(o){this.saveResult=o};id.prototype.getPlaneArea=function(o){this.saveResult===!1&&this.deleteObject(),this._tool=new FW(this._earthCtrl),this._tool.getPlaneArea(o),this.tools.push(this._tool)};id.prototype.getSurfaceArea3d=function(o){this.saveResult===!1&&this.deleteObject(),this._tool=new FW(this._earthCtrl),this._tool.getSurfaceArea3d(o),this.tools.push(this._tool)};id.prototype.volumetric=function(o){this.saveResult===!1&&this.removeVolumetric(),this._vol=new KTe(this._earthCtrl),this._vol.startDrawing(o),this.vols.push(this._vol)};id.prototype.removeVolumetric=function(o){O(this._vol)&&this.vols.forEach(function(A){A.cleanUp()})};id.prototype.lineOfSight=function(o){this._tool=new mAt(this._earthCtrl),this._tool.createLineOfSight(o),this.tools.push(this._tool)};id.prototype.createViewShed=function(o){return new HTe(this._earthCtrl,o)};id.prototype.createSubmergence=function(o){return new YTe(this._earthCtrl,o)};id.prototype.createProfile=function(o){return new jTe(this._earthCtrl,o)};id.prototype.createBufferAnalysis=function(o){return new zre(this._earthCtrl,o)};id.prototype.createSkyline=function(o){return new qTe(this._earthCtrl,o)};id.prototype.createCurtainContrast=function(o){return new hAt(this._earthCtrl,o)};id.prototype.createRestrictTheHeight=function(o){return new ZTe(this._earthCtrl,o)};id.prototype.createModifyMesh=function(o,A){return new $Te(this._earthCtrl).addClipping(o,A)};id.prototype.createTerrainModifier=function(o){return new iMe(this._earthCtrl,o)};id.prototype.createTerrainExcavation=function(o){return new aMe(this._earthCtrl,o)};id.prototype.createExcavationAndFillAnalysis=function(o){return new wse(this._earthCtrl,o)};id.prototype.createVolumetricMeasure=function(o){return new pAt(this._earthCtrl,o)};id.prototype.createModelVolumetric=function(o){return new CAt(this._earthCtrl,o)};id.prototype.createModelCutting=function(o){return new yAt(this._earthCtrl,o)};id.prototype.createTerrainCutting=function(o){return new xAt(this._earthCtrl,o)};id.prototype.createModelSection=function(o){return new vAt(this._earthCtrl,o)};var sMe=id;function Qse(o,A){if(this._earthCtrl=o,!O(A.flagHtml))throw new Ui("flagDiv is required.");this._flagHtml=A.flagHtml,this._options=Ae(A,Ae.EMAIL),this._circleRadius=Ae(A.circleRadius,10),this._lon=Ae(A.lon,121),this._lat=Ae(A.lat,31),this._height=Ae(A.height,0),this._show=Ae(A.show,!0),this._flagScale=Ae(A.flagScale,4),this._circleColor=Ae(A.circleColor,At.RED),this._cylinderColor=Ae(A.cylinderColor,At.YELLOWGREEN),this._duration=Ae(A.duration,2e3),this._gradient=Ae(A.gradient,2),this._count=Ae(A.count,2),this._canvasZoom=Ae(A.canvasZoom,10),this._circleEntity=void 0,this._cylinderEntity=void 0,this._lineEntity=void 0,this._htmlPlaneEntity=void 0,this._linePlaneEntity=void 0,this._flagDiv=document.createElement("div"),this._flagDiv.style.opacity="0.7",this._flagDiv.style.margin="0",this._flagDiv.style.padding="0",this._flagDiv.id=Ae(A.id,Vu()),this._flagDiv.innerHTML=this._flagHtml,this._show&&this.addToMap()}Qse.prototype.removeFromMap=function(){O(this._circleEntity)&&(this._earthCtrl.entities.remove(this._circleEntity),this._circleEntity=void 0),O(this._cylinderEntity)&&(this._earthCtrl.entities.remove(this._cylinderEntity),this._cylinderEntity=void 0),O(this._lineEntity)&&(this._earthCtrl.entities.remove(this._lineEntity),this._lineEntity=void 0),O(this._linePlaneEntity)&&(this._earthCtrl.entities.remove(this._linePlaneEntity),this._linePlaneEntity=void 0),O(this._htmlPlaneEntity)&&(this._earthCtrl.entities.remove(this._htmlPlaneEntity),this._htmlPlaneEntity=void 0)};Qse.prototype.addToMap=function(){let o=this,A=0,f=2,m,C=ee.fromDegrees(o._lon,o._lat,o._height);if(O(o._circleEntity)||(o._circleEntity=o._earthCtrl.entities.add({position:C,ellipse:{height:o._height,semiMinorAxis:o._circleRadius,semiMajorAxis:o._circleRadius,material:new Z8({duration:o._duration,gradient:o._gradient,color:o._circleColor,count:o._count})}})),!O(o._cylinderEntity)){let v=o._circleRadius*2/5,E=o._circleRadius*3/4;m=fQ.changeCartesian3Height(C,E/2),o._cylinderEntity=o._earthCtrl.entities.add({position:m,cylinder:{length:E,topRadius:v,bottomRadius:v,fill:!0,outline:!1,material:o._cylinderColor}})}if(O(o._lineEntity)||(A=o._circleRadius*o._flagScale+o._height,o._lineEntity=o._earthCtrl.entities.add({polyline:{width:f,positions:ee.fromDegreesArrayHeights([o._lon,o._lat,o._height,o._lon,o._lat,A]),material:o._cylinderColor}})),!O(o._htmlPlaneEntity)){A=o._circleRadius*o._flagScale;let v=A/5,E=v*3,I=A-v/2,w=4*f,Q=new ee(w/2,0,I),M=fQ.changeCartesian3ByScalar(C,Q);this._linePlaneEntity=o._earthCtrl.entities.add({position:M,plane:{plane:new Wa(ee.UNIT_Y,0),dimensions:new It(w,v),material:o._cylinderColor}});let B=new ee(E/2+w,0,I);m=fQ.changeCartesian3ByScalar(C,B);let T=o._flagDiv,D=o._canvasZoom,F=document.createElement("canvas");F.width=10*v/E*D,F.height=10*D,lH.drawDocument(T,F,{zoom:D}).then(function(L){o._htmlPlaneEntity=o._earthCtrl.entities.add({position:new Bn(y,!1),plane:{plane:new Bn(x,!0),dimensions:new It(E,v),material:new V0({image:L.image,transparent:!0})}})},function(L){console.info(L)})}function y(){return m}function x(){let v=new ee;return v=ee.negate(ee.UNIT_Y,v),new Wa(v,0)}};Object.defineProperties(Qse.prototype,{});var EAt=Qse;function Sse(o,A){this._earthCtrl=o,this._scene=o.coreMap.scene,this._options=O(A,Ae.EMPTY_OBJECT),this._color=Ae(A.color,At.RED),this._lon=Ae(A.lon,121),this._lat=Ae(A.lat,31),this._height=Ae(A.height,0),this._statistics=Ae(A.statisticData,1e3),this._radius=Ae(A.radius,100),this._duration=Ae(A.duration,2e3),this._gradient=Ae(A.gradient,2),this._count=Ae(A.count,2),this._scale=Ae(A.dataScale,1),this._show=Ae(A.show,!0),this._billboardWidthRatio=Ae(A.billboardWidthRatio,1.2),this._billboardHeightRatio=Ae(A.billboardHeightRatio,2.4),this._prefix=Ae(A.prefix,""),this._scaleByDistance=Ae(A.scaleByDistance,new To(1500,3,15e3,.1)),this._topFillColor=Ae(A.topFillColor,At.fromCssColorString("#323232")),this._circleEntity=void 0,this._cylinderEntity=void 0,this._billboardEntity=void 0,this._position=ee.fromDegrees(this._lon,this._lat,this._height),this._show&&this.addToMap()}var RN=new ee;Sse.prototype.addToMap=function(){let o=this;if(O(o._circleEntity)||(o._circleEntity=o._earthCtrl.entities.add({position:o._position,ellipse:{height:o._height,semiMinorAxis:o._radius,semiMajorAxis:o._radius,material:new Z8({duration:o._duration,gradient:o._gradient,color:o._color,count:o._count})}})),!O(o._cylinderEntity)){RN=ee.clone(o._position,RN);let A=o._statistics*o._scale,f=Vn.eastNorthUpToFixedFrame(RN),m=new ee(0,0,A/2);Xe.multiplyByPoint(f,m,RN),o._cylinderEntity=o._earthCtrl.entities.add({position:RN,cylinder:{length:A,topRadius:o._radius/10,bottomRadius:o._radius/10,fill:!0,outline:!1,material:o._color}})}if(!O(o._billboardEntity)){RN=ee.clone(o._position,RN);let A=o._cylinderEntity.cylinder.length._value,f=Kt.fromCartesian(RN),m=ee.fromRadians(f.longitude,f.latitude,f.height+A);o._billboardEntity=o._earthCtrl.entities.add({position:m,billboard:{scaleByDistance:o._scaleByDistance,verticalOrigin:bn.BOTTOM,width:o._radius/o._billboardWidthRatio,height:o._radius/o._billboardHeightRatio,image:vLi(o._color,o._topFillColor,o._prefix+o._statistics,o._radius).toDataURL()}})}};Sse.prototype.removeFromMap=function(){O(this._cylinderEntity)&&(this._earthCtrl.entities.remove(this._cylinderEntity),this._cylinderEntity=void 0),O(this._circleEntity)&&(this._earthCtrl.entities.remove(this._circleEntity),this._circleEntity=void 0),O(this._billboardEntity)&&(this._earthCtrl.entities.remove(this._billboardEntity),this._billboardEntity=void 0)};function yLi(o,A,f,m){o.save(),o.strokeStyle="rgba(0,0,0,0)",o.scale(m/150,m/100),o.save(),o.fillStyle=A.toCssColorString(),o.lineWidth=4,o.beginPath(),o.moveTo(77.8,82.1),o.lineTo(64.6,69),o.lineTo(23.8,69),o.bezierCurveTo(20.8,69,18.3,66.5,18.3,63.5),o.lineTo(18.3,22.5),o.bezierCurveTo(18.3,19.5,20.8,17,23.8,17),o.lineTo(131.8,17),o.bezierCurveTo(134.8,17,137.3,19.5,137.3,22.5),o.lineTo(137.3,63.5),o.bezierCurveTo(137.3,66.5,134.8,69,131.8,69),o.lineTo(90.9,69),o.lineTo(77.8,82.1),o.closePath(),o.moveTo(23.8,18),o.bezierCurveTo(21.3,18,19.3,20,19.3,22.5),o.lineTo(19.3,63.5),o.bezierCurveTo(19.3,66,21.3,68,23.8,68),o.lineTo(65,68),o.lineTo(77.7,80.7),o.lineTo(90.5,68),o.lineTo(131.8,68),o.bezierCurveTo(134.3,68,136.3,66,136.3,63.5),o.lineTo(136.3,22.5),o.bezierCurveTo(136.3,20,134.3,18,131.8,18),o.lineTo(23.8,18),o.closePath(),o.fill(),o.stroke(),o.restore(),o.save(),o.fillStyle=f.toCssColorString(),o.beginPath(),o.moveTo(131.8,18),o.lineTo(23.80000000000001,18),o.bezierCurveTo(21.30000000000001,18,19.30000000000001,20,19.30000000000001,22.5),o.lineTo(19.30000000000001,63.5),o.bezierCurveTo(19.30000000000001,66,21.30000000000001,68,23.80000000000001,68),o.lineTo(65,68),o.lineTo(77.7,80.7),o.lineTo(90.5,68),o.lineTo(131.8,68),o.bezierCurveTo(134.3,68,136.3,66,136.3,63.5),o.lineTo(136.3,22.5),o.bezierCurveTo(136.3,20,134.2,18,131.8,18),o.closePath(),o.fill(),o.stroke(),o.restore(),o.restore()}function xLi(o,A,f){let m=f/1.4,C=m,y=m;A.width>A.height?y=m*(A.height/A.width):A.width<A.height&&(C=m*(A.width/A.height));let x=f/150*8,v=Math.round((f-C+x)/2),E=Math.round((5/6*f-y)/2);o.drawImage(A,v,E,C,y)}function vLi(o,A,f,m){let C=document.createElement("canvas");C.width=m,C.height=m;let y=C.getContext("2d");yLi(y,o,A,m);let x=m,v=N5(f,{font:`bold ${x}pt Microsoft YaHei`,fillColor:o});return xLi(y,v,x),C}Object.defineProperties(Sse.prototype,{billboard:{get:function(){return this._billboardEntity}},cylinder:{get:function(){return this._cylinderEntity}},circle:{get:function(){return this._circleEntity}},show:{get:function(){return this._show},set:function(o){O(this._billboardEntity)&&(this._billboardEntity.show=o),O(this._cylinderEntity)&&(this._cylinderEntity.show=o),O(this._circleEntity)&&(this._circleEntity.show=o)}}});var IAt=Sse;function lMe(o,A){if(this._earthCtrl=o,this._scene=o.coreMap.scene,this._options=Ae(A,Ae.EMPTY_OBJECT),this._color=Ae(A.color,At.RED),this._lon=Ae(A.lon,121),this._lat=Ae(A.lat,31),this._height=Ae(A.height,0),this._show=Ae(A.show,!0),this._containerWidth=Ae(A.containerWidth,200),this._containerHeight=Ae(A.containerHeight,200),this._containerColor=Ae(A.cylinderColor,At.YELLOWGREEN),this._canvasZoom=Ae(A.canvasZoom,10),this._scaleByDistance=Ae(A.scaleByDistance,new To(1500,3,15e3,.1)),this._tipsHtml=A.tipsHtml,this._tipsEntity=void 0,this._tipsDiv=document.createElement("div"),this._tipsDiv.style.opacity="0.7",this._tipsDiv.style.margin="0",this._tipsDiv.style.padding="0",this._tipsDiv.id=Ae(A.id,Vu()),this._tipsDiv.innerHTML=this._tipsHtml,!O(A.tipsHtml))throw new Ui("tipsHtml is required.");this.addToMap()}lMe.prototype.removeFromMap=function(){O(this._tipsEntity)&&(this._earthCtrl.entities.remove(this._tipsEntity),this._tipsEntity=void 0),O(this._tipsDiv)&&(this._earthCtrl.entities.remove(this._tipsDiv),this._tipsDiv=void 0)};lMe.prototype.addToMap=function(){let o=this,A=ee.fromDegrees(o._lon,o._lat,o._height);if(!O(o._tipsEntity)){let m=o._containerHeight,C=o._containerWidth,y=o._canvasZoom,x=o._tipsDiv,v=document.createElement("canvas");v.width=C,v.height=m,lH.drawDocument(x,v,{zoom:y}).then(function(E){o._tipsEntity=o._earthCtrl.entities.add({position:new Bn(f,!1),billboard:{scaleByDistance:o._scaleByDistance,verticalOrigin:bn.BOTTOM,width:C,height:m,image:E.image.src}})},function(E){console.info(E)})}function f(){return A}};var _At=lMe;function WO(o,A){this._earthCtrl=o,this._scene=o.coreMap.scene,this._options=Ae(A,Ae.EMPTY_OBJECT),this.element=document.createElement("div"),this._html=Ae(A.html,""),this._lon=Ae(A.lon,121),this._lat=Ae(A.lat,31),this._height=Ae(A.height,10),this._show=Ae(A.show,!0),this._removeHandler=void 0,this._pos=void 0,this._position=void 0,this._c=void 0,this._changedC=void 0,this._point=void 0,this._parameter=A,this._rtti="GwScreenDialog",this.isInit=!1,this.isInit===!1&&this.addToMap()}WO.prototype.setHtml=function(o){this.element.innerHTML=o};WO.prototype.setShow=function(o){if(!this.isInit)return 0;this.element.style.display=o?"block":"none"};WO.prototype.showAt=function(){if(!this.isInit)return 0;this._position&&(this._pos=Ss.wgs84ToWindowCoordinates(this._scene,this._position),this._pos&&(this.element.style.left=`${this._pos.x}px`,this.element.style.top=`${this._pos.y}px`))};WO.prototype.removeFromMap=function(){this.element.remove(),this.isInit=!1};WO.prototype.addToMap=function(){if(this.isInit)return 0;nA(".map-widget",this.element),this.element.innerHTML=this._html,this.element.style.position="absolute",this.isInit=!0,this._position=ee.fromDegrees(this._lon,this._lat,this._height),this.showAt(),this._c=new It(this._pos.x,this._pos.y);let o=this;this._scene.camera.moveStart.addEventListener(function(){o._removeHandler=o._scene.postRender.addEventListener(function(){if(o._c){let A=new L5(Di.WGS84,o._earthCtrl.camera._camera.position);A&&o._position&&(A.isPointVisible(o._position)===!1?o.setShow(!1):(o._show===!0&&o.setShow(!0),o._changedC=Ss.wgs84ToWindowCoordinates(o._scene,o._position),o._changedC?(o._c=o._changedC,o.showAt()):o.setShow(!1)))}})}),this._scene.camera.moveEnd.addEventListener(function(){o._removeHandler&&o._removeHandler.call()})};Object.defineProperties(WO.prototype,{show:{get:function(){return this._show},set:function(o){this._show!==o&&(this._show=o,this.setShow(o))}},html:{get:function(){return this._html},set:function(o){this._html!==o&&(this._html=o,this.setHtml(o))}},lon:{get:function(){return this._lon},set:function(o){this._lon!==o&&(this._lon=o,this._position=ee.fromDegrees(this._lon,this._lat,this._height),this.showAt())}},lat:{get:function(){return this._lat},set:function(o){this._lat!==o&&(this._lat=o,this._position=ee.fromDegrees(this._lon,this._lat,this._height),this.showAt())}},height:{get:function(){return this._height},set:function(o){this._height!==o&&(this._height=o,this._position=ee.fromDegrees(this._lon,this._lat,this._height),this.showAt())}}});var BAt=WO;function kW(o){this._earthCtrl=o,this._coreMap=o.coreMap}kW.prototype.createStatisticFlag=function(o){return new EAt(this._earthCtrl,o)};kW.prototype.createStatisticCylinder=function(o){return new IAt(this._earthCtrl,o)};kW.prototype.createTipsContainer=function(o){return new _At(this._earthCtrl,o)};kW.prototype.createScreenDialog=function(o){return new BAt(this._earthCtrl,o)};var wAt=kW;function Dse(){var o=["getKeyRecoveryParam","curveType","Input not Buffer","map","_ipad","b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef","setAutoPadding","rejected",'{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}',"dir","transform","ERR_UNKNOWN_ENCODING","mulf","Apr","_verify2","tmp","EncoderBuffer","password","raw","isBoxedPrimitive","onRuntimeInitialized","seqof","addn","sqlite3_bind_double","sum32_5","000000000000000000","bufferedRequest","non-byte EncoderBuffer value","set","ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","_countBits","assign","publicKey","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758","privateExponent","fired","root","isString","invalid sig","WeakMap","modulus must be greater than 1","_sqlite3_result_int64","-e4437ed6010e88286f547fa90abfe4c3","onend","modelDbModelIdList","The argument '","5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b","save","arrayBufferBlockCount","sum64_5_hi","notStrictEqual","sqlite3_column_blob","entry","c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","utf8","c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","readableListening","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865","/dev/stdin","clock","Password","codes","exitKey","a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","SetModelStoreyTransform","fromRed works only with numbers in reduction context","callbackify","e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","worldDirection","494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","byteLength","spread","kdeparams","canvas","7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","_final","not ","createDecipher","chdir","6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c","[object HTMLCollection]","_sqlite3_changes","dataStoreArrayBuffer","Trace","shim","isArgumentsObject","'name' must be a string","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58","isBuf","falling back to ArrayBuffer instantiation","Index out of range","call","[object Object]","emitter","tagged","rsa",'Failed to peek tag: "',"content","Attempt to access memory outside buffer bounds","eject","ERR_FR_TOO_MANY_REDIRECTS","exists","da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","pipe","String","boolean","Rand","_decodeTag","getHighWaterMark","3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","ERR_BUFFER_OUT_OF_BOUNDS","getCiphers","callee","2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06","serialNumber","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc","tinv","ineg","bool","0x8000000000000000","%Object.getOwnPropertyDescriptor%","00000000000000000","sync","maj32",". Build with -s ASSERTIONS=1 for more info.","0x7fffffffffffffff","search","iterator","readInt16LE","0000000000000","ECONNABORTED","join32","d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","imuln","zeroBits","acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","mtime","setRequestHeader","Instance","9333177ztxjEH","imul","worldUp","\x1B[31m"," [Function","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3","utils","toNumber","Number","heartbeat","ended","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375","isNull","stream","ixor","_importPublic","da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","outSize","path=","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589","hmacStrength","trying to set auth tag in unsupported state","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d","fillLast",'"buf" argument must be a Buffer or Uint8Array',"Jul","fromSecret","ETIMEDOUT","content-length","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e","notStrictEqualObject","aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","746590PyDowD","subjectPrivateKey","emitClose","writing","_secret","___errno_location"," ** ","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8","Number is too big","Function","_decode"," and <= ","4446261rhToce","RDNSequence","shift","numstr","oneC","Cancel","readingMore","BasePoint","52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","simpleSieve","getDivisor","charstr","a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","_events","SaveShell","Premature close","/dev/shm","176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ms exceeded","_sqlite3_open",'" argument must be of type number. Received type ',"recoveryParam","HEAP32","00000000000000000000000","onlyShowShells","persEnc","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8","revBin","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573","config","des-ede3","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e","allowHalfOpen","Not implemented yet","copy","computeSecret","Cipher","d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","handlers","Digest already called",`
`}Object.defineProperties(oAt.prototype,{parameter:{get:function(){return this._parameter}},show:{get:function(){return this._pps!==null},set:function(o){o?aLi(this):sLi(this)}},maxHeight:{get:function(){return this._maxHeight},set:function(o){this._maxHeight=o}},minHeight:{get:function(){return this._minHeight},set:function(o){this._minHeight=o}}});var zO=oAt;function xy(o,A){this._earthCtrl=o,this._coreMap=o.coreMap,this._minHeight=Ae(A.minHeight,0),this._maxHeight=Ae(A.maxHeight,0),this._extrudedHeight=Ae(A.extrudedHeight,0),this.shapeTool=void 0,this._speed=Ae(A.speed,1),this._baseWaterColor=Ae(A.baseWaterColor,new At(.2,.3,.6,.5)),this._waterFrequency=Ae(A.waterFrequency,1e3),this._animationSpeed=Ae(A.animationSpeed,.01),this._amplitude=Ae(A.amplitude,10),this._isPolygon=Ae(A.isPolygon,!0),this.eventHelper=new Mx,this._nowHeight=null,this._height=Ae(A.height,void 0),this._type=Ae(A.type,"up")}xy.prototype.drawPolygon=function(o){let A=this;this.shapeTool=A._earthCtrl.shapeTool.createDrawShapeTool(function(f){A.setPolygon({positions:f.result}),o&&o(A)})};xy.prototype.setPolygon=function(o){this.positions=o.positions;let A=this,f=A.computePolygonHeightRange(this.positions);A._minHeight=f.minHeight,A._maxHeight=f.maxHeight,A._extrudedHeight=A._minHeight};xy.prototype.computePolygonHeightRange=function(o){let A=[],f=this._earthCtrl.coreMap;for(let D=0;D<o.length;D++)A.push(o[D].clone());let m,C,y,x,v,E,I,w=0,Q=9999,M=Math.PI/Math.pow(2,11)/64,B=new rh.fromPositions({positions:A,vertexFormat:za.FLAT_VERTEX_FORMAT,granularity:M}),T=new rh.createGeometry(B);for(let D=0;D<T.indices.length;D+=3)m=T.indices[D],C=T.indices[D+1],y=T.indices[D+2],I=new ee(T.attributes.position.values[3*m],T.attributes.position.values[3*m+1],T.attributes.position.values[3*m+2]),(x=f.scene.globe.getHeight(Kt.fromCartesian(I)))<Q&&(Q=x),w<x&&(w=x),I=new ee(T.attributes.position.values[3*C],T.attributes.position.values[3*C+1],T.attributes.position.values[3*C+2]),(v=f.scene.globe.getHeight(Kt.fromCartesian(I)))<Q&&(Q=v),w<v&&(w=v),I=new ee(T.attributes.position.values[3*y],T.attributes.position.values[3*y+1],T.attributes.position.values[3*y+2]),(E=f.scene.globe.getHeight(Kt.fromCartesian(I)))<Q&&(Q=E),w<E&&(w=E);return{maxHeight:w,minHeight:Q}};xy.prototype.removeFromMap=function(){this._isPolygon?O(this.primitive)&&(this.removePrimitive(),this._extrudedHeight=this.minHeight,this.primitive=null):O(this.flood)&&(this.flood.show=!1),this.eventHelper&&this.eventHelper.removeAll(),this.shapeTool&&this.shapeTool.removeFromMap()};xy.prototype._onTick=function(){let o=this;o._type==="up"?o._extrudedHeight>=o._maxHeight?(o._extrudedHeight=o._maxHeight,o._nowHeight=o._extrudedHeight,o.eventHelper.removeAll()):(o._isPolygon?o.removePrimitive():O(o.flood)||(o.flood=new zO(o._earthCtrl,{minHeight:o.minHeight,maxHeight:o._extrudedHeight,positions:o.positions}),o.flood.show=!0),o._extrudedHeight+=o._speed,o._isPolygon?o.addPrimitive():o.flood.maxHeight=o._extrudedHeight):o._type==="down"&&(o._extrudedHeight<=o._minHeight?(o._extrudedHeight=o._minHeight,o._nowHeight=o._extrudedHeight,o.eventHelper.removeAll()):(o._isPolygon?o.removePrimitive():O(o.flood)||(o.flood=new zO(o._earthCtrl,{minHeight:o.minHeight,maxHeight:o._extrudedHeight,positions:o.positions}),o.flood.show=!0),o._extrudedHeight-=o._speed,o._isPolygon?o.addPrimitive():o.flood.maxHeight=o._extrudedHeight))};xy.prototype._onTickNext=function(){let o=this;o._nowHeight?o._type==="up"?o._extrudedHeight>=o._nowHeight+o._height?(o._extrudedHeight=o._nowHeight+o._height,o._nowHeight=o._extrudedHeight,o.eventHelper.removeAll()):(o._isPolygon?o.removePrimitive():O(o.flood)||(o.flood=new zO(o._earthCtrl,{minHeight:o.minHeight,maxHeight:o._extrudedHeight,positions:o.positions}),o.flood.show=!0),o._extrudedHeight+=o._speed,o._isPolygon?o.addPrimitive():o.flood.maxHeight=o._extrudedHeight):o._type==="down"&&(o._extrudedHeight<=o._nowHeight-o._height?(o._extrudedHeight=o._nowHeight-o._height,o._nowHeight=o._extrudedHeight,o.eventHelper.removeAll()):(o._isPolygon?o.removePrimitive():O(o.flood)||(o.flood=new zO(o._earthCtrl,{minHeight:o.minHeight,maxHeight:o._extrudedHeight,positions:o.positions}),o.flood.show=!0),o._extrudedHeight-=o._speed,o._isPolygon?o.addPrimitive():o.flood.maxHeight=o._extrudedHeight)):o._type==="up"?o._extrudedHeight>=o._minHeight+o._height?(o._extrudedHeight=o._minHeight+o._height,o._nowHeight=o._extrudedHeight,o.eventHelper.removeAll()):(o._isPolygon?o.removePrimitive():O(o.flood)||(o.flood=new zO(o._earthCtrl,{minHeight:o.minHeight,maxHeight:o._extrudedHeight,positions:o.positions}),o.flood.show=!0),o._extrudedHeight+=o._speed,o._isPolygon?o.addPrimitive():o.flood.maxHeight=o._extrudedHeight):o._type==="down"&&(o._extrudedHeight<=o._maxHeight-o._height?(o._extrudedHeight=o._maxHeight-o._height,o._nowHeight=o._extrudedHeight,o.eventHelper.removeAll()):(o._isPolygon?o.removePrimitive():O(o.flood)||(o.flood=new zO(o._earthCtrl,{minHeight:o.minHeight,maxHeight:o._extrudedHeight,positions:o.positions}),o.flood.show=!0),o._extrudedHeight-=o._speed,o._isPolygon?o.addPrimitive():o.flood.maxHeight=o._extrudedHeight))};xy.prototype.removePrimitive=function(){O(this.primitive)&&this._earthCtrl.primitives.remove(this.primitive)};xy.prototype.polygonAnalysis=function(){let o=this;O(o.shapeTool)&&(o.shapeTool.removeFromMap(),o.shapeTool=void 0),o._height?o.eventHelper.add(o._earthCtrl.coreMap.clock.onTick,xy.prototype._onTickNext,this):o.eventHelper.add(o._earthCtrl.coreMap.clock.onTick,xy.prototype._onTick,this);let A={};A.normalMap=`${globalThis.GEOWORLD_BASE_URL}Assets/Images/waterNormals.jpg`,A.baseWaterColor=o.baseWaterColor,A.frequency=o.waterFrequency,A.animationSpeed=o.animationSpeed,A.amplitude=o.amplitude;let f=new ss({fabric:{type:"Water",uniforms:A}});f.update(o._earthCtrl.coreMap.scene.context),o.primitiveAppearance=new DY({material:f,fragmentShaderSource:TY})};xy.prototype.postAnalysis=function(){let o=this;O(o.shapeTool)&&(o.shapeTool.removeFromMap(),o.shapeTool=void 0),o._height?o.eventHelper.add(o._earthCtrl.coreMap.clock.onTick,xy.prototype._onTickNext,this):o.eventHelper.add(o._earthCtrl.coreMap.clock.onTick,xy.prototype._onTick,this)};xy.prototype.addPrimitive=function(){let o=this;o.primitive=o._earthCtrl.primitives.add(new Za({geometryInstances:new co({geometry:rh.fromPositions({positions:o.positions,extrudedHeight:o._extrudedHeight})}),asynchronous:!1,appearance:o.primitiveAppearance}))};xy.prototype.startAnalysis=function(){let o=this;setTimeout(()=>{o._isPolygon?o.polygonAnalysis():o.postAnalysis()},100)};Object.defineProperties(xy.prototype,{isPolygon:{get:function(){return this._isPolygon}},minHeight:{set:function(o){this._minHeight=o},get:function(){return this._minHeight}},maxHeight:{set:function(o){this._maxHeight=o},get:function(){return this._maxHeight}},speed:{set:function(o){this._speed=o},get:function(){return this._speed}},baseWaterColor:{set:function(o){this._baseWaterColor=o},get:function(){return this._baseWaterColor}},waterFrequency:{set:function(o){this._waterFrequency=o},get:function(){return this._waterFrequency}},animationSpeed:{set:function(o){this._animationSpeed=o},get:function(){return this._animationSpeed}},amplitude:{set:function(o){this._amplitude=o},get:function(){return this._amplitude}},height:{set:function(o){this._height=o,this.postAnalysis()},get:function(){return this._height}},type:{set:function(o){this._type=o},get:function(){return this._type}}});var YTe=xy;function KO(o,A){this._earthCtrl=o,this._coreMap=o.coreMap,this.shapeTool=void 0,this.positions=void 0,this.echarts=void 0,this.mCallback=Ae(A.callback,void 0),this.defaultChart=Ae(A.defaultChart,!0),this.step=Ae(A.step,20),this.image=A.image,this.echarstView=A.echartsView,this.echartsParentView=A.echartsParentView,this.billboard=void 0,this.minHeight=0,this.maxHeight=0,this.profile={arrHB:[],arrPoint:[],arrLX:[],points:[],distance:0}}KO.prototype.drawPolyLine=function(){let o=this;this.shapeTool=o._earthCtrl.shapeTool.createDrawShapeTool(function(A){o.setPolyline({positions:A.result})},"polyline")};KO.prototype.setPolyline=function(o){this.positions=o.positions};KO.prototype.startAnalysis=function(){if(!this.positions)return console.info("\u8BF7\u5148\u7ED8\u5236\u5256\u9762\u7EBF\uFF01");if(this.positions.length>1){this.profile.arrLX.push(0);for(let A=0;A<this.positions.length-1;A++){let f=this.positions[A],m=this.positions[A+1];this.profile2PointAnalysis(f,m)}this.processHeight();let o=this.profile;this.defaultChart&&cLi(this,o),O(this.mCallback)&&this.mCallback(o),this.positions=void 0}};KO.prototype.processHeight=function(){let o=this;if(!(o.profile.arrHB.length<=0)){o.minHeight=o.maxHeight=o.profile.arrHB[0];for(let A=1;A<o.profile.arrHB.length;A++){let f=o.profile.arrHB[A];f>o.maxHeight?o.maxHeight=f:f<o.minHeight&&(o.minHeight=f)}o.minHeight=parseInt(o.minHeight/100)*100;for(let A=0;A<o.profile.arrHB.length;A++){let f=o.profile.arrHB[A];o.profile.arrHB[A]=f-o.minHeight}}};var uLi=new ee;KO.prototype.profile2PointAnalysis=function(o,A){let f=this,m=ee.distance(o,A),C=parseInt(m/f.step),y=Kt.fromCartesian(o),x=Kt.fromCartesian(A);f.positions.length>2&&f.profile.arrLX.length>1&&f.profile.arrLX.push(f.profile.arrLX[f.profile.arrLX.length-1]+WTe(f.profile.points[f.profile.points.length-1],y)),f.profile.points.push(y),f.profile.arrPoint.push(JTe(o)),f.profile.arrHB.push(y.height);let v=f.profile.arrLX.length-1;console.info(v);for(let E=1;E<C;E++){let I=ee.lerp(o,A,E/C,uLi),w=Kt.fromCartesian(I),Q=f._coreMap.scene.globe.getHeight(w);w.height=Q;let M=WTe(f.profile.points[v+E-1],w);f.profile.distance=f.profile.distance+M,f.profile.points.push(w),f.profile.arrLX.push(f.profile.arrLX[v+E-1]+M),f.profile.arrPoint.push(JTe(I)),f.profile.arrHB.push(Q)}return f.profile.points.push(x),f.profile.arrLX.push(f.profile.arrLX[f.profile.arrLX.length-1]+WTe(f.profile.points[f.profile.points.length-1],x)),f.profile.arrPoint.push(JTe(A)),f.profile.arrHB.push(x.height),f.profile};function uAt(o,A){let f=document.getElementById(o);f.style.display=A?"block":"none"}var aAt;function cLi(o,A){if(A!==null&&A.arrPoint!==null){uAt(o.echartsParentView,!0),O(o.echarts)||(o.echarts=kb.init(document.getElementById(o.echarstView),"dark"));let f=A.arrPoint,m={grid:{left:10,right:10,bottom:10,containLabel:!0},dataZoom:[{type:"inside",throttle:50}],tooltip:{trigger:"axis",formatter:function(C){let y="";if(C.length===0)return y;let x=f[C[0].dataIndex],v=C[0].value+o.minHeight;return aAt=new ee.fromDegrees(x.x,x.y,v),O(o.billboard)||(o.billboard=o._earthCtrl.entities.add({name:"profile_billboard",position:new Bn(function(){return aAt},!1),billboard:{verticalOrigin:bn.BOTTOM,image:o.image,iconWidth:8,iconHeight:8,scale:.5}})),o.billboard.show||(o.billboard.show=!0),y+=`\u6240\u5728\u4F4D\u7F6E&nbsp;${lAt(x.x)},${lAt(x.y)}<br />\u8DDD\u8D77\u70B9&nbsp;<label>${sAt(C[0].axisValue)}</label><br />${C[0].seriesName}&nbsp;<label style='color:${C[0].color};'>${sAt(v)}</label><br />`}},xAxis:[{name:"\u884C\u7A0B",type:"category",boundaryGap:!1,axisLine:{show:!1},axisLabel:{show:!1},data:A.arrLX}],yAxis:[{type:"value",axisLabel:{formatter:function(C){return`${C+o.minHeight}\u7C73`}}}],series:[{name:"\u9AD8\u7A0B\u503C",type:"line",smooth:!0,symbol:"none",sampling:"average",itemStyle:{normal:{color:"rgb(255, 70, 131)"}},areaStyle:{normal:{color:new kb.graphic.LinearGradient(0,0,0,1,[{offset:0,color:"rgb(255, 158, 68)"},{offset:1,color:"rgb(255, 70, 131)"}])}},data:A.arrHB}]};o.echarts.setOption(m)}}function sAt(o,A){if(o===null)return"";o=Number(o),(A===null||A==="auto")&&(o<1e3?A="m":A="km");let f="";switch(A){default:case"m":f=`${o.toFixed(2)}\u7C73`;break;case"km":f=`${(o*.001).toFixed(2)}\u516C\u91CC`;break;case"mile":f=`${(o*54e-5).toFixed(2)}\u6D77\u91CC`;break;case"zhang":f=`${(o*.3).toFixed(2)}\u4E08`;break}return f}function lAt(o){let A=o.toString();return A.slice(0,A.indexOf(".")+3)}function JTe(o){let A=Kt.fromCartesian(o),f=je.toDegrees(A.longitude),m=je.toDegrees(A.latitude),C=A.height;return{x:f,y:m,z:C}}function WTe(o,A){let f=new l0;f.setEndPoints(o,A);let m=f.surfaceDistance;return m=Math.sqrt(Math.pow(m,2)+Math.pow(A.height-o.height,2)),m}KO.prototype.removeFromMap=function(){let o=this;O(o.shapeTool)&&(o.shapeTool.removeFromMap(),o.shapeTool=void 0),O(o.billboard)&&(o._earthCtrl.entities.remove(o.billboard),o.billboard=void 0),uAt(o.echartsParentView,!1)};var jTe=KO;function Ise(o,A){this._earthCtrl=o,this._coreMap=o.coreMap,this._skylineColor=Ae(A.color,At.RED.withAlpha(1)),this._postProccessStage=null,this._postProcessStages=this._coreMap.scene.postProcessStages,this._width=Ae(A.width,1),this._edgeDetection=bv.createEdgeDetectionStage({width:this._width||1}),this.addToMap()}Ise.prototype.addToMap=function(){this.removeFromMap();let o=new va({name:"czm_skylinetemp",fragmentShader:"uniform sampler2D colorTexture;uniform sampler2D depthTexture;varying vec2 v_textureCoordinates;void main(void){float depth = czm_readDepth(depthTexture, v_textureCoordinates);vec4 color = texture2D(colorTexture, v_textureCoordinates);if(depth<1.0 - 0.000001){gl_FragColor = color;}else{gl_FragColor = vec4(1.0,0.0,0.0,1.0);}}"}),A=new va({name:"czm_skylinetemp1",fragmentShader:"uniform sampler2D colorTexture;uniform sampler2D redTexture;uniform sampler2D silhouetteTexture;uniform vec4 skylineColor;varying vec2 v_textureCoordinates;void main(void){vec4 redcolor=texture2D(redTexture, v_textureCoordinates);vec4 silhouetteColor = texture2D(silhouetteTexture, v_textureCoordinates);vec4 color = texture2D(colorTexture, v_textureCoordinates);if(redcolor.r == 1.0){gl_FragColor = mix(color, skylineColor, silhouetteColor.a);}else{gl_FragColor = color;}}",uniforms:{redTexture:o.name,silhouetteTexture:this._edgeDetection.name,skylineColor:this._skylineColor}});this._postProccessStage=new CC({name:"czm_skyline",stages:[this._edgeDetection,o,A],inputPreviousStageTexture:!1,uniforms:this._edgeDetection.uniforms}),this._postProcessStages.add(this._postProccessStage)};Ise.prototype.removeFromMap=function(){this._postProccessStage&&(this._earthCtrl.coreMap.scene.postProcessStages.remove(this._postProccessStage),this._postProccessStage=null)};Object.defineProperties(Ise.prototype,{});var qTe=Ise;function _se(o,A){this._earthCtrl=o,this._coreMap=o.coreMap,this.leftIndex=void 0,this.rightIndex=void 0,this.addToMap(A.leftIndex,A.rightIndex)}var YO={dragStartX:0,_scene:void 0};_se.prototype.addToMap=function(o,A){document.getElementById("slider")&&this.clear();let m=this._coreMap.imageryLayers,C=this._coreMap.scene;YO._scene=C;let y=this._coreMap.container,x=document.createElement("div");x.id="slider",x.style.position="absolute",x.style.cursor="e-resize",x.style.top=0,x.style.backgroundColor="#D3D3D3",x.style.width="8px",x.style.height="100%",x.style.zIndex="1000",y.appendChild(x);let v=m.get(o),E=m.get(A);this.leftIndex=o,this.rightIndex=A,v.splitDirection=uI.LEFT,E.splitDirection=uI.RIGHT;let I=document.getElementById("slider");C.splitPosition=I.offsetLeft/I.parentElement.offsetWidth,I.addEventListener("mousedown",AAt,!1),window.addEventListener("mouseup",cAt,!1),I.style.left="50%",YO._scene.splitPosition=.5};function cAt(){window.removeEventListener("mousemove",XTe,!1)}function AAt(o){let A=document.getElementById("slider");YO.dragStartX=o.clientX-A.offsetLeft,window.addEventListener("mousemove",XTe,!1)}function XTe(o){let A=document.getElementById("slider"),f=(o.clientX-YO.dragStartX)/A.parentElement.offsetWidth;A.style.left=`${100*f}%`,YO._scene.splitPosition=f}_se.prototype.removeFromMap=function(){let o=document.getElementById("slider");if(o){YO._scene.splitPosition="0%",o.removeEventListener("mousedown",AAt,!1),window.removeEventListener("mouseup",cAt,!1),window.removeEventListener("mousemove",XTe,!1),o.remove();let A=this._coreMap.imageryLayers,f=A.get(this.leftIndex),m=A.get(this.rightIndex);f.splitDirection=uI.NONE,m.splitDirection=uI.NONE,YO._scene=void 0}};Object.defineProperties(_se.prototype,{});var hAt=_se;function NW(o,A){this._earthCtrl=o,this._coreMap=o.coreMap,this.color=Ae(A.color,At.RED.withAlpha(.5)),this.positions=A.positions,this.baseHeight=Ae(A.baseHeight,0),this._height=Ae(A.height,0),this.extrudedHeight=Ae(A.extrudedHeight,1e4),this.limitHeightPrimitive=null,this.addToMap()}NW.prototype.addToMap=function(){if(this.removeFromMap(),!this.positions)return;let o=ee.fromDegreesArray(this.positions),A=new co({geometry:new rh({polygonHierarchy:new Un(o),height:this.baseHeight,extrudedHeight:this.baseHeight+this.extrudedHeight}),attributes:{color:Yo.fromColor(this.color)}});this.limitHeightPrimitive=this._coreMap.scene.primitives.add(new s6({geometryInstances:A,releaseGeometryInstances:!1,classificationType:Gu.CESIUM_3D_TILE}))};NW.prototype.changeHeight=function(o){!this.limitHeightPrimitive||(console.log("?!?!?!",this.limitHeightPrimitive),this.limitHeightPrimitive.readyPromise.then(A=>{let f=Kt.fromCartesian(this.limitHeightPrimitive._primitive._boundingSpheres[0].center);console.log("???",f);let m=ee.fromRadians(f.longitude,f.latitude,this.baseHeight),C=ee.fromRadians(f.longitude,f.latitude,this.baseHeight+o),y=ee.subtract(C,m,new ee);console.log("!!!!",this.limitHeightPrimitive._primitive.modelMatrix),this.limitHeightPrimitive._primitive.modelMatrix=Xe.setTranslation(Xe.IDENTITY,y,new Xe),this.baseHeight=this.baseHeight+o}))};NW.prototype.removeFromMap=function(){this.limitHeightPrimitive&&(this._coreMap.scene.primitives.remove(this.limitHeightPrimitive),this.limitHeightPrimitive=void 0)};Object.defineProperties(NW.prototype,{});var ZTe=NW;function dAt(o){this._earthCtrl=o}dAt.prototype.toDegrees=function(o){let A=Kt.fromCartesian(o);return{lon:je.toDegrees(A.longitude),lat:je.toDegrees(A.latitude),height:A.height}};var fAt=dAt;function JO(o){this._viewer=o.coreMap,this._trans=new fAt}JO.prototype.addClipping=function(o,A={}){if(this.remove(),A.type==="polygon"){let f=A.positions,m=[];f.forEach(v=>{m.push(this._trans.toDegrees(v))}),m.push(m[0]);let C;A.isInner?C=this.isClockWise(m):C=!this.isClockWise(m),C&&m.reverse();let y=[],x=this.getInverseTransform(o);for(let v=0;v<m.length-1;v++){let E=this.createPlane(m[v],m[v+1],x);y.push(E)}o.clippingPlanes=new rB({planes:y,unionClippingRegions:!A.isInner})}return this.item=o,this};JO.prototype.getInverseTransform=function(o){let A,f=o.root.transform;return f&&f.equals(Xe.IDENTITY)||!f?A=Vn.eastNorthUpToFixedFrame(o.boundingSphere.center):A=Xe.fromArray(o.root.transform),Xe.inverseTransformation(A,new Xe)};JO.prototype.getOriginCoordinateSystemPoint=function(o,A){let f=ee.fromDegrees(o.lon,o.lat);return Xe.multiplyByPoint(A,f,new ee(0,0,0))};JO.prototype.createPlane=function(o,A,f){let m=this.getOriginCoordinateSystemPoint(o,f),C=this.getOriginCoordinateSystemPoint(A,f),y=new ee(0,0,1),x=ee.subtract(C,m,new ee),v=ee.cross(x,y,new ee);v=ee.normalize(v,v);let E=Wa.fromPointNormal(m,v);return kM.fromPlane(E)};JO.prototype.isClockWise=function(o){if(o.length<3)return null;o[0]===o[o.length-1]&&(o=o.slice(0,o.length-1));let A={i:-1,val:90};for(let E=0;E<o.length;E++){let{lat:I}=o[E];I<A.val&&(A.val=I,A.i=E)}let f=(A.i+o.length-1)%o.length,m=A.i,C=(A.i+1)%o.length,y={lat:o[m].lat-o[f].lat,lon:o[m].lon-o[f].lon},x={lat:o[C].lat-o[m].lat,lon:o[C].lon-o[m].lon},v=x.lon*y.lat-y.lon*x.lat;return v===0?o[C].lon<o[f].lon:v>0};JO.prototype.remove=function(){this.item&&this.item.clippingPlanes&&this.item.clippingPlanes.removeAll(),this.item&&(this.item.clippingPlanes=void 0)};var $Te=JO;var eMe;function tMe(o,A){this._viewer=o.coreMap,eMe=o.coreMap,this.createTerrainModifier(A.name,A.polygon,A.altitude)}tMe.prototype.findDirectParent=function(o){try{let A=[];if(o.width===Math.PI)return null;for(let f=0;f<eMe.scene.globe._surface._tilesToRender.length;f++){let m=eMe.scene.globe._surface._tilesToRender[f],C=m._rectangle;Si.intersection(C,o)&&A.push(m)}return A}catch(A){console.log(A)}return null};tMe.prototype.createTerrainModifier=function(o,A,f){let m=A.length,C=new Array(m);C.fill(f);let y=Vu(),x=Date.now(),v=Si.fromCartesianArray(A),E=this.findDirectParent(v);this._viewer.terrainProvider&&this._viewer.terrainProvider._modifyTerrainObjects===void 0&&(this._viewer.terrainProvider._modifyTerrainObjects=[]);let I=this._viewer,w={id:y,name:o,show:!0,rectangle:v,vertices:A,heights:C,timeStamp:x,remove:function(){if(I.terrainProvider&&I.terrainProvider._modifyTerrainObjects)for(let Q=I.terrainProvider._modifyTerrainObjects.length-1;Q>=0;Q--)I.terrainProvider._modifyTerrainObjects[Q].id===y&&I.terrainProvider._modifyTerrainObjects.splice(Q,1);if(E)try{for(let Q=0;Q<E.length;Q++)try{E[Q]._parent.freeResources()}catch(M){console.log(M)}}catch(Q){console.log(Q)}}};if(this._viewer.terrainProvider._modifyTerrainObjects.push(w),E)try{for(let Q=0;Q<E.length;Q++)try{E[Q]._parent.freeResources()}catch(M){console.log(M)}}catch(Q){console.log(Q)}return w};var iMe=tMe;var KH;function rMe(o){this._earthCtrl=o,this.Viewer=o.coreMap,KH=o.coreMap}rMe.prototype.CreateTooltip=function(o={},A,f){let m,C,y,x,v;typeof o=="object"&&(m=o),m&&m.origin?(m.origin==="center"&&(C=15,y=-12),m.origin==="top"&&(C=15,y=-44),m.origin==="bottom"&&(C=15,y=20)):(C=15,y=20),m&&m.color?(m.color==="white"&&(x="background: rgba(255, 255, 255, 0.8);color: black;"),m.color==="black"&&(x="background: rgba(0, 0, 0, 0.5);color: white;"),m.color==="yellow"&&(x="color: black;background-color: #ffcc33;border: 1px solid white;")):x="background: rgba(0, 0, 0, 0.5);color: white;",m&&m.id?v=`toolTip${m.id}`:v="toolTip";let E=document.getElementById(v);if(!E){let I=document.createElement("div");nA(".map-widget",I);let w=`<div id="${v}" style="display: none;pointer-events: none;position: absolute;z-index: 1000;opacity: 0.8;border-radius: 4px;padding: 4px 8px;white-space: nowrap;font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px;${x}"></div>`;nA(".map-widget",w),E=document.getElementById(v)}return f?(E.innerHTML=o,E.style.left=`${A.x+C}px`,E.style.top=`${A.y+y}px`,E.style.display="block"):E.style.display="none",{tooltip:E,style:m,showAt:function(I,w){this.tooltip.innerHTML=w,this.style&&this.style.origin?(this.style.origin==="center"&&(C=15,y=-this.tooltip.offsetHeight/2),this.style.origin==="top"&&(C=15,y=-this.tooltip.offsetHeight-20),this.style.origin==="bottom"&&(C=15,y=20)):(C=15,y=-this.tooltip.offsetHeight/2),this.tooltip.style.left=`${I.x+C}px`,this.tooltip.style.top=`${I.y+y}px`,this.tooltip.style.display="block"},show:function(I){I?this.tooltip.style.display="block":this.tooltip.style.display="none"}}};rMe.prototype.CreateResultTooltip=function(o={}){let A,f,m,C=o.id?`resultToolTip${o.id}`:"resultToolTip",y=document.getElementById(C);if(o.color?(o.color==="white"&&(m="background: rgba(255, 255, 255, 0.8);color: black;"),o.color==="black"&&(m="background: rgba(0, 0, 0, 0.5);color: white;"),o.color==="blue"&&(m="background: rgba(48, 119, 221);color: white;"),o.color==="yellow"&&(m="color: black;background-color: #ffcc33;border: 1px solid white;")):m="color: black;background-color: #ffcc33;border: 1px solid white;",!y){let Q=`<div id="${C}" class="resultToolTip" style="display: none;pointer-events: none;position: absolute;z-index: 1000;opacity: 0.8;border-radius: 4px;padding: 4px 8px;white-space: nowrap;font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px;${m}"></div>`;nA(".map-widget",Q),y=document.getElementById(C)}let x=o.addX||0,v=o.addY||0,E,I=this;function w(){if(E){if(o.far!==void 0||o.near!==void 0){let M=I.getPointToCameraDistance(KH,E);if(M>o.far){y.style.display="none";return}else if(M<o.near){y.style.display="none";return}y.style.display="block"}let Q=KH.scene.cartesianToCanvasCoordinates(E);if(!Q)return;A=-y.offsetWidth/2+x,f=-y.offsetHeight+v,y.style.left=`${Q.x+A}px`,y.style.top=`${Q.y+f}px`}}return KH.clock.onTick.addEventListener(w),{tooltip:y,position:E,showAt:function(Q,M){if(this.tooltip.innerHTML=M,this.tooltip.style.display="block",this.position=Q,E=Q,E){let B=KH.scene.cartesianToCanvasCoordinates(E);if(!B)return;A=-this.tooltip.offsetWidth/2+x,f=-this.tooltip.offsetHeight+v,this.tooltip.style.left=`${B.x+A}px`,this.tooltip.style.top=`${B.y+f}px`}},show:function(Q){Q?(this.tooltip.style.display="block",E=this.position):(this.tooltip.style.display="none",E=void 0)},destroy(){KH.clock.onTick.removeEventListener(w),y.remove()}}};var pw=rMe;var nMe=class{constructor(){this.minHeight=Number.MAX_VALUE,this.maxHeight=Number.MIN_VALUE,this.cutVolume=0,this.fillVolume=0,this.baseArea=0}},oMe=class{constructor(){this.minHeight=Number.MAX_VALUE,this.maxHeight=Number.MIN_VALUE,this.avgHeight=0,this.baseArea=0}};function Bse(o,A){this._earthCtrl=o,this._viewer=o.coreMap,this.baseHeight=Ae(A.baseHeight,0),this.options=A}Bse.prototype.start=function(){let o=this.options.positions,A=this.options.countBase,f=this.options.basePositions,m=this.options.baseHeight,C=new nMe,y=[];o.forEach(Q=>{let M=Kt.fromCartesian(Q);this.baseHeight=Math.min(M.height,Ae(m,this.baseHeight)),y.push(Ss.wgs84ToWindowCoordinates(this._viewer.scene,Q))});let x=ALi(y),v=Zl.randomPoint(100,{bbox:[x[0],x[1],x[2],x[3]]}),E=hLi(y);Zl.voronoi(v,{bbox:[x[0],x[1],x[2],x[3]]}).features.forEach(Q=>{let M=dLi(E,Q.geometry);if(M.length>0){let B=this.computeCubeInfo(M);this.baseHeight>B.avgHeight?C.fillVolume+=(this.baseHeight-B.avgHeight)*C.baseArea:C.cutVolume+=(B.avgHeight-this.baseHeight)*C.baseArea,C.maxHeight=Math.max(C.maxHeight,B.maxHeight),C.minHeight=Math.min(C.minHeight,B.minHeight),C.baseArea+=B.baseArea}});let w=this.countBaseVolume(A,f,m);return w!==0&&(C.cutVolume+=w,C.fillVolume+=w),C};Bse.prototype.countBaseVolume=function(o,A,f){let m=this;if(o){let C=[],y=[];for(let Q=0;Q<A.length;Q=Q+3){y.push(A[Q+2]);let M=ee.fromDegrees(A[Q],A[Q+1],f),B=Kt.fromCartesian(M);C.push(B)}C.push(C[0]);let x=gAt(C);y.sort(function(Q,M){return Q-M});let v=y[0],E=y[y.length-1];return Number(E-v)*x/2}return 0};Bse.prototype.computeCubeInfo=function(o){let A=this,f=[],m=Number.MAX_VALUE,C=Number.MIN_VALUE,y=0;o.forEach(function(E){let I=A._earthCtrl.coreMap.scene.camera.getPickRay(E),w=A._earthCtrl.coreMap.scene.globe.pick(I,A._earthCtrl.coreMap.scene),Q=Kt.fromCartesian(w);f.push(Q),m=Math.min(m,Q.height),C=Math.max(C,Q.height),y+=Q.height});let x=y/o.length,v=new oMe;return v.minHeight=m,v.maxHeight=C,v.avgHeight=x,v.baseArea=gAt(f),v};function gAt(o){let A=[0],f=[0],m=new l0,C=Math.PI/180;for(let x=0;x<o.length-1;x++){let v=o[x],E=o[x+1];m.setEndPoints(v,E);let I=Math.sqrt(Math.pow(m.surfaceDistance,2)),w=E.latitude*C,Q=E.longitude*C,M=v.latitude*C,B=v.longitude*C,T=-Math.atan2(Math.sin(Q-B)*Math.cos(M),Math.cos(w)*Math.sin(M)-Math.sin(w)*Math.cos(M)*Math.cos(Q-B));T<0&&(T+=Math.PI*2),f.push(Math.sin(T)*I+f[x]),A.push(Math.cos(T)*I+A[x])}let y=0;for(let x=0;x<A.length-1;x++)y+=A[x]*f[x+1]-A[x+1]*f[x];return Math.abs(y+A[A.length-1]*f[0]-A[0]*f[f.length-1])/2}function ALi(o){let A=[],f=Number.MAX_VALUE,m=Number.MIN_VALUE,C=Number.MAX_VALUE,y=Number.MIN_VALUE;return o.forEach(x=>{f=Math.min(f,x.x),m=Math.max(m,x.x),C=Math.min(C,x.y),y=Math.max(y,x.y)}),A.push(f),A.push(C),A.push(m),A.push(y),A}function hLi(o){let A=[[]];return o.forEach(m=>{A[0].push([m.x,m.y])}),A[0].push([o[0].x,o[0].y]),Zl.polygon(A).geometry}function dLi(o,A){let f=Zl.intersect(o,A);return f?.geometry!==void 0?fLi(f?.geometry):[]}function fLi(o){let A=[];return o.coordinates.forEach(function(f){f.forEach(function(m){A.push(new It(m[0],m[1]))})}),A.push(new It(o.coordinates[0][0][0],o.coordinates[0][0][1])),A}var wse=Bse;function Gx(o,A){this._earthCtrl=o,this._viewer=o.coreMap,this._cesium=_r,this._scene=o.coreMap.scene,this._Tooltip=new pw(o),this.loadingImg=`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`,this.tooltip=this._Tooltip.CreateTooltip(),this.FlattenIsDraw=!1,this.wallArr=[],this.hierarchy=[],this.tophierarchy=[],this.heightsort=[],this.FlattenPolygon=[],this.deepth=100,this.polygon=null,this.editPoint=[],this.nowPoint=null,this.editPosition=[],this.topPositions=null,this._volumeLabel=void 0,this._volumeLabel1=void 0,this._option=Ae(A.option,{}),this._irregularCut=Ae(A.irregularCut,!1),this.terrainFlatten=new _N(o.coreMap.scene),this.CreatePolygon(A.height,A.option,A.callback)}Gx.prototype.CreatePolygon=function(o,A,f){if(this.FlattenIsDraw)return;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=null),this.removeLabel(),this.addLoading(),this.FlattenIsDraw=!0;let m=this._viewer,C=this._cesium;this.deepth=o||this.deepth,this.removeFromMap(),!A&&(A={});let y=[],x=this.hierarchy,v=this.polygon,E,I=null,w=0,Q=this.heightsort,M=this.deepth,B=this.wallArr,T=this;this.drawHandler=new C.ScreenSpaceEventHandler(m.scene.canvas),m.scene.globe.depthTestAgainstTerrain=!0;let D=this.tooltip,F;this._viewer.container.style.cursor=`url(${window.SmartEarthRootUrl} 'Workers/image/cursor/draw.cur')`,this.drawHandler.setInputAction(function(V){E=R(V.position);let H=C.Cartographic.fromCartesian(E),q=C.Math.toDegrees(H.longitude),ie=C.Math.toDegrees(H.latitude),Z=H.height;y.push(E),x.push(q,ie,H.height),T.tophierarchy.push(q,ie,Z),w===0?(y.push(E),x.push(q,ie,H.height),F=m.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new C.CallbackProperty(()=>y,!1),clampToGround:!0,material:new C.ColorMaterialProperty(C.Color.YELLOW.withAlpha(.3)),width:3}})):w===1&&(F&&m.entities.remove(F),v=m.entities.add({name:null,id:T._earthCtrl.factory.createUUID(),polygon:{hierarchy:new C.PolygonHierarchy(C.Cartesian3.fromDegreesArrayHeights(x)),material:C.Color.YELLOW.withAlpha(.3)}}),v.polygon.hierarchy=new C.CallbackProperty(L,!1)),w++},C.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(function(V){if(w===0){D.showAt(V.endPosition,"\u5DE6\u952E\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u70B9");return}else w===1?D.showAt(V.endPosition,"\u70B9\u51FB\u6DFB\u52A0\u7B2C\u4E8C\u4E2A\u70B9"):D.showAt(V.endPosition,"\u53F3\u952E\u7ED3\u675F\u7ED8\u5236");E=R(V.endPosition);let H=C.Cartographic.fromCartesian(E),q=C.Math.toDegrees(H.longitude),ie=C.Math.toDegrees(H.latitude);x.splice(x.length-3,3),y.splice(y.length-1,1),y.push(E),x.push(q,ie,H.height)},C.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(function(V){this.end&&this.end()}.bind(this),C.ScreenSpaceEventType.RIGHT_CLICK),this.end=V=>{if(D.show(!1),T._viewer.container.style.cursor="default",T.drawHandler.destroy(),F&&m.entities.remove(F),v&&m.entities.remove(v),this.FlattenIsDraw=!1,this.end=void 0,V==="cancel"||y.length<3)return;if(w<2){w=0;return}w=0;for(let se=2;se<x.length;se=se+3)Q.push(x[se]);Q.sort(function(se,ce){return se-ce}),v=m.entities.add({name:null,id:T._earthCtrl.factory.createUUID(),polygon:{hierarchy:new C.CallbackProperty(function(){return new C.PolygonHierarchy(C.Cartesian3.fromDegreesArrayHeights(x))},!1),material:new C.ImageMaterialProperty({image:C.defaultValue(A.bottomImgUrl,`${window.SmartEarthRootUrl}Workers/image/bottomplane.jpg`),repeat:new C.Cartesian2(1,1)})}}),y.push(y[0]);let H,q,ie,Z,oe,ne;for(let se=0;se<y.length-1;se++){H=C.Cartographic.fromCartesian(y[se]),q=C.Cartographic.fromCartesian(y[se+1]),ie=C.Math.toDegrees(H.longitude),oe=C.Math.toDegrees(H.latitude),Z=C.Math.toDegrees(q.longitude),ne=C.Math.toDegrees(q.latitude),I?I=I>q.height?q.height:I:I=H.height>q.height?q.height:H.height;let ce=T.getPoint(ie,oe,Z,ne,H.height,q.height),j=[],de=[];T.getHeightsFromLonLat(ce.positions,function(me){if(me){j=me;for(let _e=0;_e<j.length;_e++)de.push(T.heightsort[0]-T.deepth);T.drawwall(ce.wallJwd,j,de)}})}v.polygon.height=Q[0]-M,this.FlattenPolygon.push(v),this.originHeight=Q[0],k(y),this.topPositions=y,typeof f=="function"&&f(y)};function L(){return new C.PolygonHierarchy(C.Cartesian3.fromDegreesArrayHeights(x))}function R(V){let H;if(m.scene.terrainProvider.constructor.name==="EllipsoidTerrainProvider")H=m.camera.pickEllipsoid(V,m.scene.globe.ellipsoid);else{let ie=m.scene.camera.getPickRay(V);H=m.scene.globe.pick(ie,m.scene)}if(m.scene.pick(V)){let ie=m.scene.pickPosition(V);if(ie){H=ie;let Z=C.Cartographic.fromCartesian(H),oe=m.scene.globe.getHeight(Z);Z.height=oe,H=C.Cartographic.toCartesian(Z)}}return H}function k(V){let H=m.scene.globe,q=V.concat();q.splice(q.length-1,1);for(let Z=0;Z<q.length-1;Z++)q[Z].x===q[Z+1].x&&q[Z].y===q[Z+1].y&&(q.splice(Z,1),Z--);let ie=q.length;if(U(q)&&q.reverse(),T.irregularCut){T.terrainFlatten.clearPolygon();let Z=[],oe=m.scene.globe.ellipsoid;for(let ne=0;ne<q.length;ne++){let se=oe.cartesianToCartographic(q[ne]),ce=C.Math.toDegrees(se.longitude),j=C.Math.toDegrees(se.latitude),de=se.height;Z.push(ce,j,de)}T.terrainFlatten.addPolygon(Z),T.terrainFlatten.update(),T.terrainFlatten.clipPlaneOfFlatten=!0}else{let Z=[];for(let oe=0;oe<ie;++oe){let ne=(oe+1)%ie,se=C.Cartesian3.add(q[oe],q[ne],new C.Cartesian3);se=C.Cartesian3.multiplyByScalar(se,.5,se);let ce=C.Cartesian3.normalize(se,new C.Cartesian3),j=C.Cartesian3.subtract(q[ne],se,new C.Cartesian3);j=C.Cartesian3.normalize(j,j);let de=C.Cartesian3.cross(j,ce,new C.Cartesian3);de=C.Cartesian3.normalize(de,de);let me=new C.Plane(de,0),_e=C.Plane.getPointDistance(me,se);Z.push(new C.ClippingPlane(de,_e))}H.clippingPlanes=new C.ClippingPlaneCollection({planes:Z})}}function U(V){if(V.length>=3)return!((V[1].x-V[0].x)*(V[2].y-V[1].y)-(V[1].y-V[0].y)*(V[2].x-V[1].x)>0)}return this};Gx.prototype.getPoint=function(o,A,f,m,C,y){let x=this,v=160,E=je.lerp(o,f,1/v)-o,I=je.lerp(A,m,1/v)-A,w=[],Q=[],M=[],B;w.push(o,A),B=ee.fromDegrees(o,A),Q.push(Kt.fromCartesian(B));for(let T=0;T<v;T++){let D=o+(T+1)*E,F=A+(T+1)*I;w.push(D,F),B=ee.fromDegrees(D,F),Q.push(Kt.fromCartesian(B))}return w.push(f,m),B=ee.fromDegrees(f,m),Q.push(Kt.fromCartesian(B)),{wallJwd:w,positions:Q}};Gx.prototype.getHeightsFromLonLat=function(o,A){let f=this._viewer,m=f.camera,C=[];if(this.isHaveTerrain(f))if(O(f.terrainProvider.availability)){let y=EQ(f.terrainProvider,o);Promise.resolve(y).then(function(x){x.forEach(function(v){C.push(v.height)}),typeof A=="function"&&A(C)})}else o.forEach(function(y){let x=f.scene.globe.getHeight(y);C.push(x)}),typeof A=="function"&&A(C);else o.forEach(function(y){C.push(f.scene.globe.getHeight(y))}),typeof A=="function"&&A(C)};Gx.prototype.isHaveTerrain=function(){return!!(this._viewer.scene&&this._viewer.scene.terrainProvider&&this._viewer.scene.terrainProvider._layers)};Gx.prototype.drawwall=function(o,A,f){let m=this,C=m._viewer.entities.add({wall:{positions:new Bn(function(){return ee.fromDegreesArray(o)},!1),maximumHeights:A,minimumHeights:f}}),y=C.wall;y.material=new V0({image:Ae(m._option.wallImgUrl,`${window.SmartEarthRootUrl}Workers/image/dzmc.jpg`),repeat:new It(1,1)}),m.wallArr.push(C)};Gx.prototype.setDeepth=function(o){this.FlattenPolygon[0]&&this.FlattenPolygon[0].polygon.height.setValue(this.originHeight-o),this.wallArr.forEach(A=>{let f=A.wall.minimumHeights.getValue();f=Array(f.length),f.fill(this.originHeight-o),A.wall.minimumHeights.setValue(f)})};Gx.prototype.edit=function(o){let A=this,f=A.editPoint,m=A.nowPoint;if(A._earthCtrl.coreMap.scene.globe.depthTestAgainstTerrain=!1,m){for(let x of A.editPoint)x&&(x.show=!0);A.update(m,f,o);return}for(let x=2;x<A.hierarchy.length;x=x+3)A.hierarchy[x]=A.originHeight-A.deepth;A.FlattenPolygon[0]&&A._viewer.entities.remove(A.FlattenPolygon[0]),A.FlattenPolygon=[];let C=this._viewer.entities.add({name:null,id:A._earthCtrl.factory.createUUID(),polygon:{hierarchy:new Un(ee.fromDegreesArrayHeights(A.hierarchy)),material:new V0({image:Ae(A._option.bottomImgUrl,`${window.SmartEarthRootUrl}Workers/image/bottomplane.jpg`),repeat:new It(1,1)}),perPositionHeight:!0}});A.FlattenPolygon.push(C);let y=A.FlattenPolygon[0].polygon.hierarchy.getValue();for(let x of y.positions){let v=this._viewer.entities.add({id:A._earthCtrl.factory.createUUID(),position:x,point:{color:At.WHITE,pixelSize:12,outlineColor:At.BLACK,outlineWidth:1}});f.push(v)}A._earthCtrl.measure.pickObject(null,function(x){let v=x.pickedObject.id;for(let E of f)if(v.id===E.id){A.nowPoint=E,A.update(E,f,o);return}})};Gx.prototype.endEdit=function(){let o=this;if(o._earthCtrl.coreMap.scene.globe.depthTestAgainstTerrain=!0,o.editPoint.length>0)for(let A of o.editPoint)A&&(A.show=!1)};Gx.prototype.excavationAndFill=function(){this.removeLabel();let o=this;this.endEdit(),o.topPositions&&(this.isLoading(!0),setTimeout(()=>{let A=null,f=null,m=!1;if(o.editPosition.length>0){let v=[];f=[];for(let E=0;E<o.editPosition.length-1;E++){let I=Kt.fromCartesian(o.editPosition[E]),w=je.toDegrees(I.longitude),Q=je.toDegrees(I.latitude),M=I.height;v.push(M),f.push(w,Q,M)}v.sort(function(E,I){return I-E}),A=v[0],m=!0}else A=o.heightsort[0]-o.deepth;let y=new wse(o._earthCtrl,{positions:o.topPositions,baseHeight:A,basePositions:f,countBase:m}).start(),x=o.computeCentroidOfPolygon(o.topPositions);this._volumeLabel=this._viewer.entities.add({position:ee.fromRadians(x.longitude,x.latitude,o.heightsort[o.heightsort.length-1]),label:{text:`\u6316\u65B9\u4F53\u79EF\uFF1A${y.cutVolume}\u7ACB\u65B9\u7C73`,pixelOffset:{x:0,y:-30},font:"16px \u5B8B\u4F53",fillColor:At.GOLD,verticalOrigin:bn.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),this._volumeLabel1=this._viewer.entities.add({position:ee.fromRadians(x.longitude,x.latitude,o.heightsort[o.heightsort.length-1]),label:{text:`\u586B\u65B9\u4F53\u79EF\uFF1A${y.fillVolume}\u7ACB\u65B9\u7C73`,pixelOffset:{x:0,y:-70},font:"16px \u5B8B\u4F53",fillColor:At.GOLD,verticalOrigin:bn.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),this.isLoading(!1),console.log(y.result)},100))};Gx.prototype.computeCentroidOfPolygon=function(o){let A=[],f=[],m=0,C=0;for(let v=0;v<o.length;v++){let E=Kt.fromCartesian(o[v]);m+=E.longitude,C+=E.latitude,A.push(E.longitude),f.push(E.latitude)}let y=0,x=0;return y=m/o.length,x=C/o.length,new Kt(y,x)};Gx.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=this.loadingImg,o.appendChild(A),this.loading=o,this._viewer.container.appendChild(o)};Gx.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};Gx.prototype.update=function(o,A,f){let m=this,C=o.position.getValue(),x=m._scene.globe.ellipsoid.cartesianToCartographic(C),v=je.toDegrees(x.longitude),E=je.toDegrees(x.latitude),I=x.height;o.position.setValue(ee.fromDegrees(v,E,I+f)),m.editPoint=A,m.editPosition=[];let w=[];for(let M of A){let B=M.position.getValue();w.push(B),m.editPosition.push(B)}m.FlattenPolygon[0].polygon.hierarchy=new Bn(function(){return new Un(w)},!0);let Q=m.editPosition;Q.push(Q[0]);for(let M=0;M<Q.length-1;M++){let T=[];for(let D=0;D<=160;D++){let F=ee.lerp(Q[M],Q[M+1],D/160,new ee),L=Kt.fromCartesian(F);T.push(L.height)}m.wallArr[M].wall.minimumHeights.setValue(T)}};Gx.prototype.removeFromMap=function(){this.endEdit(),this._earthCtrl.tools.clearTool(),this.editPoint=[],this.nowPoint=null;let o=this._viewer;if(this.wallArr.length>0){for(let A=0;A<this.wallArr.length;A++)o.entities.remove(this.wallArr[A]);this.wallArr=[]}o.scene.globe.clippingPlanes&&o.scene.globe.clippingPlanes.removeAll(),this.FlattenPolygon&&this.FlattenPolygon.length>0&&(this.FlattenPolygon.forEach(function(A){o.entities.remove(A)}),this.FlattenPolygon=[]),this.FlattenIsDraw=!1,this.removeLabel(),this.terrainFlatten&&this.terrainFlatten.clearPolygon()};Gx.prototype.removeLabel=function(){this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0)};var aMe=Gx;function _C(o,A={}){this._earthCtrl=o,this._viewer=o.coreMap,this._scene=o.coreMap.scene,this.options=Ae(A,{}),this._Tooltip=new pw(o),this._tooltip=this._Tooltip.CreateTooltip(),this._drawColor={point:Ae(this.options.drawColor?.point,At.BLUE),polyline:Ae(this.options.drawColor?.polyline,At.YELLOW),polygon:Ae(this.options.drawColor?.point,At.YELLOW.withAlpha(.5))},this.selectDatum=!0,this.onlyTerrain=!0,this.tin=!1,this._volumeTin=[],this.loadingImg=`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`,this.unit=Ae(A.unit,"km\xB3")}_C.prototype.removeFromMap=function(){this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._prevEntity1!==void 0&&(this._viewer.entities.remove(this._prevEntity1),this._prevEntity1=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._volumeTin.forEach(o=>{this._viewer.entities.remove(o)}),this._volumeTin=[],this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=void 0),this.Triangulation=[],this.tinData=void 0,this._tooltip.show(!1)};_C.prototype.deleteObject=_C.prototype.removeFromMap;_C.prototype.startDrawing=function(o={},A="auto",f){let m=this._scene,C=this._tooltip,y=3,x=[],v=[],E=[],I;this._positions=v,this._degreesArr=E,this._drawColor.point=o.point||this._drawColor.point,this._drawColor.polyline=o.polyline||this._drawColor.polyline,this._drawColor.polygon=o.polygon||this._drawColor.polygon,this.loadingImg=o.loading||this.loadingImg,this.tin=Ae(o.tin,!0),this.onlyTerrain=Ae(o.onlyTerrain,!1),this.selectDatum=Ae(o.selectDatum,!0);let w=this;this._mouseHandler&&this._mouseHandler.destroy(),this.loading||this.addLoading();let Q=new Ur(m.canvas);this._mouseHandler=Q,this.removeFromMap(),this._viewer.container.style.cursor=`url(${globalThis.GEOWORLD_BASE_URL} 'Workers/image/cursor/draw.cur')`;let M;Q.setInputAction(function(T){if(T.position!==null){let D=m.camera.getPickRay(T.position),F=m.globe.pick(D,m);if(this._viewer.scene.pick(T.position)){let R=this._viewer.scene.pickPosition(T.position);R&&(F=R)}if(F){let R=Kt.fromCartesian(F),k=je.toDegrees(R.longitude),U=je.toDegrees(R.latitude);if(x.length===0&&(x.push(k,U),E.push([k,U]),v.push(F),I=F),v.length>=4){let V=Ss.wgs84ToWindowCoordinates(this._viewer.scene,I);if(V!==void 0){let H=V.x-T.position.x,q=V.y-T.position.y;if(H*H+q*q<16){x.splice(x.length-2,2),v.pop(),this.stopDrawing(f);return}}}x.push(k,U),E.push([k,U]),v.push(F),v.length===2&&!M&&(M=this._viewer.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new Bn(function(){return v},!1),clampToGround:!0,material:w._drawColor.polygon,width:3}})),v.length===y&&(M&&this._viewer.entities.remove(M),this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:new Un(ee.fromDegreesArray(x)),material:w._drawColor.polygon,fill:!0}}),this._prevEntity.polygon.hierarchy=new Bn(B,!1))}}}.bind(this),Ki.LEFT_CLICK),Q.setInputAction(function(T){let D=T.endPosition;if(D!==null)if(v.length===0)C.showAt(D,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7B2C\u4E00\u4E2A\u70B9");else{let F=m.camera.getPickRay(D),L=m.globe.pick(F,m),R=this._viewer.scene.pick(D),k=!1;if(R){let U=this._viewer.scene.pickPosition(D);U&&(L=U),k=!0}if(L){let U=Kt.fromCartesian(L),V=je.toDegrees(U.longitude),H=je.toDegrees(U.latitude);if(x.splice(x.length-2,2),E.pop(),v.pop(),x.push(V,H),E.push([V,H]),v.push(L),C.showAt(D,"\u53F3\u952E\u7ED3\u675F\u7ED8\u5236"),v.length>=3&&v.length>=4){let q=Ss.wgs84ToWindowCoordinates(this._viewer.scene,I);if(q!==void 0){let ie=q.x-D.x,Z=q.y-D.y;ie*ie+Z*Z<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}}.bind(this),Ki.MOUSE_MOVE),Q.setInputAction(function(T){this.end&&this.end()}.bind(this),Ki.RIGHT_CLICK);function B(){return new Un(ee.fromDegreesArray(x))}return this.end=T=>{if(this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),w._viewer.container.style.cursor="default",this._tooltip.show(!1),M&&this._viewer.entities.remove(M),this.end=void 0,!(v.length<y)){if(this._prevEntity&&(this._prevEntity.polygon.hierarchy=ee.fromDegreesArray(x)),T==="cancel"){this._prevEntity&&this._viewer.entities.remove(this._prevEntity);return}this.stopDrawing(A,f)}},this};_C.prototype.stopDrawing=function(o,A){this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._volumeTin.forEach(f=>{this._viewer.entities.remove(f)}),this._volumeTin=[],this.isLoading(!0),setTimeout(()=>{let f=this.computeCutVolume(o,this.onlyTerrain),m=C=>{let y=C.maxHeight,x=C.minHeight;this._prevEntity.polygon.height=C.minHeight,this._prevEntity.polygon.heightReference=0;let v={id:this._earthCtrl.factory.createUUID(),polygon:{hierarchy:{positions:this._positions},height:x,extrudedHeight:y,closeTop:!1,closeBottom:!1,material:At.CYAN.withAlpha(.2),outline:!0,outlineColor:At.RED,outlineWidth:2}};if(this._prevEntity1=this._viewer.entities.add(v),typeof A=="function"&&A(C),this.selectDatum){let E=()=>{this.addPoint(I=>{this.setDatum(I,w=>{typeof A=="function"&&A({...C,...w}),E()})})};E()}};this.onlyTerrain?f.then(C=>{m(C)}):m(f)},100)};_C.prototype.computeCentroidOfPolygon=function(o){let A=[],f=[],m=0,C=0;for(let v=0;v<o.length;v++){let E=Kt.fromCartesian(o[v]);m+=E.longitude,C+=E.latitude,A.push(E.longitude),f.push(E.latitude)}let y=0,x=0;return y=m/o.length,x=C/o.length,new Kt(y,x)};_C.prototype.computeCutVolume=function(o,A){let f=this,m=15e3,C=-15e3;if(o==="auto"){let E=wi.fromPoints(this._positions);console.log("BoundingSphere.radius",E.radius),o=E.radius/20}let y=this.getPointsInPolygon(this._degreesArr,o,!0),x=Zl.polygon([this._degreesArr]),v=()=>{let{tin:E}=this.tinFromPoints(y,{getArea:!0,polygon:x});this.tinData=E;let I={fill:0,dig:0},w,Q,M,B,T;this.Triangulation=[],E.features.forEach(L=>{if(L.positions){if(this.tin){let k=this._viewer.entities.add({polygon:{hierarchy:new Un(L.positions),material:this._drawColor.polygon,perPositionHeight:!0,outline:!0,outlineColor:At.YELLOW}});this._volumeTin.push(k)}let R=L.geometry.coordinates[0];w=R[0][2],Q=R[1][2],M=R[2][2],T=L.area,this.Triangulation.push({bottomArea:T,height:[w,Q,M]}),B=(w-m+Q-m+M-m)/3,B>0?I.dig=I.dig+T*B:I.fill=I.fill-T*B}});let D=this.computeCentroidOfPolygon(this._positions);this.unit!=="m\xB3"&&(I.dig=I.dig/1e9,I.fill=I.fill/1e9);let F=this.unit==="m\xB3"?"\u7ACB\u65B9\u7C73":"\u7ACB\u65B9\u5343\u7C73";return this._volumeLabel=this._viewer.entities.add({position:ee.fromRadians(D.longitude,D.latitude,C),label:{text:`\u6316\u65B9\u4F53\u79EF\uFF1A${I.dig.toFixed(4)}${F}`,pixelOffset:{x:0,y:-30},font:"16px \u5B8B\u4F53",fillColor:At.GOLD,verticalOrigin:bn.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),this._volumeLabel1=this._viewer.entities.add({position:ee.fromRadians(D.longitude,D.latitude,C),label:{text:`\u586B\u65B9\u4F53\u79EF\uFF1A${I.fill.toFixed(4)}${F}`,pixelOffset:{x:0,y:-70},font:"16px \u5B8B\u4F53",fillColor:At.GOLD,verticalOrigin:bn.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),this.isLoading(!1),{maxHeight:C,minHeight:m,volume:I,unit:this.unit,spacing:o}};if(A){let E=[];return y.features.forEach(w=>{let Q=w.geometry.coordinates;E.push(Kt.fromDegrees(Q[0],Q[1]))}),EQ(this._viewer.scene.globe.terrainProvider,E).then(w=>(y.features.forEach((Q,M)=>{let B=Q.geometry.coordinates;B[2]=w[M]&&w[M].height?w[M].height:0,C<B[2]&&(C=B[2]),m>B[2]&&(m=B[2])}),v()))}return y.features.forEach(E=>{let I=E.geometry.coordinates,w=new Kt(je.toRadians(I[0]),je.toRadians(I[1]));I[2]=this._viewer.scene.sampleHeight(w)||0,C<I[2]&&(C=I[2]),m>I[2]&&(m=I[2])}),v()};_C.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=this.loadingImg,o.appendChild(A),this.loading=o,this._viewer.container.appendChild(o)};_C.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};_C.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};_C.prototype.addPoint=function(o){this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=null),this._prevEntity1&&(this.addPointHandle=new Ur(this._viewer.scene.canvas),this.addPointHandle.setInputAction(function(A){let f=this._viewer.scene.pick(A.position);if(f&&f.id&&f.id.id===this._prevEntity1.id){let m=this._viewer.scene.pickPosition(A.position);if(m){let C=Kt.fromCartesian(m);this.addPointHandle.destroy(),this.addPointHandle=null,o&&typeof o=="function"&&o(C.height.toFixed(1))}}}.bind(this),Ki.LEFT_CLICK),this.addPointHandle.setInputAction(function(A){let f=this._viewer.scene.pick(A.endPosition);f&&f.id&&f.id.id===this._prevEntity1.id?this._tooltip.showAt(A.endPosition,"\u70B9\u51FB\u4FEE\u6539\u57FA\u51C6\u9762\u9AD8\u5EA6"):this._tooltip.show(!1)}.bind(this),Ki.MOUSE_MOVE))};_C.prototype.showTin=function(o){this.tin=o,this._volumeTin.forEach(A=>{this._viewer.entities.remove(A)}),this._volumeTin=[],o&&this.tinData&&this.tinData.features.forEach(A=>{if(A.positions){let f=this._viewer.entities.add({polygon:{hierarchy:new Un(A.positions),material:this._drawColor.polygon,perPositionHeight:!0,outline:!0,outlineColor:At.YELLOW}});this._volumeTin.push(f)}})};_C.prototype.setDatum=function(o,A){if(this.Triangulation&&this.Triangulation.length>0){let f,m,C,y={fill:0,dig:0};this.Triangulation.forEach(function(v){f=v.bottomArea,m=v.height,C=(m[0]-o+m[1]-o+m[2]-o)/3,C>0?y.dig=y.dig+f*C:y.fill=y.fill-f*C}),this.unit!=="m\xB3"&&(y.dig=y.dig/1e9,y.fill=y.fill/1e9);let x=this.unit==="m\xB3"?"\u7ACB\u65B9\u7C73":"\u7ACB\u65B9\u5343\u7C73";this._volumeLabel.label.text=`\u6316\u65B9\u4F53\u79EF\uFF1A${y.dig.toFixed(4)}${x}`,this._volumeLabel1.label.text=`\u586B\u65B9\u4F53\u79EF\uFF1A${y.fill.toFixed(4)}${x}`,this._prevEntity.polygon.height=o,A&&typeof A=="function"&&A({volume:y,unit:this.unit})}};_C.prototype.getPointsInPolygon=function(o,A=50,f=!0){if(o.length<3)return;o.push(o[0]);let m=Zl.lineString(o),C=Zl.bbox(m),y=Zl.pointGrid(C,A,{units:"meters"}),x=Zl.polygon([o]),v=Zl.pointsWithinPolygon(y,x);if(f)for(let E=0;E<o.length-1;E++){let I=Zl.lineString([o[E],o[E+1]]),w={units:"meters"},Q=Zl.length(I,w),M;for(let B=A;;B+=A)if(B<=Q)M=Zl.along(I,B,w),v.features.push(M);else{M=Zl.along(I,Q,w),v.features.push(M);break}}return v};_C.prototype.tinFromPoints=function(o,A={}){let{polygon:f,getArea:m}=A,C=Zl.tin(o),y=0;return C&&C.features&&C.features.forEach(x=>{let v=!0;if(f){let E=Zl.centerOfMass(x);v=Zl.booleanPointInPolygon(E,f)}if(v){let E=x.geometry.coordinates[0],I=[],w=[];for(let Q=0;Q<3;Q++)I.push([E[Q][0],E[Q][1]]),w.push(ee.fromDegrees(E[Q][0],E[Q][1],E[Q][2]));x.positions=w,m&&(x.area=this.getArea(I,w,!0),y+=x.area)}}),{tin:C,area:y}};_C.prototype.getArea=function(o,A,f){if(o.length<3)return;o.push(o[0]);let m=o,C=0,y=Zl.polygon([m]),x;m.length===4?x=[y]:x=Zl.tesselate(y).features;let v,E,I,w;return x.forEach(Q=>{v=Q.geometry.coordinates[0],E=m.findIndex(F=>F.toString()===v[0].toString()),I=m.findIndex(F=>F.toString()===v[1].toString()),w=m.findIndex(F=>F.toString()===v[2].toString());let M=this.getdistance(A[E],A[I]),B=this.getdistance(A[I],A[w]),T=this.getdistance(A[E],A[w]),D=(M+B+T)/2;C+=Math.sqrt(D*((D-M)*(D-B)*(D-T)))}),f||(C<1e6?C=`${C.toFixed(2)}\u5E73\u65B9\u7C73`:C=`${(C/1e6).toFixed(2)}\u5E73\u65B9\u5343\u7C73`),C};_C.prototype.getdistance=function(o,A){let f=Kt.fromCartesian(o),m=Kt.fromCartesian(A),C=Di.MOON2000,x=new l0(f,m,C).surfaceDistance;return x=Math.sqrt(Math.pow(x,2)+Math.pow(m.height-f.height,2)),x};var pAt=_C;function bse(o){this.mEarthCtrl=o,this._polylines=[],this._resPolylines=[],this._points=[],this.entities=this.mEarthCtrl.entities,this.camera=this.mEarthCtrl.coreMap.camera,this.scene=this.mEarthCtrl.coreMap.scene}bse.prototype.createLineOfSight=function(o){let A=[],f=this,m=[],C=[],y={polyline:[]};f.objectsToExclude=null;let x,v=function(){function M(B){this.options={polyline:{show:!0,positions:[],material:At.YELLOW,width:3,clampToGround:!1}},this.positionsp=B,this._init()}return M.prototype._init=function(){let B=this,T=function(){return B.positionsp};this.options.polyline.positions=new Bn(T,!1),this.polyline=f.entities.add(this.options),f.item=this.polyline,C.push(this.polyline)},M}(),E=new Ur(f.scene.canvas),I=[],w;if(this._points.length>0)for(let M=0;M<this._points.length;M++)this.entities.remove(this._points[M]);let Q=[];return E.setInputAction(function(M){let B,T=new ee(0,0,0);if(new es(f.mEarthCtrl).pickVector(M.position,T)&&(B=T),!!B)if(I.length===0){I.push(B.clone(),B.clone());let F={leftX:M.position.x,leftY:M.position.y};Q.push(F),x=B.clone()}else{let F={rightX:M.position.x,rightY:M.position.y};Q.push(F);let L={postion:I,entity:C,cartesian:Q};m.push(L),Q=[],w=void 0,I=[],I.push(x.clone()),I.push(x.clone()),w=new v(I),A.push(w)}},Ki.LEFT_CLICK),E.setInputAction(function(M){let B,T=f.camera.getPickRay(M.endPosition);if(B=f.scene.globe.pick(T,f.scene),f.scene.pick(M.endPosition)){let F=f.scene.pickPosition(M.endPosition);F&&(B=F)}!B||I.length>=2&&(O(w)?B!==void 0&&(I.pop(),I.push(B)):(w=new v(I),A.push(w)))},Ki.MOUSE_MOVE),E.setInputAction(function(M){let B=f.entities.add(new UA);f.objectsToExclude=[B];let T=!0;for(let D=0;D<m.length;D++)D===0?T=f.tsjx(m[0].postion[0],m[0].postion[1]):T=f.tsjx(m[D].postion[0],m[D].postion[1]);I.pop(),f._polylines=y.polyline,E.destroy();for(let D=0;D<C.length;D++)f.entities.remove(C[D]);O(o)&&typeof o=="function"&&o(y)},Ki.RIGHT_CLICK),this};bse.prototype.tsjx=function(o,A){let f=this,m=ee.normalize(ee.subtract(A,o,new ee),new ee),C=new ls(o,m),y=f.scene.globe.pick(C,f.scene);y!=null?(x(y,o,At.GREEN),x(y,A,At.RED)):x(o,A,At.GREEN);function x(v,E,I){let w=f.entities.add({polyline:{positions:[v,E],width:1,material:I,depthFailMaterial:I}});f._resPolylines.push(w)}return!1};bse.prototype.deleteObject=function(){if(this._points.length>0){this.objectsToExclude=null;for(let o=0;o<this._points.length;o++)this.entities.remove(this._points[o])}if(this._resPolylines.length>0){for(let o=0;o<this._resPolylines.length;o++)this.entities.remove(this._resPolylines[o]);this._resPolylines=[]}};var mAt=bse;function _h(o,A={}){this._earthCtrl=o,this._viewer=o.coreMap,this._scene=o.coreMap.scene,this.options=Ae(A,{}),this._Tooltip=new pw(o),this._tooltip=this._Tooltip.CreateTooltip(),this._drawColor={point:Ae(this.options.drawColor?.point,At.BLUE),polyline:Ae(this.options.drawColor?.polyline,At.YELLOW),polygon:Ae(this.options.drawColor?.polygon,At.YELLOW.withAlpha(.5))},this.selectDatum=!0,this.onlyTerrain=!0,this.tin=!1,this._volumeTin=[],this.loadingImg=`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`,this.wallArr=[],this.FlattenPolygon=[],this._Apositions=[],this._heightsort=null,this._deepth=100,this._positions=[],this._modelArr=Ae(A.modelArr,[]),this._isFlattening=Ae(A.isFlattening,!0),this.modelCuttingPolygon=null,this.wallImgUrl=Ae(A.wallImgUrl,null),this.bottomImgUrl=Ae(A.bottomImgUrl,null),this.calculate=Ae(A.calculate,!0),this._Loading=Ae(A.loading,!0),this.editPoint=[],this.nowPoint=null,this.hierarchy=[],this._originHeight=null}_h.prototype.removeMeasureFromMap=function(){this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._prevEntity1!==void 0&&(this._viewer.entities.remove(this._prevEntity1),this._prevEntity1=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._volumeTin.forEach(o=>{this._viewer.entities.remove(o)}),this._volumeTin=[],this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=void 0),this.Triangulation=[],this.tinData=void 0,this._tooltip.show(!1)};_h.prototype.removeFromMap=function(){if(this.endEdit(),this.removeMeasureFromMap(),this.wallArr.length>0){for(let o=0;o<this.wallArr.length;o++)this._viewer.entities.remove(this.wallArr[o]);this.wallArr=[]}if(this.FlattenPolygon&&this.FlattenPolygon.length>0){for(let o=0;o<this.FlattenPolygon.length;o++)this._viewer.entities.remove(this.FlattenPolygon[o]);this.FlattenPolygon=[]}this.removeModelCutting()};_h.prototype.deleteObject=_h.prototype.removeFromMap;_h.prototype.startDrawing=function(o={},A){let f=Ae(o.spacing,"auto"),m=this._scene,C=this._tooltip,y=3,x=[],v=[],E=[],I=[],w=[],Q;this._Apositions=o.positions,this._positions=v,this._hierarchy=E,this._heightsort=I,this._degreesArr=w,this._deepth=Ae(o.deepth,100),this._drawColor.point=o.point||this._drawColor.point,this._drawColor.polyline=o.polyline||this._drawColor.polyline,this._drawColor.polygon=o.polygon||this._drawColor.polygon,this.loadingImg=o.loading||this.loadingImg,this.tin=Ae(o.tin,!1),this.onlyTerrain=Ae(o.onlyTerrain,!1),this.selectDatum=Ae(o.selectDatum,!1);let M=this;if(this._mouseHandler&&this._mouseHandler.destroy(),this.loading||this.addLoading(),o.positions){let B=ee.fromDegreesArray(o.positions);for(let T of B)v.push(T);if(!(v.length<y)){for(let T=0;T<o.positions.length;T+=2)w.push([o.positions[T],o.positions[T+1]]);this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:ee.fromDegreesArray(o.positions),material:M._drawColor.polygon,fill:!0}});for(let T=0;T<o.positions.length;T+=2){let D=M._viewer.scene.sampleHeight(new Kt(je.toRadians(o.positions[T]),je.toRadians(o.positions[T+1])));I.push(D),E.push(o.positions[T],o.positions[T+1],D)}this.stopDrawing(f,T=>{A&&A(T)})}}else{let B=new Ur(m.canvas);this._mouseHandler=B,this.removeMeasureFromMap(),this._viewer.container.style.cursor=`url(${globalThis.GEOWORLD_BASE_URL} 'Workers/image/cursor/draw.cur')`;let T;B.setInputAction(function(F){if(F.position!==null){let L=m.camera.getPickRay(F.position),R=m.globe.pick(L,m);if(this._viewer.scene.pick(F.position)){let U=this._viewer.scene.pickPosition(F.position);U&&(R=U)}if(R){let U=Kt.fromCartesian(R),V=je.toDegrees(U.longitude),H=je.toDegrees(U.latitude);if(x.length===0&&(x.push(V,H),w.push([V,H]),v.push(R),Q=R),v.length>=4){let q=Ss.wgs84ToWindowCoordinates(this._viewer.scene,Q);if(q!==void 0){let ie=q.x-F.position.x,Z=q.y-F.position.y;if(ie*ie+Z*Z<16){x.splice(x.length-2,2),v.pop(),this.stopDrawing(A);return}}}x.push(V,H),w.push([V,H]),v.push(R),v.length===2&&!T&&(T=this._viewer.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new Bn(function(){return v},!1),clampToGround:!0,material:M._drawColor.polygon,width:3}})),v.length===y&&(T&&this._viewer.entities.remove(T),this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:new Un(ee.fromDegreesArray(x)),material:M._drawColor.polygon,fill:!0}}),this._prevEntity.polygon.hierarchy=new Bn(()=>new Un(ee.fromDegreesArray(x)),!1))}}}.bind(this),Ki.LEFT_CLICK),B.setInputAction(function(F){let L=F.endPosition;if(L!==null)if(v.length===0)C.showAt(L,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7B2C\u4E00\u4E2A\u70B9");else{let R=m.camera.getPickRay(L),k=m.globe.pick(R,m),U=this._viewer.scene.pick(L),V=!1;if(U){let H=this._viewer.scene.pickPosition(L);H&&(k=H),V=!0}if(k){let H=Kt.fromCartesian(k),q=je.toDegrees(H.longitude),ie=je.toDegrees(H.latitude);if(x.splice(x.length-2,2),w.pop(),v.pop(),x.push(q,ie),w.push([q,ie]),v.push(k),C.showAt(L,"\u53F3\u952E\u7ED3\u675F\u7ED8\u5236"),v.length>=3&&v.length>=4){let Z=Ss.wgs84ToWindowCoordinates(this._viewer.scene,Q);if(Z!==void 0){let oe=Z.x-L.x,ne=Z.y-L.y;oe*oe+ne*ne<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}}.bind(this),Ki.MOUSE_MOVE);let D=null;B.setInputAction(function(F){D=window.setTimeout(()=>{console.log("\u5355\u51FB"),this.end&&this.end()},200)}.bind(this),Ki.RIGHT_CLICK),B.setInputAction(function(F){console.log("\u53CC\u51FB......"),clearTimeout(D)},Ki.LEFT_DOUBLE_CLICK),this.end=F=>{if(this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),M._viewer.container.style.cursor="default",this._tooltip.show(!1),T&&this._viewer.entities.remove(T),this.end=void 0,console.log(w,"?????????"),!(v.length<y)){if(this._prevEntity&&(this._prevEntity.polygon.hierarchy=ee.fromDegreesArray(x)),F==="cancel"){this._prevEntity&&this._viewer.entities.remove(this._prevEntity);return}for(let L=0;L<x.length;L+=2){let R=M._viewer.scene.sampleHeight(new Kt(je.toRadians(x[L]),je.toRadians(x[L+1])));I.push(R),E.push(x[L],x[L+1],R)}this._Apositions=x,this.stopDrawing(f,A)}}}return this};_h.prototype.stopDrawing=function(o,A){let f=this;this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._volumeTin.forEach(m=>{this._viewer.entities.remove(m)}),this._volumeTin=[],this._Loading&&this.isLoading(!0),setTimeout(()=>{f._heightsort.sort(function(T,D){return T-D});let m=this._viewer.entities.add({name:null,id:f._earthCtrl.factory.createUUID(),polygon:{hierarchy:new Bn(function(){return new Un(ee.fromDegreesArrayHeights(f._hierarchy))},!1),material:new V0({image:Ae(f.bottomImgUrl,`${window.SmartEarthRootUrl}Workers/image/bottomplane.jpg`),repeat:new It(1,1)})}});f.FlattenPolygon.push(m),f.originHeight=f._heightsort[0];let C=ee.fromDegreesArrayHeights(f._hierarchy);C.push(C[0]),f._positionsB=C;let y=null,x,v,E,I,w,Q;for(let T=0;T<C.length-1;T++){x=Kt.fromCartesian(C[T]),v=Kt.fromCartesian(C[T+1]),E=je.toDegrees(x.longitude),w=je.toDegrees(x.latitude),I=je.toDegrees(v.longitude),Q=je.toDegrees(v.latitude),y?y=y>v.height?v.height:y:y=x.height>v.height?v.height:x.height;let D=f.getPoint(E,w,I,Q,x.height,v.height),F=[],L=[];f.getHeightsFromLonLat(D.positions,function(R){if(R){F=R;for(let k=0;k<F.length;k++)L.push(f._heightsort[0]-f._deepth);f.drawwall(D.wallJwd,F,L)}})}if(f._baseHeight=f._heightsort[0]-f._deepth,m.polygon.height=f._baseHeight,!this.calculate)return f._isFlattening&&f.modelCutting(),A&&A(!0),this.isLoading(!1);let M=this.computeCutVolume(o,this.onlyTerrain),B=T=>{let D=T.maxHeight,F=T.minHeight;if(this._prevEntity.polygon.height=T.minHeight,this._prevEntity.polygon.heightReference=0,this.selectDatum){let L=()=>{this.addPoint(R=>{this.setDatum(R,k=>{typeof A=="function"&&A({...T,...k}),L()})})};L()}};this.onlyTerrain?M.then(T=>{B(T)}):B(M),f.setDatum(f._baseHeight,T=>{f._isFlattening&&f.modelCutting(),A&&A(T),this._Loading&&this.isLoading(!1)})},100)};_h.prototype.modelCutting=function(){let o=this;if(o._modelCuttingPolygon=rh.fromPositions({positions:ee.fromDegreesArray(o._Apositions),height:o._baseHeight}),o._modelArr.length>0)for(let A of o._modelArr)A.addFlattenPolygon(o._modelCuttingPolygon),A.needUpdateFlatten=!0,A.clipPlaneOfFlatten=!0;else console.info("\u8BF7\u6DFB\u52A0\u6A21\u578B\uFF01")};_h.prototype.removeModelCutting=function(){let o=this;if(o._modelArr.length>0){for(let A of o._modelArr)A.removeFlattenPolygon(o._modelCuttingPolygon);o._modelCuttingPolygon=null,o._modelArr=[]}else console.info("\u8BF7\u6DFB\u52A0\u6A21\u578B\uFF01")};_h.prototype.computeCentroidOfPolygon=function(o){let A=[],f=[],m=0,C=0;for(let v=0;v<o.length;v++){let E=Kt.fromCartesian(o[v]);m+=E.longitude,C+=E.latitude,A.push(E.longitude),f.push(E.latitude)}let y=0,x=0;return y=m/o.length,x=C/o.length,new Kt(y,x)};_h.prototype.edit=function(o,A,f){let m=this,C=m.editPoint,y=m.nowPoint;if(m._earthCtrl.coreMap.scene.globe.depthTestAgainstTerrain=!1,y){for(let E of m.editPoint)E&&(E.show=!0);m.update(y,C,o);return}for(let E=2;E<m._hierarchy.length;E=E+3)m._hierarchy[E]=m.originHeight-m._deepth;m.FlattenPolygon[0]&&m._viewer.entities.remove(m.FlattenPolygon[0]),m.FlattenPolygon=[];let x=this._viewer.entities.add({name:null,id:m._earthCtrl.factory.createUUID(),polygon:{hierarchy:new Un(ee.fromDegreesArrayHeights(m._hierarchy)),material:new V0({image:Ae(m.bottomImgUrl,`${window.SmartEarthRootUrl}Workers/image/bottomplane.jpg`),repeat:new It(1,1)}),perPositionHeight:!0}});m.FlattenPolygon.push(x);let v=m.FlattenPolygon[0].polygon.hierarchy.getValue();for(let E of v.positions){let I=this._viewer.entities.add({id:m._earthCtrl.factory.createUUID(),position:E,point:{color:At.WHITE,pixelSize:12,outlineColor:At.BLACK,outlineWidth:1}});C.push(I)}if(o)if(A){for(let E of C)if(A===E.id){m.nowPoint=E,m.update(E,C,o);return}}else m._earthCtrl.measure.pickObject(null,function(E){let I=E.pickedObject.id;for(let w of C)if(I.id===w.id){m.nowPoint=w,m.update(w,C,o);return}});else f&&f(C)};_h.prototype.update=function(o,A,f){let m=this,C=o.position.getValue(),x=m._scene.globe.ellipsoid.cartesianToCartographic(C),v=je.toDegrees(x.longitude),E=je.toDegrees(x.latitude),I=x.height;o.position.setValue(ee.fromDegrees(v,E,I+f)),m.editPoint=A,m.editPosition=[];let w=[];for(let M of A){let B=M.position.getValue();w.push(B),m.editPosition.push(B)}m.FlattenPolygon[0].polygon.hierarchy=new Bn(function(){return new Un(w)},!0);let Q=m.editPosition;Q.push(Q[0]);for(let M=0;M<Q.length-1;M++){let T=[];for(let D=0;D<=160;D++){let F=ee.lerp(Q[M],Q[M+1],D/160,new ee),L=Kt.fromCartesian(F);T.push(L.height)}m.wallArr[M].wall.minimumHeights.setValue(T)}};_h.prototype.endEdit=function(){let o=this;if(o._earthCtrl.coreMap.scene.globe.depthTestAgainstTerrain=!0,o.editPoint.length>0)for(let A of o.editPoint)A&&(A.show=!1)};_h.prototype.computeCutVolume=function(o,A){let f=this,m=15e3,C=-15e3;o==="auto"&&(o=wi.fromPoints(this._positions).radius/20);let y=this.getPointsInPolygon(this._degreesArr,o,!0),x=Zl.polygon([this._degreesArr]),v=()=>{let{tin:E}=this.tinFromPoints(y,{getArea:!0,polygon:x});this.tinData=E;let I={fill:0,dig:0},w={fill:"\u7ACB\u65B9\u7C73",dig:"\u7ACB\u65B9\u7C73"},Q,M,B,T,D,F={fill:1,dig:1};this.Triangulation=[],E.features.forEach(R=>{if(R.positions){if(this.tin){let U=this._viewer.entities.add({polygon:{hierarchy:new Un(R.positions),material:this._drawColor.polygon,perPositionHeight:!0,outline:!0,outlineColor:At.YELLOW}});this._volumeTin.push(U)}let k=R.geometry.coordinates[0];Q=k[0][2],M=k[1][2],B=k[2][2],D=R.area,this.Triangulation.push({bottomArea:D,height:[Q,M,B]}),T=(Q-m+M-m+B-m)/3,T>0?I.dig=I.dig+D*T*F.dig:I.fill=I.fill-D*T*F.fill,I.dig>1e10&&w.dig==="\u7ACB\u65B9\u7C73"&&(I.dig=I.dig/1e9,w.dig="\u7ACB\u65B9\u5343\u7C73",F.dig=1e-9),I.fill>1e10&&w.fill==="\u7ACB\u65B9\u7C73"&&(I.fill=I.fill/1e9,w.fill="\u7ACB\u65B9\u5343\u7C73",F.fill=1e-9)}});let L=this.computeCentroidOfPolygon(this._positions);return this._volumeLabel=this._viewer.entities.add({position:ee.fromRadians(L.longitude,L.latitude,C),label:{text:`\u6316\u65B9\u4F53\u79EF\uFF1A${I.dig.toFixed(4)}${w.dig}`,pixelOffset:{x:0,y:-30},font:"16px \u5B8B\u4F53",fillColor:At.GOLD,verticalOrigin:bn.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),this._volumeLabel1=this._viewer.entities.add({position:ee.fromRadians(L.longitude,L.latitude,C),label:{text:`\u586B\u65B9\u4F53\u79EF\uFF1A${I.fill.toFixed(4)}${w.fill}`,pixelOffset:{x:0,y:-70},font:"16px \u5B8B\u4F53",fillColor:At.GOLD,verticalOrigin:bn.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),{maxHeight:C,minHeight:m,volume:I,unit:w,spacing:o}};if(A){let E=[];return y.features.forEach(w=>{let Q=w.geometry.coordinates;E.push(Kt.fromDegrees(Q[0],Q[1]))}),EQ(this._viewer.scene.globe.terrainProvider,E).then(w=>(y.features.forEach((Q,M)=>{let B=Q.geometry.coordinates;B[2]=w[M]&&w[M].height?w[M].height:0,C<B[2]&&(C=B[2]),m>B[2]&&(m=B[2])}),v()))}return y.features.forEach(E=>{let I=E.geometry.coordinates,w=new Kt(je.toRadians(I[0]),je.toRadians(I[1]));I[2]=this._viewer.scene.sampleHeight(w)||0,C<I[2]&&(C=I[2]),m>I[2]&&(m=I[2])}),v()};_h.prototype.getPoint=function(o,A,f,m,C,y){let x=this,v=160,E=je.lerp(o,f,1/v)-o,I=je.lerp(A,m,1/v)-A,w=[],Q=[],M=[],B;w.push(o,A),B=ee.fromDegrees(o,A),Q.push(Kt.fromCartesian(B));for(let T=0;T<v;T++){let D=o+(T+1)*E,F=A+(T+1)*I;w.push(D,F),B=ee.fromDegrees(D,F),Q.push(Kt.fromCartesian(B))}return w.push(f,m),B=ee.fromDegrees(f,m),Q.push(Kt.fromCartesian(B)),{wallJwd:w,positions:Q}};_h.prototype.getHeightsFromLonLat=function(o,A){let f=this._viewer,m=[];o.forEach(function(C){m.push(f.scene.sampleHeight(new Kt(C.longitude,C.latitude)))}),typeof A=="function"&&A(m)};_h.prototype.isHaveTerrain=function(){return!!(this._viewer.scene&&this._viewer.scene.terrainProvider&&this._viewer.scene.terrainProvider._layers)};_h.prototype.drawwall=function(o,A,f){let m=this,C=m._viewer.entities.add({wall:{positions:new Bn(function(){return ee.fromDegreesArray(o)},!1),maximumHeights:A,minimumHeights:f}}),y=C.wall;y.material=new V0({image:Ae(m.wallImgUrl,`${window.SmartEarthRootUrl}Workers/image/dzmc.jpg`),repeat:new It(1,1)}),m.wallArr.push(C)};_h.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=this.loadingImg,o.appendChild(A),this.loading=o,this._viewer.container.appendChild(o)};_h.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};_h.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};_h.prototype.addPoint=function(o){this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=null),this._prevEntity1&&(this.addPointHandle=new Ur(this._viewer.scene.canvas),this.addPointHandle.setInputAction(function(A){let f=this._viewer.scene.pick(A.position);if(f&&f.id&&f.id.id===this._prevEntity1.id){let m=this._viewer.scene.pickPosition(A.position);if(m){let C=Kt.fromCartesian(m);this.addPointHandle.destroy(),this.addPointHandle=null,o&&typeof o=="function"&&o(C.height.toFixed(1))}}}.bind(this),Ki.LEFT_CLICK),this.addPointHandle.setInputAction(function(A){let f=this._viewer.scene.pick(A.endPosition);f&&f.id&&f.id.id===this._prevEntity1.id?this._tooltip.showAt(A.endPosition,"\u70B9\u51FB\u4FEE\u6539\u57FA\u51C6\u9762\u9AD8\u5EA6"):this._tooltip.show(!1)}.bind(this),Ki.MOUSE_MOVE))};_h.prototype.showTin=function(o){this.tin=o,this._volumeTin.forEach(A=>{this._viewer.entities.remove(A)}),this._volumeTin=[],o&&this.tinData&&this.tinData.features.forEach(A=>{if(A.positions){let f=this._viewer.entities.add({polygon:{hierarchy:new Un(A.positions),material:this._drawColor.polygon,perPositionHeight:!0,outline:!0,outlineColor:At.YELLOW}});this._volumeTin.push(f)}})};_h.prototype.setDatum=function(o,A){if(this.Triangulation&&this.Triangulation.length>0){let f,m,C,y={fill:0,dig:0},x={fill:"\u7ACB\u65B9\u7C73",dig:"\u7ACB\u65B9\u7C73"},v={fill:1,dig:1};this.Triangulation.forEach(function(E){f=E.bottomArea,m=E.height,C=(m[0]-o+m[1]-o+m[2]-o)/3,C>0?y.dig=y.dig+f*C*v.dig:y.fill=y.fill-f*C*v.fill,y.dig>1e10&&x.dig==="\u7ACB\u65B9\u7C73"&&(y.dig=y.dig/1e9,x.dig="\u7ACB\u65B9\u5343\u7C73",v.dig=1e-9),y.fill>1e10&&x.fill==="\u7ACB\u65B9\u7C73"&&(y.fill=y.fill/1e9,x.fill="\u7ACB\u65B9\u5343\u7C73",v.fill=1e-9)}),this._volumeLabel.label.text=`\u6316\u65B9\u4F53\u79EF\uFF1A${y.dig.toFixed(4)}${x.dig}`,this._volumeLabel1.label.text=`\u586B\u65B9\u4F53\u79EF\uFF1A${y.fill.toFixed(4)}${x.fill}`,this._prevEntity.polygon.height=o,A&&typeof A=="function"&&A({volume:y,unit:x})}};_h.prototype.getPointsInPolygon=function(o,A=50,f=!0){if(o.length<3)return;o.push(o[0]);let m=Zl.lineString(o),C=Zl.bbox(m),y=Zl.pointGrid(C,A,{units:"meters"}),x=Zl.polygon([o]),v=Zl.pointsWithinPolygon(y,x);if(f)for(let E=0;E<o.length-1;E++){let I=Zl.lineString([o[E],o[E+1]]),w={units:"meters"},Q=Zl.length(I,w),M;for(let B=A;;B+=A)if(B<=Q)M=Zl.along(I,B,w),v.features.push(M);else{M=Zl.along(I,Q,w),v.features.push(M);break}}return v};_h.prototype.tinFromPoints=function(o,A={}){let{polygon:f,getArea:m}=A,C=Zl.tin(o),y=0;return C&&C.features&&C.features.forEach(x=>{let v=!0;if(f){let E=Zl.centerOfMass(x);v=Zl.booleanPointInPolygon(E,f)}if(v){let E=x.geometry.coordinates[0],I=[],w=[];for(let Q=0;Q<3;Q++)I.push([E[Q][0],E[Q][1]]),w.push(ee.fromDegrees(E[Q][0],E[Q][1],E[Q][2]));x.positions=w,m&&(x.area=this.getArea(I,w,!0),y+=x.area)}}),{tin:C,area:y}};_h.prototype.getArea=function(o,A,f){if(o.length<3)return;o.push(o[0]);let m=o,C=0,y=Zl.polygon([m]),x;m.length===4?x=[y]:x=Zl.tesselate(y).features;let v,E,I,w;return x.forEach(Q=>{v=Q.geometry.coordinates[0],E=m.findIndex(F=>F.toString()===v[0].toString()),I=m.findIndex(F=>F.toString()===v[1].toString()),w=m.findIndex(F=>F.toString()===v[2].toString());let M=this.getdistance(A[E],A[I]),B=this.getdistance(A[I],A[w]),T=this.getdistance(A[E],A[w]),D=(M+B+T)/2;C+=Math.sqrt(D*((D-M)*(D-B)*(D-T)))}),f||(C<1e6?C=`${C.toFixed(2)}\u5E73\u65B9\u7C73`:C=`${(C/1e6).toFixed(2)}\u5E73\u65B9\u5343\u7C73`),C};_h.prototype.getdistance=function(o,A){let f=Kt.fromCartesian(o),m=Kt.fromCartesian(A),C=new l0;C.setEndPoints(f,m);let y=C.surfaceDistance;return y=Math.sqrt(Math.pow(y,2)+Math.pow(m.height-f.height,2)),y};var CAt=_h;function T2(o,A={}){this._earthCtrl=o,this._viewer=o.coreMap,this._scene=o.coreMap.scene,this.options=Ae(A,{}),this._modelArr=[],this._Apositions=[],this.FlattenPolygon=[],this._Loading=Ae(A.loading,!1),this._bottom=Ae(A.bottom,!1),this.loadingImg=Ae(A.loadingImg,`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`),this._Tooltip=new pw(o),this._tooltip=this._Tooltip.CreateTooltip(),this._positions=[],this._deepth=100,this._drawColor={point:Ae(this.options.drawColor?.point,At.BLUE),polyline:Ae(this.options.drawColor?.polyline,At.YELLOW),polygon:Ae(this.options.drawColor?.polygon,At.YELLOW.withAlpha(.5))}}T2.prototype.removeMeasureFromMap=function(){this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=void 0),this.Triangulation=[],this.tinData=void 0,this._tooltip.show(!1)};T2.prototype.startDrawing=function(o={},A){let f=this._scene,m=this._tooltip,C=3,y,x=[],v=[],E=[],I=[],w=[];this._positions=v,this._hierarchy=E,this._heightsort=I,this._degreesArr=w,this._deepth=Ae(o.deepth,100),this._modelArr=Ae(o.modelArr,[]);let Q=this;if(this._mouseHandler&&this._mouseHandler.destroy(),this.loading||this.addLoading(),o.positions){let M=ee.fromDegreesArray(o.positions);for(let B of M)v.push(B);if(!(v.length<C)){for(let B=0;B<o.positions.length;B+=2)w.push([o.positions[B],o.positions[B+1]]);console.log(v,"\u4F4D\u7F6E\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A"),this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:ee.fromDegreesArray(o.positions),material:Q._drawColor.polygon,fill:!0}});for(let B=0;B<o.positions.length;B+=2){let T=Q._viewer.scene.sampleHeight(new Kt(je.toRadians(o.positions[B]),je.toRadians(o.positions[B+1])));I.push(T),E.push(o.positions[B],o.positions[B+1],T)}this._Apositions=o.positions,this.stopDrawing(B=>{A&&A(B)})}}else{let M=new Ur(f.canvas);this._mouseHandler=M,this.removeMeasureFromMap(),this._viewer.container.style.cursor=`url(${globalThis.GEOWORLD_BASE_URL} 'Workers/image/cursor/draw.cur')`;let B;M.setInputAction(function(T){if(T.position!==null){let D=f.camera.getPickRay(T.position),F=f.globe.pick(D,f);if(this._viewer.scene.pick(T.position)){let R=this._viewer.scene.pickPosition(T.position);R&&(F=R)}if(F){let R=Kt.fromCartesian(F),k=je.toDegrees(R.longitude),U=je.toDegrees(R.latitude);if(x.length===0&&(x.push(k,U),w.push([k,U]),v.push(F),y=F),v.length>=4){let V=Ss.wgs84ToWindowCoordinates(this._viewer.scene,y);if(V!==void 0){let H=V.x-T.position.x,q=V.y-T.position.y;if(H*H+q*q<16){x.splice(x.length-2,2),v.pop(),this.stopDrawing(A);return}}}x.push(k,U),w.push([k,U]),v.push(F),v.length===2&&!B&&(B=this._viewer.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new Bn(function(){return v},!1),clampToGround:!0,material:Q._drawColor.polygon,width:3}})),v.length===C&&(B&&this._viewer.entities.remove(B),this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:new Un(ee.fromDegreesArray(x)),material:Q._drawColor.polygon,fill:!0}}),this._prevEntity.polygon.hierarchy=new Bn(()=>new Un(ee.fromDegreesArray(x)),!1))}}}.bind(this),Ki.LEFT_CLICK),M.setInputAction(function(T){let D=T.endPosition;if(D!==null)if(v.length===0)m.showAt(D,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7B2C\u4E00\u4E2A\u70B9");else{let F=f.camera.getPickRay(D),L=f.globe.pick(F,f),R=this._viewer.scene.pick(D),k=!1;if(R){let U=this._viewer.scene.pickPosition(D);U&&(L=U),k=!0}if(L){let U=Kt.fromCartesian(L),V=je.toDegrees(U.longitude),H=je.toDegrees(U.latitude);if(x.splice(x.length-2,2),w.pop(),v.pop(),x.push(V,H),w.push([V,H]),v.push(L),m.showAt(D,"\u53F3\u952E\u7ED3\u675F\u7ED8\u5236"),v.length>=3&&v.length>=4){let q=Ss.wgs84ToWindowCoordinates(this._viewer.scene,y);if(q!==void 0){let ie=q.x-D.x,Z=q.y-D.y;ie*ie+Z*Z<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}}.bind(this),Ki.MOUSE_MOVE),M.setInputAction(function(T){this.end&&this.end()}.bind(this),Ki.RIGHT_CLICK),this.end=T=>{if(this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),Q._viewer.container.style.cursor="default",this._tooltip.show(!1),B&&this._viewer.entities.remove(B),this.end=void 0,console.log(w,"?????????"),!(v.length<C)){if(this._prevEntity&&(this._prevEntity.polygon.hierarchy=ee.fromDegreesArray(x)),T==="cancel"){this._prevEntity&&this._viewer.entities.remove(this._prevEntity);return}for(let D=0;D<x.length;D+=2){let F=Q._viewer.scene.sampleHeight(new Kt(je.toRadians(x[D]),je.toRadians(x[D+1])));I.push(F),E.push(x[D],x[D+1],F)}this._Apositions=x,this.stopDrawing(A)}}}};T2.prototype.stopDrawing=function(o){let A=this;this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._Loading&&this.isLoading(!0),setTimeout(()=>{A._heightsort.sort(function(m,C){return m-C});let f=null;A._bottom?(f=this._viewer.entities.add({name:null,id:A._earthCtrl.factory.createUUID(),polygon:{hierarchy:new Bn(function(){return new Un(ee.fromDegreesArrayHeights(A._hierarchy))},!1),material:new V0({image:Ae(A.bottomImgUrl,`${window.SmartEarthRootUrl}Workers/image/bottomplane.jpg`),repeat:new It(1,1)})}}),A._baseHeight=A._heightsort[0]-A._deepth,f.polygon.height=A._baseHeight):f=this._viewer.entities.add({name:null,id:A._earthCtrl.factory.createUUID(),polygon:{hierarchy:new Bn(function(){return new Un(ee.fromDegreesArrayHeights(A._hierarchy))},!1),material:At.YELLOW.withAlpha(0)}}),A.FlattenPolygon.push(f),A.modelCutting()})};T2.prototype.modelCutting=function(){let o=this;if(o._modelCuttingPolygon=rh.fromPositions({positions:ee.fromDegreesArray(o._Apositions),height:o._baseHeight}),o._modelArr.length>0)for(let A of o._modelArr)A.addFlattenPolygon(o._modelCuttingPolygon),A.needUpdateFlatten=!0,A.clipPlaneOfFlatten=!0;else console.info("\u8BF7\u6DFB\u52A0\u6A21\u578B\uFF01")};T2.prototype.removeModelCutting=function(){let o=this;if(o._modelArr.length>0){for(let A of o._modelArr)A.removeFlattenPolygon(o._modelCuttingPolygon);o._modelCuttingPolygon=null,o._modelArr=[]}};T2.prototype.removeFromMap=function(){if(this.removeMeasureFromMap(),this.FlattenPolygon&&this.FlattenPolygon.length>0){for(let o=0;o<this.FlattenPolygon.length;o++)this._viewer.entities.remove(this.FlattenPolygon[o]);this.FlattenPolygon=[]}this.removeModelCutting()};T2.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=this.loadingImg,o.appendChild(A),this.loading=o,this._viewer.container.appendChild(o)};T2.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};T2.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};var yAt=T2;function M2(o,A={}){this._earthCtrl=o,this._viewer=o.coreMap,this._scene=o.coreMap.scene,this.options=Ae(A,{}),this._Apositions=[],this.FlattenPolygon=[],this._terrainFlatten=new _N(o.coreMap.scene),this._Loading=Ae(A.loading,!1),this._bottom=Ae(A.bottom,!1),this.loadingImg=Ae(A.loadingImg,`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`),this._Tooltip=new pw(o),this._tooltip=this._Tooltip.CreateTooltip(),this._positions=[],this._deepth=10,this._drawColor={point:Ae(this.options.drawColor?.point,At.BLUE),polyline:Ae(this.options.drawColor?.polyline,At.YELLOW),polygon:Ae(this.options.drawColor?.polygon,At.YELLOW.withAlpha(.5))}}M2.prototype.removeMeasureFromMap=function(){this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=void 0),this.Triangulation=[],this.tinData=void 0,this._tooltip.show(!1)};M2.prototype.startDrawing=function(o={},A){let f=this._scene,m=this._tooltip,C=3,y,x=[],v=[],E=[],I=[],w=[];this._positions=v,this._hierarchy=E,this._heightsort=I,this._degreesArr=w,this._deepth=Ae(o.deepth,100);let Q=this;if(this._mouseHandler&&this._mouseHandler.destroy(),this.loading||this.addLoading(),o.positions){let M=ee.fromDegreesArray(o.positions);for(let B of M)v.push(B);if(!(v.length<C)){for(let B=0;B<o.positions.length;B+=2)w.push([o.positions[B],o.positions[B+1]]);this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:ee.fromDegreesArray(o.positions),material:Q._drawColor.polygon,fill:!0}});for(let B=0;B<o.positions.length;B+=2){let T=Q._viewer.scene.sampleHeight(new Kt(je.toRadians(o.positions[B]),je.toRadians(o.positions[B+1])));I.push(T),E.push(o.positions[B],o.positions[B+1],T)}this._Apositions=o.positions,this.stopDrawing(B=>{A&&A(B)})}}else{let M=new Ur(f.canvas);this._mouseHandler=M,this.removeMeasureFromMap(),this._viewer.container.style.cursor=`url(${globalThis.GEOWORLD_BASE_URL} 'Workers/image/cursor/draw.cur')`;let B;M.setInputAction(function(T){if(T.position!==null){let D=f.camera.getPickRay(T.position),F=f.globe.pick(D,f);if(this._viewer.scene.pick(T.position)){let R=this._viewer.scene.pickPosition(T.position);R&&(F=R)}if(F){let R=Kt.fromCartesian(F),k=je.toDegrees(R.longitude),U=je.toDegrees(R.latitude);if(x.length===0&&(x.push(k,U),w.push([k,U]),v.push(F),y=F),v.length>=4){let V=Ss.wgs84ToWindowCoordinates(this._viewer.scene,y);if(V!==void 0){let H=V.x-T.position.x,q=V.y-T.position.y;if(H*H+q*q<16){x.splice(x.length-2,2),v.pop(),this.stopDrawing(A);return}}}x.push(k,U),w.push([k,U]),v.push(F),v.length===2&&!B&&(B=this._viewer.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new Bn(function(){return v},!1),clampToGround:!0,material:Q._drawColor.polygon,width:3}})),v.length===C&&(B&&this._viewer.entities.remove(B),this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:new Un(ee.fromDegreesArray(x)),material:Q._drawColor.polygon,fill:!0}}),this._prevEntity.polygon.hierarchy=new Bn(()=>new Un(ee.fromDegreesArray(x)),!1))}}}.bind(this),Ki.LEFT_CLICK),M.setInputAction(function(T){let D=T.endPosition;if(D!==null)if(v.length===0)m.showAt(D,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7B2C\u4E00\u4E2A\u70B9");else{let F=f.camera.getPickRay(D),L=f.globe.pick(F,f),R=this._viewer.scene.pick(D),k=!1;if(R){let U=this._viewer.scene.pickPosition(D);U&&(L=U),k=!0}if(L){let U=Kt.fromCartesian(L),V=je.toDegrees(U.longitude),H=je.toDegrees(U.latitude);if(x.splice(x.length-2,2),w.pop(),v.pop(),x.push(V,H),w.push([V,H]),v.push(L),m.showAt(D,"\u53F3\u952E\u7ED3\u675F\u7ED8\u5236"),v.length>=3&&v.length>=4){let q=Ss.wgs84ToWindowCoordinates(this._viewer.scene,y);if(q!==void 0){let ie=q.x-D.x,Z=q.y-D.y;ie*ie+Z*Z<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}}.bind(this),Ki.MOUSE_MOVE),M.setInputAction(function(T){this.end&&this.end()}.bind(this),Ki.RIGHT_CLICK),this.end=T=>{if(this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),Q._viewer.container.style.cursor="default",this._tooltip.show(!1),B&&this._viewer.entities.remove(B),this.end=void 0,console.log(w,"?????????"),!(v.length<C)){if(this._prevEntity&&(this._prevEntity.polygon.hierarchy=ee.fromDegreesArray(x)),T==="cancel"){this._prevEntity&&this._viewer.entities.remove(this._prevEntity);return}for(let D=0;D<x.length;D+=2){let F=Q._viewer.scene.sampleHeight(new Kt(je.toRadians(x[D]),je.toRadians(x[D+1])));I.push(F),E.push(x[D],x[D+1],F)}this._Apositions=x,this.stopDrawing(A)}}}};M2.prototype.stopDrawing=function(o){let A=this;this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._Loading&&this.isLoading(!0),setTimeout(()=>{A._heightsort.sort(function(C,y){return C-y});let f=null;A._bottom?(f=this._viewer.entities.add({name:null,id:A._earthCtrl.factory.createUUID(),polygon:{hierarchy:new Bn(function(){return new Un(ee.fromDegreesArrayHeights(A._hierarchy))},!1),material:new V0({image:Ae(A.bottomImgUrl,`${window.SmartEarthRootUrl}Workers/image/bottomplane.jpg`),repeat:new It(1,1)})}}),A._baseHeight=A._heightsort[0]-A._deepth,f.polygon.height=A._baseHeight):f=this._viewer.entities.add({name:null,id:A._earthCtrl.factory.createUUID(),polygon:{hierarchy:new Bn(function(){return new Un(ee.fromDegreesArrayHeights(A._hierarchy))},!1),material:At.YELLOW.withAlpha(0)}}),A.FlattenPolygon.push(f);let m=[];A._baseHeight=A._heightsort[0]-A._deepth;for(let C=0;C<A._hierarchy.length;C+=3)m.push(A._hierarchy[C],A._hierarchy[C+1],A._baseHeight);console.log(m,"\u4F4D\u7F6E\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A"),A.terrainCutting(m)})};M2.prototype.terrainCutting=function(o){let A=this;A._terrainFlatten.addPolygon(o),A._terrainFlatten.update(),A._terrainFlatten.clipPlaneOfFlatten=!0};M2.prototype.removeTerrainCutting=function(){this._terrainFlatten.clearPolygon()};M2.prototype.removeFromMap=function(){if(this.removeMeasureFromMap(),this.FlattenPolygon&&this.FlattenPolygon.length>0){for(let o=0;o<this.FlattenPolygon.length;o++)this._viewer.entities.remove(this.FlattenPolygon[o]);this.FlattenPolygon=[]}this.removeTerrainCutting()};M2.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=this.loadingImg,o.appendChild(A),this.loading=o,this._viewer.container.appendChild(o)};M2.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};M2.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};var xAt=M2;function mw(o,A={}){this._earthCtrl=o,this._terrainFlatten=new _N(this._earthCtrl.coreMap.scene),this._viewer=o.coreMap,this._scene=o.coreMap.scene,this.options=Ae(A,{}),this._Tooltip=new pw(o),this._tooltip=this._Tooltip.CreateTooltip(),this._drawColor={point:Ae(this.options.drawColor?.point,At.BLUE),polyline:Ae(this.options.drawColor?.polyline,At.YELLOW),polygon:Ae(this.options.drawColor?.polygon,At.YELLOW.withAlpha(.5))},this.loadingImg=`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`,this.wallArr=[],this.FlattenPolygon=[],this._Apositions=[],this._heightsort=null,this._deepth=100,this._positions=[],this._modelArr=Ae(A.modelArr,[]),this._isFlattening=Ae(A.isFlattening,!0),this.modelCuttingPolygon=null,this.wallImgUrl=Ae(A.wallImgUrl,null),this.bottomImgUrl=Ae(A.bottomImgUrl,null),this._Loading=Ae(A.loading,!0)}mw.prototype.removeMeasureFromMap=function(){this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=void 0),this.Triangulation=[],this.tinData=void 0,this._tooltip.show(!1)};mw.prototype.removeFromMap=function(){if(this.removeMeasureFromMap(),this.wallArr.length>0){for(let o=0;o<this.wallArr.length;o++)this._viewer.entities.remove(this.wallArr[o]);this.wallArr=[]}if(this.FlattenPolygon&&this.FlattenPolygon.length>0){for(let o=0;o<this.FlattenPolygon.length;o++)this._viewer.entities.remove(this.FlattenPolygon[o]);this.FlattenPolygon=[]}this.removeModelCutting()};mw.prototype.deleteObject=mw.prototype.removeFromMap;mw.prototype.startDrawing=function(o={},A){let f=Ae(o.spacing,"auto"),m=this._scene,C=this._tooltip,y=3,x=this._positions,v=[],E;this._Apositions=o.positions,this._heightsort=v,this._deepth=Ae(o.deepth,100),this._sampleStep=Ae(o.sampleStep,100),this._maxSampleCount=Ae(o.maxSampleCount,200),this._drawColor.point=o.point||this._drawColor.point,this._drawColor.polyline=o.polyline||this._drawColor.polyline,this._drawColor.polygon=o.polygon||this._drawColor.polygon,this.loadingImg=o.loading||this.loadingImg;let I=this;if(this._mouseHandler&&this._mouseHandler.destroy(),this.loading||this.addLoading(),!o.positions){let w=new Ur(m.canvas);this._mouseHandler=w,this.removeMeasureFromMap(),this._viewer.container.style.cursor=`url(${globalThis.GEOWORLD_BASE_URL} 'Assets/image/cursor/draw.cur')`;let Q;w.setInputAction(function(B){if(B.position!==null){let T=this._viewer.scene.pickPosition(B.position);if(T){let D=Kt.fromCartesian(T);if(x.length===0&&(x.push(D),E=T),x.length>=4){let F=Ss.wgs84ToWindowCoordinates(this._viewer.scene,E);if(F!==void 0){let L=F.x-B.position.x,R=F.y-B.position.y;if(L*L+R*R<16){x.splice(x.length-2,2),this.stopDrawing(A);return}}}x.push(D),x.length===2&&!Q&&(Q=this._viewer.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new Bn(function(){let F=[];for(let L=0;L<x.length;L++){let R=x[L];F.push(R.longitude,R.latitude,R.height)}return ee.fromRadiansArrayHeights(F)},!1),clampToGround:!1,material:I._drawColor.polygon,width:3}})),x.length===y&&(Q&&this._viewer.entities.remove(Q),this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:new Bn(()=>{let F=[];for(let L=0;L<x.length;L++){let R=x[L];F.push(R.longitude,R.latitude,R.height)}return new Un(ee.fromRadiansArrayHeights(F))},!1),material:I._drawColor.polygon,fill:!0}}))}}}.bind(this),Ki.LEFT_CLICK),w.setInputAction(function(B){let T=B.endPosition;if(T!==null)if(x.length===0)C.showAt(T,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7B2C\u4E00\u4E2A\u70B9");else{let D=this._viewer.scene.pickPosition(T);if(D){let F=Kt.fromCartesian(D);if(x.splice(x.length-1,1),x.push(F),C.showAt(T,"\u53F3\u952E\u7ED3\u675F\u7ED8\u5236"),x.length>=3&&x.length>=4){let L=Ss.wgs84ToWindowCoordinates(this._viewer.scene,E);if(L!==void 0){let R=L.x-T.x,k=L.y-T.y;R*R+k*k<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}}.bind(this),Ki.MOUSE_MOVE);let M=null;w.setInputAction(function(B){M=window.setTimeout(()=>{console.log("\u5355\u51FB"),this.end&&this.end()},200)}.bind(this),Ki.RIGHT_CLICK),w.setInputAction(function(B){console.log("\u53CC\u51FB......"),clearTimeout(M)},Ki.LEFT_DOUBLE_CLICK),this.end=B=>{if(this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),I._viewer.container.style.cursor="default",this._tooltip.show(!1),Q&&this._viewer.entities.remove(Q),this.end=void 0,!(x.length<y)){if(this._prevEntity&&this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0,B==="cancel")return;for(let T=0;T<x.length;T+=2){let D=x[T].height;v.push(D)}this._Apositions=x,this.stopDrawing(f,A)}}}return this};function gLi(o,A,f){let m=je.lerp(o.longitude,A.longitude,1/f)-o.longitude,C=je.lerp(o.latitude,A.latitude,1/f)-o.latitude,y=[];y.push(o);for(let x=0;x<f;x++){let v=o.longitude+(x+1)*m,E=o.latitude+(x+1)*C;y.push(new Kt(v,E))}return y.push(A),y}function pLi(o,A,f,m,C){let y=[];A.forEach(function(x){let v=Kt.toCartesian(new Kt(x.longitude,x.latitude,m)),E=Kt.toCartesian(new Kt(x.longitude,x.latitude,f)),I=ee.normalize(ee.subtract(E,v,new ee),new ee),w=new ls(v,I),Q=null,M=[],B=o.scene.drillPickFromRay(w,1,M);o.scene.globe.show=!1,B.length>0&&!B[0].object&&B[0].position?(Q=o.scene.drillPickFromRay(w,100,M),Q.unshift(B[0])):Q=o.scene.drillPickFromRay(w,100,M),o.scene.globe.show=!0,y.push(Q)}),typeof C=="function"&&C(y)}function mLi(o,A,f){for(let y=0;y<o.length;y++){let x=o[y];for(let v=0;v<x.length;v++){let E=x[v].position,I=Kt.fromCartesian(E);if(I.height<A){x.splice(v,x.length-v);let w=ee.fromRadians(I.latitude,I.longitude,A);x.push({object:null,position:w});break}}{let v=x[x.length-1].position,E=Kt.fromCartesian(v);if(Math.abs(E.height-A)>.01){let I=ee.fromRadians(E.latitude,E.longitude,A);x.push({object:null,position:I})}}{let v=x[x.length-1].position,E=Kt.fromCartesian(v);console.log("di",E.height)}}for(let y=0;y<o.length;y++){let x=o[y],v=x[x.length-1];f.push(v.position)}let m=0;o.forEach(function(y){m=m<y.length?y.length:m}),o.forEach(function(y){if(m-y.length>0){let v=y.length;y.length=m,y.fill(null,v,y.length)}});let C=[];for(let y=0;y<m-1;y++){let x=[],v=[];for(let E=0;E<o.length;E++){let I=o[E][y],w=o[E][y+1];I&&w&&(x.push(I),v.push(w))}C.push({ups:x,bottoms:v})}return C}mw.prototype.stopDrawing=function(o,A){let f=this;this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._Loading&&this.isLoading(!0);let m=this._positions,C=this._viewer,y=this.wallArr,x=this._deepth,v=this._sampleStep,E=this._maxSampleCount;m.push(m[0]);let I=0;for(let w=0;w<m.length-1;w++){let Q=ee.fromRadians(m[w].longitude,m[w].latitude,m[w].height),M=ee.fromRadians(m[w+1].longitude,m[w+1].latitude,m[w+1].height),T=ee.distance(M,Q)/v;I=I<T?T:I}I=E<I?E:I,I=260,setTimeout(()=>{f._heightsort.sort(function(D,F){return D-F});let w=f._heightsort[0]+2e3,Q=f._heightsort[0]-2e3,M=[];for(let D=0;D<m.length-1;D++){let F=m[D],L=m[D+1],R=gLi(F,L,I);pLi(C,R,Q,w,function(k){let U=mLi(k,x,M);for(let V=0;V<U.length;V++){let H=U[V];y.push(CLi(C,H,V))}})}let B=[];for(let D=0;D<m.length;D++){let F=m[D];B.push(F.longitude,F.latitude,x)}let T=C.entities.add({polygon:{hierarchy:{positions:ee.fromRadiansArrayHeights(B)},perPositionHeight:!0,granularity:je.RADIANS_PER_DEGREE*100,material:new V0({image:`${globalThis.GEOWORLD_BASE_URL}Workers/image/bottomplane.jpg`,repeat:new It(1,1)}),fill:!0}});return y.push(T),f._isFlattening&&f.modelCutting(),A&&A(!0),this.isLoading(!1)},20)};mw.prototype.modelCutting=function(){let o=this,A=this._deepth,f=this._positions,m=[],C=[];for(let y=0;y<f.length;y++){let x=f[y];m.push(x.longitude,x.latitude,x.height-10),C.push(je.toDegrees(x.longitude),je.toDegrees(x.latitude),x.height-10)}if(o._modelCuttingPolygon=rh.fromPositions({positions:ee.fromRadiansArrayHeights(m),height:A-10}),o._terrainFlatten.addPolygon(C),o._terrainFlatten.update(),o._terrainFlatten.clipPlaneOfFlatten=!0,o._modelArr.length>0)for(let y of o._modelArr)y.addFlattenPolygon(o._modelCuttingPolygon),y.needUpdateFlatten=!0,y.clipPlaneOfFlatten=!0;else console.info("\u8BF7\u6DFB\u52A0\u6A21\u578B\uFF01")};mw.prototype.removeModelCutting=function(){let o=this;if(o._modelArr.length>0){for(let A of o._modelArr)A.removeFlattenPolygon(o._modelCuttingPolygon);o._modelCuttingPolygon=null,o._modelArr=[],o._terrainFlatten.clearPolygon(),o._terrainFlatten.clipPlaneOfFlatten=!1}else console.info("\u8BF7\u6DFB\u52A0\u6A21\u578B\uFF01")};function CLi(o,A,f){let m=[],C=[];for(let I=0;I<A.ups.length;I++){let w=A.ups[I];m.push(w.position);let Q=Kt.fromCartesian(w.position);C.push(Q.height)}let y=[];for(let I=0;I<A.bottoms.length;I++){let w=A.bottoms[I],Q=Kt.fromCartesian(w.position);y.push(Q.height)}let x=`${globalThis.GEOWORLD_BASE_URL}Workers/image/MTY0001.jpg`,v=`${globalThis.GEOWORLD_BASE_URL}Workers/image/MTY0002.jpg`,E=o.entities.add({wall:{positions:m,material:new V0({image:f%2?x:v,repeat:new It(.01,.01)}),maximumHeights:C,minimumHeights:y,granularity:je.RADIANS_PER_DEGREE*100}});return E.show=!0,E}mw.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=this.loadingImg,o.appendChild(A),this.loading=o,this._viewer.container.appendChild(o)};mw.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};mw.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};var vAt=mw;function id(o){this._earthCtrl=o,this._coreMap=o.coreMap,this.tools=[],this.vols=[],this.saveResult=!1}id.prototype.getDistanceSpace=function(o){this.saveResult===!1&&this.deleteObject(),this._tool=new FW(this._earthCtrl),this._tool.spaceDistance(o),this.tools.push(this._tool)};id.prototype.getDistanceHorizontal=function(o){this.saveResult===!1&&this.deleteObject(),this._tool=new FW(this._earthCtrl),this._tool.horizontalDistance(o),this.tools.push(this._tool)};id.prototype.deleteObject=function(){O(this._tool)&&this._tool.deleteObject(),this.saveResult===!1&&this.tools.pop()};id.prototype.deleteAll=function(){this.tools.forEach(function(o){o.deleteObject()}),this.vols.forEach(function(o){o.cleanUp()}),this._earthCtrl.measure.tools.forEach(function(o){o.clearResult()}),this.tools=[],this.vols=[],this._earthCtrl.measure.tools=[]};id.prototype.saveResults=function(o){this.saveResult=o};id.prototype.getPlaneArea=function(o){this.saveResult===!1&&this.deleteObject(),this._tool=new FW(this._earthCtrl),this._tool.getPlaneArea(o),this.tools.push(this._tool)};id.prototype.getSurfaceArea3d=function(o){this.saveResult===!1&&this.deleteObject(),this._tool=new FW(this._earthCtrl),this._tool.getSurfaceArea3d(o),this.tools.push(this._tool)};id.prototype.volumetric=function(o){this.saveResult===!1&&this.removeVolumetric(),this._vol=new KTe(this._earthCtrl),this._vol.startDrawing(o),this.vols.push(this._vol)};id.prototype.removeVolumetric=function(o){O(this._vol)&&this.vols.forEach(function(A){A.cleanUp()})};id.prototype.lineOfSight=function(o){this._tool=new mAt(this._earthCtrl),this._tool.createLineOfSight(o),this.tools.push(this._tool)};id.prototype.createViewShed=function(o){return new HTe(this._earthCtrl,o)};id.prototype.createSubmergence=function(o){return new YTe(this._earthCtrl,o)};id.prototype.createProfile=function(o){return new jTe(this._earthCtrl,o)};id.prototype.createBufferAnalysis=function(o){return new zre(this._earthCtrl,o)};id.prototype.createSkyline=function(o){return new qTe(this._earthCtrl,o)};id.prototype.createCurtainContrast=function(o){return new hAt(this._earthCtrl,o)};id.prototype.createRestrictTheHeight=function(o){return new ZTe(this._earthCtrl,o)};id.prototype.createModifyMesh=function(o,A){return new $Te(this._earthCtrl).addClipping(o,A)};id.prototype.createTerrainModifier=function(o){return new iMe(this._earthCtrl,o)};id.prototype.createTerrainExcavation=function(o){return new aMe(this._earthCtrl,o)};id.prototype.createExcavationAndFillAnalysis=function(o){return new wse(this._earthCtrl,o)};id.prototype.createVolumetricMeasure=function(o){return new pAt(this._earthCtrl,o)};id.prototype.createModelVolumetric=function(o){return new CAt(this._earthCtrl,o)};id.prototype.createModelCutting=function(o){return new yAt(this._earthCtrl,o)};id.prototype.createTerrainCutting=function(o){return new xAt(this._earthCtrl,o)};id.prototype.createModelSection=function(o){return new vAt(this._earthCtrl,o)};var sMe=id;function Qse(o,A){if(this._earthCtrl=o,!O(A.flagHtml))throw new Ui("flagDiv is required.");this._flagHtml=A.flagHtml,this._options=Ae(A,Ae.EMAIL),this._circleRadius=Ae(A.circleRadius,10),this._lon=Ae(A.lon,121),this._lat=Ae(A.lat,31),this._height=Ae(A.height,0),this._show=Ae(A.show,!0),this._flagScale=Ae(A.flagScale,4),this._circleColor=Ae(A.circleColor,At.RED),this._cylinderColor=Ae(A.cylinderColor,At.YELLOWGREEN),this._duration=Ae(A.duration,2e3),this._gradient=Ae(A.gradient,2),this._count=Ae(A.count,2),this._canvasZoom=Ae(A.canvasZoom,10),this._circleEntity=void 0,this._cylinderEntity=void 0,this._lineEntity=void 0,this._htmlPlaneEntity=void 0,this._linePlaneEntity=void 0,this._flagDiv=document.createElement("div"),this._flagDiv.style.opacity="0.7",this._flagDiv.style.margin="0",this._flagDiv.style.padding="0",this._flagDiv.id=Ae(A.id,Vu()),this._flagDiv.innerHTML=this._flagHtml,this._show&&this.addToMap()}Qse.prototype.removeFromMap=function(){O(this._circleEntity)&&(this._earthCtrl.entities.remove(this._circleEntity),this._circleEntity=void 0),O(this._cylinderEntity)&&(this._earthCtrl.entities.remove(this._cylinderEntity),this._cylinderEntity=void 0),O(this._lineEntity)&&(this._earthCtrl.entities.remove(this._lineEntity),this._lineEntity=void 0),O(this._linePlaneEntity)&&(this._earthCtrl.entities.remove(this._linePlaneEntity),this._linePlaneEntity=void 0),O(this._htmlPlaneEntity)&&(this._earthCtrl.entities.remove(this._htmlPlaneEntity),this._htmlPlaneEntity=void 0)};Qse.prototype.addToMap=function(){let o=this,A=0,f=2,m,C=ee.fromDegrees(o._lon,o._lat,o._height);if(O(o._circleEntity)||(o._circleEntity=o._earthCtrl.entities.add({position:C,ellipse:{height:o._height,semiMinorAxis:o._circleRadius,semiMajorAxis:o._circleRadius,material:new Z8({duration:o._duration,gradient:o._gradient,color:o._circleColor,count:o._count})}})),!O(o._cylinderEntity)){let v=o._circleRadius*2/5,E=o._circleRadius*3/4;m=fQ.changeCartesian3Height(C,E/2),o._cylinderEntity=o._earthCtrl.entities.add({position:m,cylinder:{length:E,topRadius:v,bottomRadius:v,fill:!0,outline:!1,material:o._cylinderColor}})}if(O(o._lineEntity)||(A=o._circleRadius*o._flagScale+o._height,o._lineEntity=o._earthCtrl.entities.add({polyline:{width:f,positions:ee.fromDegreesArrayHeights([o._lon,o._lat,o._height,o._lon,o._lat,A]),material:o._cylinderColor}})),!O(o._htmlPlaneEntity)){A=o._circleRadius*o._flagScale;let v=A/5,E=v*3,I=A-v/2,w=4*f,Q=new ee(w/2,0,I),M=fQ.changeCartesian3ByScalar(C,Q);this._linePlaneEntity=o._earthCtrl.entities.add({position:M,plane:{plane:new Wa(ee.UNIT_Y,0),dimensions:new It(w,v),material:o._cylinderColor}});let B=new ee(E/2+w,0,I);m=fQ.changeCartesian3ByScalar(C,B);let T=o._flagDiv,D=o._canvasZoom,F=document.createElement("canvas");F.width=10*v/E*D,F.height=10*D,lH.drawDocument(T,F,{zoom:D}).then(function(L){o._htmlPlaneEntity=o._earthCtrl.entities.add({position:new Bn(y,!1),plane:{plane:new Bn(x,!0),dimensions:new It(E,v),material:new V0({image:L.image,transparent:!0})}})},function(L){console.info(L)})}function y(){return m}function x(){let v=new ee;return v=ee.negate(ee.UNIT_Y,v),new Wa(v,0)}};Object.defineProperties(Qse.prototype,{});var EAt=Qse;function Sse(o,A){this._earthCtrl=o,this._scene=o.coreMap.scene,this._options=O(A,Ae.EMPTY_OBJECT),this._color=Ae(A.color,At.RED),this._lon=Ae(A.lon,121),this._lat=Ae(A.lat,31),this._height=Ae(A.height,0),this._statistics=Ae(A.statisticData,1e3),this._radius=Ae(A.radius,100),this._duration=Ae(A.duration,2e3),this._gradient=Ae(A.gradient,2),this._count=Ae(A.count,2),this._scale=Ae(A.dataScale,1),this._show=Ae(A.show,!0),this._billboardWidthRatio=Ae(A.billboardWidthRatio,1.2),this._billboardHeightRatio=Ae(A.billboardHeightRatio,2.4),this._prefix=Ae(A.prefix,""),this._scaleByDistance=Ae(A.scaleByDistance,new To(1500,3,15e3,.1)),this._topFillColor=Ae(A.topFillColor,At.fromCssColorString("#323232")),this._circleEntity=void 0,this._cylinderEntity=void 0,this._billboardEntity=void 0,this._position=ee.fromDegrees(this._lon,this._lat,this._height),this._show&&this.addToMap()}var RN=new ee;Sse.prototype.addToMap=function(){let o=this;if(O(o._circleEntity)||(o._circleEntity=o._earthCtrl.entities.add({position:o._position,ellipse:{height:o._height,semiMinorAxis:o._radius,semiMajorAxis:o._radius,material:new Z8({duration:o._duration,gradient:o._gradient,color:o._color,count:o._count})}})),!O(o._cylinderEntity)){RN=ee.clone(o._position,RN);let A=o._statistics*o._scale,f=Vn.eastNorthUpToFixedFrame(RN),m=new ee(0,0,A/2);Xe.multiplyByPoint(f,m,RN),o._cylinderEntity=o._earthCtrl.entities.add({position:RN,cylinder:{length:A,topRadius:o._radius/10,bottomRadius:o._radius/10,fill:!0,outline:!1,material:o._color}})}if(!O(o._billboardEntity)){RN=ee.clone(o._position,RN);let A=o._cylinderEntity.cylinder.length._value,f=Kt.fromCartesian(RN),m=ee.fromRadians(f.longitude,f.latitude,f.height+A);o._billboardEntity=o._earthCtrl.entities.add({position:m,billboard:{scaleByDistance:o._scaleByDistance,verticalOrigin:bn.BOTTOM,width:o._radius/o._billboardWidthRatio,height:o._radius/o._billboardHeightRatio,image:vLi(o._color,o._topFillColor,o._prefix+o._statistics,o._radius).toDataURL()}})}};Sse.prototype.removeFromMap=function(){O(this._cylinderEntity)&&(this._earthCtrl.entities.remove(this._cylinderEntity),this._cylinderEntity=void 0),O(this._circleEntity)&&(this._earthCtrl.entities.remove(this._circleEntity),this._circleEntity=void 0),O(this._billboardEntity)&&(this._earthCtrl.entities.remove(this._billboardEntity),this._billboardEntity=void 0)};function yLi(o,A,f,m){o.save(),o.strokeStyle="rgba(0,0,0,0)",o.scale(m/150,m/100),o.save(),o.fillStyle=A.toCssColorString(),o.lineWidth=4,o.beginPath(),o.moveTo(77.8,82.1),o.lineTo(64.6,69),o.lineTo(23.8,69),o.bezierCurveTo(20.8,69,18.3,66.5,18.3,63.5),o.lineTo(18.3,22.5),o.bezierCurveTo(18.3,19.5,20.8,17,23.8,17),o.lineTo(131.8,17),o.bezierCurveTo(134.8,17,137.3,19.5,137.3,22.5),o.lineTo(137.3,63.5),o.bezierCurveTo(137.3,66.5,134.8,69,131.8,69),o.lineTo(90.9,69),o.lineTo(77.8,82.1),o.closePath(),o.moveTo(23.8,18),o.bezierCurveTo(21.3,18,19.3,20,19.3,22.5),o.lineTo(19.3,63.5),o.bezierCurveTo(19.3,66,21.3,68,23.8,68),o.lineTo(65,68),o.lineTo(77.7,80.7),o.lineTo(90.5,68),o.lineTo(131.8,68),o.bezierCurveTo(134.3,68,136.3,66,136.3,63.5),o.lineTo(136.3,22.5),o.bezierCurveTo(136.3,20,134.3,18,131.8,18),o.lineTo(23.8,18),o.closePath(),o.fill(),o.stroke(),o.restore(),o.save(),o.fillStyle=f.toCssColorString(),o.beginPath(),o.moveTo(131.8,18),o.lineTo(23.80000000000001,18),o.bezierCurveTo(21.30000000000001,18,19.30000000000001,20,19.30000000000001,22.5),o.lineTo(19.30000000000001,63.5),o.bezierCurveTo(19.30000000000001,66,21.30000000000001,68,23.80000000000001,68),o.lineTo(65,68),o.lineTo(77.7,80.7),o.lineTo(90.5,68),o.lineTo(131.8,68),o.bezierCurveTo(134.3,68,136.3,66,136.3,63.5),o.lineTo(136.3,22.5),o.bezierCurveTo(136.3,20,134.2,18,131.8,18),o.closePath(),o.fill(),o.stroke(),o.restore(),o.restore()}function xLi(o,A,f){let m=f/1.4,C=m,y=m;A.width>A.height?y=m*(A.height/A.width):A.width<A.height&&(C=m*(A.width/A.height));let x=f/150*8,v=Math.round((f-C+x)/2),E=Math.round((5/6*f-y)/2);o.drawImage(A,v,E,C,y)}function vLi(o,A,f,m){let C=document.createElement("canvas");C.width=m,C.height=m;let y=C.getContext("2d");yLi(y,o,A,m);let x=m,v=N5(f,{font:`bold ${x}pt Microsoft YaHei`,fillColor:o});return xLi(y,v,x),C}Object.defineProperties(Sse.prototype,{billboard:{get:function(){return this._billboardEntity}},cylinder:{get:function(){return this._cylinderEntity}},circle:{get:function(){return this._circleEntity}},show:{get:function(){return this._show},set:function(o){O(this._billboardEntity)&&(this._billboardEntity.show=o),O(this._cylinderEntity)&&(this._cylinderEntity.show=o),O(this._circleEntity)&&(this._circleEntity.show=o)}}});var IAt=Sse;function lMe(o,A){if(this._earthCtrl=o,this._scene=o.coreMap.scene,this._options=Ae(A,Ae.EMPTY_OBJECT),this._color=Ae(A.color,At.RED),this._lon=Ae(A.lon,121),this._lat=Ae(A.lat,31),this._height=Ae(A.height,0),this._show=Ae(A.show,!0),this._containerWidth=Ae(A.containerWidth,200),this._containerHeight=Ae(A.containerHeight,200),this._containerColor=Ae(A.cylinderColor,At.YELLOWGREEN),this._canvasZoom=Ae(A.canvasZoom,10),this._scaleByDistance=Ae(A.scaleByDistance,new To(1500,3,15e3,.1)),this._tipsHtml=A.tipsHtml,this._tipsEntity=void 0,this._tipsDiv=document.createElement("div"),this._tipsDiv.style.opacity="0.7",this._tipsDiv.style.margin="0",this._tipsDiv.style.padding="0",this._tipsDiv.id=Ae(A.id,Vu()),this._tipsDiv.innerHTML=this._tipsHtml,!O(A.tipsHtml))throw new Ui("tipsHtml is required.");this.addToMap()}lMe.prototype.removeFromMap=function(){O(this._tipsEntity)&&(this._earthCtrl.entities.remove(this._tipsEntity),this._tipsEntity=void 0),O(this._tipsDiv)&&(this._earthCtrl.entities.remove(this._tipsDiv),this._tipsDiv=void 0)};lMe.prototype.addToMap=function(){let o=this,A=ee.fromDegrees(o._lon,o._lat,o._height);if(!O(o._tipsEntity)){let m=o._containerHeight,C=o._containerWidth,y=o._canvasZoom,x=o._tipsDiv,v=document.createElement("canvas");v.width=C,v.height=m,lH.drawDocument(x,v,{zoom:y}).then(function(E){o._tipsEntity=o._earthCtrl.entities.add({position:new Bn(f,!1),billboard:{scaleByDistance:o._scaleByDistance,verticalOrigin:bn.BOTTOM,width:C,height:m,image:E.image.src}})},function(E){console.info(E)})}function f(){return A}};var _At=lMe;function WO(o,A){this._earthCtrl=o,this._scene=o.coreMap.scene,this._options=Ae(A,Ae.EMPTY_OBJECT),this.element=document.createElement("div"),this._html=Ae(A.html,""),this._lon=Ae(A.lon,121),this._lat=Ae(A.lat,31),this._height=Ae(A.height,10),this._show=Ae(A.show,!0),this._removeHandler=void 0,this._pos=void 0,this._position=void 0,this._c=void 0,this._changedC=void 0,this._point=void 0,this._parameter=A,this._rtti="GwScreenDialog",this.isInit=!1,this.isInit===!1&&this.addToMap()}WO.prototype.setHtml=function(o){this.element.innerHTML=o};WO.prototype.setShow=function(o){if(!this.isInit)return 0;this.element.style.display=o?"block":"none"};WO.prototype.showAt=function(){if(!this.isInit)return 0;this._position&&(this._pos=Ss.wgs84ToWindowCoordinates(this._scene,this._position),this._pos&&(this.element.style.left=`${this._pos.x}px`,this.element.style.top=`${this._pos.y}px`))};WO.prototype.removeFromMap=function(){this.element.remove(),this.isInit=!1};WO.prototype.addToMap=function(){if(this.isInit)return 0;nA(".map-widget",this.element),this.element.innerHTML=this._html,this.element.style.position="absolute",this.isInit=!0,this._position=ee.fromDegrees(this._lon,this._lat,this._height),this.showAt(),this._c=new It(this._pos.x,this._pos.y);let o=this;this._scene.camera.moveStart.addEventListener(function(){o._removeHandler=o._scene.postRender.addEventListener(function(){if(o._c){let A=new L5(Di.WGS84,o._earthCtrl.camera._camera.position);A&&o._position&&(A.isPointVisible(o._position)===!1?o.setShow(!1):(o._show===!0&&o.setShow(!0),o._changedC=Ss.wgs84ToWindowCoordinates(o._scene,o._position),o._changedC?(o._c=o._changedC,o.showAt()):o.setShow(!1)))}})}),this._scene.camera.moveEnd.addEventListener(function(){o._removeHandler&&o._removeHandler.call()})};Object.defineProperties(WO.prototype,{show:{get:function(){return this._show},set:function(o){this._show!==o&&(this._show=o,this.setShow(o))}},html:{get:function(){return this._html},set:function(o){this._html!==o&&(this._html=o,this.setHtml(o))}},lon:{get:function(){return this._lon},set:function(o){this._lon!==o&&(this._lon=o,this._position=ee.fromDegrees(this._lon,this._lat,this._height),this.showAt())}},lat:{get:function(){return this._lat},set:function(o){this._lat!==o&&(this._lat=o,this._position=ee.fromDegrees(this._lon,this._lat,this._height),this.showAt())}},height:{get:function(){return this._height},set:function(o){this._height!==o&&(this._height=o,this._position=ee.fromDegrees(this._lon,this._lat,this._height),this.showAt())}}});var BAt=WO;function kW(o){this._earthCtrl=o,this._coreMap=o.coreMap}kW.prototype.createStatisticFlag=function(o){return new EAt(this._earthCtrl,o)};kW.prototype.createStatisticCylinder=function(o){return new IAt(this._earthCtrl,o)};kW.prototype.createTipsContainer=function(o){return new _At(this._earthCtrl,o)};kW.prototype.createScreenDialog=function(o){return new BAt(this._earthCtrl,o)};var wAt=kW;function Dse(){var o=["getKeyRecoveryParam","curveType","Input not Buffer","map","_ipad","b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef","setAutoPadding","rejected",'{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}',"dir","transform","ERR_UNKNOWN_ENCODING","mulf","Apr","_verify2","tmp","EncoderBuffer","password","raw","isBoxedPrimitive","onRuntimeInitialized","seqof","addn","sqlite3_bind_double","sum32_5","000000000000000000","bufferedRequest","non-byte EncoderBuffer value","set","ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","_countBits","assign","publicKey","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758","privateExponent","fired","root","isString","invalid sig","WeakMap","modulus must be greater than 1","_sqlite3_result_int64","-e4437ed6010e88286f547fa90abfe4c3","onend","modelDbModelIdList","The argument '","5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b","save","arrayBufferBlockCount","sum64_5_hi","notStrictEqual","sqlite3_column_blob","entry","c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","utf8","c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","readableListening","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865","/dev/stdin","clock","Password","codes","exitKey","a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","SetModelStoreyTransform","fromRed works only with numbers in reduction context","callbackify","e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","worldDirection","494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","byteLength","spread","kdeparams","canvas","7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","_final","not ","createDecipher","chdir","6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c","[object HTMLCollection]","_sqlite3_changes","dataStoreArrayBuffer","Trace","shim","isArgumentsObject","'name' must be a string","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58","isBuf","falling back to ArrayBuffer instantiation","Index out of range","call","[object Object]","emitter","tagged","rsa",'Failed to peek tag: "',"content","Attempt to access memory outside buffer bounds","eject","ERR_FR_TOO_MANY_REDIRECTS","exists","da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","pipe","String","boolean","Rand","_decodeTag","getHighWaterMark","3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","ERR_BUFFER_OUT_OF_BOUNDS","getCiphers","callee","2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06","serialNumber","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc","tinv","ineg","bool","0x8000000000000000","%Object.getOwnPropertyDescriptor%","00000000000000000","sync","maj32",". Build with -s ASSERTIONS=1 for more info.","0x7fffffffffffffff","search","iterator","readInt16LE","0000000000000","ECONNABORTED","join32","d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","imuln","zeroBits","acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","mtime","setRequestHeader","Instance","9333177ztxjEH","imul","worldUp","\x1B[31m"," [Function","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3","utils","toNumber","Number","heartbeat","ended","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375","isNull","stream","ixor","_importPublic","da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","outSize","path=","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589","hmacStrength","trying to set auth tag in unsupported state","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d","fillLast",'"buf" argument must be a Buffer or Uint8Array',"Jul","fromSecret","ETIMEDOUT","content-length","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e","notStrictEqualObject","aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","746590PyDowD","subjectPrivateKey","emitClose","writing","_secret","___errno_location"," ** ","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8","Number is too big","Function","_decode"," and <= ","4446261rhToce","RDNSequence","shift","numstr","oneC","Cancel","readingMore","BasePoint","52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","simpleSieve","getDivisor","charstr","a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","_events","SaveShell","Premature close","/dev/shm","176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ms exceeded","_sqlite3_open",'" argument must be of type number. Received type ',"recoveryParam","HEAP32","00000000000000000000000","onlyShowShells","persEnc","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8","revBin","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573","config","des-ede3","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e","allowHalfOpen","Not implemented yet","copy","computeSecret","Cipher","d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","handlers","Digest already called",`
uniform sampler2D colorTexture;
uniform sampler2D depthTexture;
// in vec2 v_textureCoordinates;
public/config/config.js
@@ -3,8 +3,8 @@
//是否为生产环境
const webUrl = location.href.indexOf("/web") > -1 ? "/web" : "";
// var webHost = isWeb ? "103.85.165.99" + ":28888" :  '106.120.22.35' + ":28888";
var webHost = isWeb ? "103.85.165.99" + ":28888" : '192.168.20.83' + ":8888";
var webHost = isWeb ? "103.85.165.99" + ":28888" :  '106.120.22.35' + ":28888";
// var webHost = isWeb ? "103.85.165.99" + ":28888" : '192.168.20.83' + ":8888";
// var webHost = isWeb ? "103.85.165.99" + ":28888" : '100.10.1.169' + ":8088";
// WebSocket 服务地址
var socketUrl = 'ws://' + webHost + '/MoonServer/ws/select';
public/index.html
@@ -2,23 +2,27 @@
<html lang="">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width,initial-scale=1.0">
  <!-- <link rel="icon" href="<%= BASE_URL %>favicon.ico"> -->
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0,minimum-scale=1,maximum-scale=1" />
  <meta name="apple-touch-fullscreen" content="yes" />
  <meta name="apple-mobile-web-app-capable" content="yes" />
  <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  <meta name="format-detection" content="telephone=no" />
  <meta name="x5-fullscreen" content="true" />
  <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
  <title>
    <%= htmlWebpackPlugin.options.title %>
  </title>
  <link rel="stylesheet" href="./WebSDK/WebSDK.min.css">
  <script src="./WebSDK/Assets/jquery-2.0.3.js"></script>
  <script src="./WebSDK/WebSDK.min.js"></script>
  <script src="./OL/ol.js"></script>
  <link href="./OL/ol.css" rel="stylesheet" />
  <script src="./OL/proj4.js"></script>
  <link rel="stylesheet" href="./SmartEarthSDK/Workers/layui/css/layui.css">
  <link rel="stylesheet" href="./WebSDK/WebSDK.min.css">
  <script src="./WebSDK/Assets/jquery-2.0.3.js"></script>
  <script src="./WebSDK/WebSDK.min.js"></script>
  <script src="proj4/proj4.js"></script>
  <script src="./config/config.js"></script>