surprise
2023-12-29 18377dc5d61caf3a6a0835e17015ac2601f8709d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<!DOCTYPE html>
<html>
 
<head>
    <meta charset="UTF-8">
    <title>模型压平分析</title>
    <link href="../SmartEarthSDK/Workers/layui/css/layui.css" rel="stylesheet" />
    <style type="text/css">
        html,
        body {
            overflow: hidden;
        }
 
        .layui-input {
            width: 96px !important;
            background-color: #fff !important;
            margin-top: 8px;
            display: inline-block;
        }
 
        .layui-form-label {
            font-weight: bold !important;
            font-size: 15px;
        }
 
        .layui-form-label {
            margin: 8px 0 0 -26px;
            width: 130px;
            text-align: left;
        }
 
        .layui-input-block {
            margin-left: 14px;
        }
 
        .layui-form-item {
            width: 98% !important;
        }
 
        .layui-btn {
            padding: 0 12px;
            margin-left: 10px;
            background-color: rgba(0, 168, 255, 0.16) !important;
        }
    </style>
</head>
 
<body>
    <form class="layui-form" action="">
        <div class="layui-form-item" style="width: 240px; margin-top: 8px;">
            <label class="layui-form-label AutoSize:=false;"
                style=" width: 90px;margin-left: 10px;margin-top: 8px;color: white;">压平高度(米)</label>
            <div class="layui-input-inline">
                <input id="deep" value="10" type="number" lay-verify="pass" autocomplete="off" placeholder="请输入压平高度"
                    class="layui-input ">
                <button type="button" id="drawDig" class="layui-btn  layui-btn-normal" lay-submit lay-filter="formDemo">开始分析</button>
            </div>
 
        </div>
    </form>
    <script src="../jquery-2.0.3.js"></script>
    <script src="../SmartEarthSDK/Workers/layui/layui.js"></script>
    <script>
        var sgworld = parent.sgworld;
        var layer = parent.layer;
        var positions;
        // layer.msg('此功能暂不支持绘制凹多边形!');
        var deepVal = $('#deep').val();
        $('#deep').on('input propertychange', function (event) {
            deepVal = parseFloat($(this).val());
            if (!isNaN(deepVal) && positions) {
                sgworld.ModelFlattening = sgworld.Creator.createModelModifier("模型压平", positions, deepVal, {});
            }
        })
        $('#drawDig').on('click', function () {
            deepVal = parseFloat($('#deep').val());
            if (isNaN(deepVal)) {
                parent.layui.use('layer', function () {
                    var layer = parent.layui.layer;
                    layer.msg('请输入数字');
                });
            } else {
                // parent.SmartEarthPopupData.layerContainer && parent.SmartEarthPopupData.layerContainer.hide();
 
                sgworld.drawObj = sgworld.Creator.createSimpleGraphic(
                    'polygon',
                    {
                        clampToGround: true,
                    },
                    function (entity) {
                        sgworld.drawObj = undefined;
                        positions = entity.polygon.hierarchy.getValue().positions;
                        sgworld.Creator.SimpleGraphic.remove(entity.id);
                        // parent.SmartEarthPopupData.layerContainer && parent.SmartEarthPopupData.layerContainer.show();
                        sgworld.ModelFlattening = sgworld.Creator.createModelModifier("模型压平", positions, deepVal, {});
                    }
                );
            }
        });
    </script>
</body>
 
</html>