ansel0926
2022-05-15 ebc4c778854c8d2666b1bbaf3dcba2ba00f08453
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
<!DOCTYPE html>
<html>
 
<head>
    <meta charset="UTF-8">
    <title>视域分析</title>
    <link rel="stylesheet" href="//at.alicdn.com/t/font_2599272_671fgrsk7ev.css">
    <link href="../../libs/layui/css/layui.css" rel="stylesheet">
    <script type="text/javascript" src="../../libs/jquery/jquery-3.5.1.min.js"></script>
    <script type="text/javascript" src="../../libs/layui/layui.js"></script>
    <style>
        .viewdiv {
            color: white;
            overflow-x: hidden;
            overflow-y: hidden;
            padding: 0;
        }
 
        .mt-label {
            height: 30px;
            color: white;
            width: 80px;
            float: left;
            margin-left: 10px;
            line-height: 30px;
            font-size: 12px;
        }
 
        .mt-content {
            height: 30px;
            color: white;
            width: 230px;
            float: left;
            /* margin-left: 10px; */
        }
 
        .mt-row {
            height: 30px;
            margin-top: 10px;
        }
 
        .form-control-small {
            /* display: block; */
            float: left;
            margin-left: 5px;
            width: 80px;
            height: 20px;
            padding: 4px 12px;
            font-size: 14px;
            line-height: 1.6;
            background-color: #2c3238;
            opacity: 0.8;
            color: #fff;
            background-image: none;
            border: 0px solid #e4eaec;
            border-radius: 3px;
            -webkit-box-shadow: inset 0 1px 1px rgb(0 0 0 / 8%);
            box-shadow: inset 0 1px 1px rgb(0 0 0 / 8%);
            -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
            -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;
            -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
            transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;
            transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
            transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;
        }
 
        .mybtn-blue {
            color: #fff;
            background-color: #1E9FFF;
            border-color: #1E9FFF;
        }
        .mybtn-yellow {
            color: #fff;
            background-color: #FFB800;
            border-color: #FFB800;
        }
 
        .mybtn-green {
            color: #fff;
            background-color: #009688;
            border-color: #009688;
        }
        .mybtn-red {
            color: #fff;
            background-color: #FF5722;
            border-color: #FF5722;
        }
 
        .layui-slider {
            height: 4px;
            background: #f3ebeb;
            border-radius: 3px;
            position: relative;
            cursor: pointer;
            margin-top: 12px;
        }
 
        .layui-slider-bar {
            background: #1e9fff !important;
        }
 
        .layui-slider-wrap-btn {
            border: 2px solid #888 !important;
        }
 
        .layui-slider-input {
 
            width: 70px;
            height: 25px;
            border: 1px solid #e6e6e6;
            border-radius: 3px;
            font-size: 16px;
            line-height: 25px;
            position: absolute;
            right: 0;
            top: -14px;
            margin-top: 15px;
        }
    </style>
</head>
 
<body>
 
    <div class="viewdiv">
 
        <div class="mt-row">
            <div class="mt-label">水平张角:</div>
            <div class="mt-content">
                <div id="sp" style="width: 200px;float: left;">
                </div>
                <!-- <div class="float: left;width:100px">
                    <input type="number" id="spinput" autocomplete="off" class="form-control-small" value="100">
                </div> -->
            </div>
        </div>
 
        <div class="mt-row">
            <div class="mt-label">垂直张角:</div>
            <div class="mt-content">
                <div id="cz" style="width:  200px;float: left;"></div>
                <!-- <div class="float: left;width:100px">
                    <input type="number" id="czinput" autocomplete="off" class="form-control-small" value="100">
                </div> -->
            </div>
        </div>
 
        <div class="mt-row">
            <div class="mt-label">视角距离:</div>
            <div class="mt-content">
                <div id="distance" style="width:  200px;float: left;"></div>
                <!-- <div class="float: left;width:100px">
                    <input type="number" id="distanceinput" autocomplete="off" class="form-control-small" value="100">
                </div> -->
            </div>
        </div>
 
        <!-- <div class="mt-row">
            <div class="mt-label">视椎框线:</div>
            <div class="mt-content">
                <input style="margin-top: 10px;" type="checkbox" name="显示网格" lay-skin="primary" title=" 显示网格"
                    checked="true"> 显示网格
            </div>
        </div> -->
 
        <div class="mt-row">
 
            <div class="mt-content">
                <button type="button" style="margin-left: 20%;" class="layui-btn mybtn-blue  layui-btn-sm"
                    onclick="viewshed1()"><i class="layui-icon layui-icon-add-1"
                        style="font-size: 15px; color: white;"></i>添加视域</button>
                <button type="button" class="layui-btn mybtn-yellow  layui-btn-sm" onclick="clearViewshed()"><i
                        class="layui-icon layui-icon-delete" style="font-size: 15px; color: white;"></i>清除</button>
            </div>
        </div>
    </div>
 
 
    <script>
        var horizontalAngle = 120, verticalAngle = 90, distance = 10;
        layui.use('slider', function () {
            var $ = layui.$
                , slider = layui.slider;
 
            slider.render({
                elem: '#sp'
                , min: 1 //最小值
                , max: 180 //最大值
                , input: true //输入框
                , tips: false
                , value: 120
                , change: function (value) {
                    horizontalAngle = value;                    
                }
            });
 
            slider.render({
                elem: '#cz'
                , min: 1 //最小值
                , max: 180 //最大值
                , input: true //输入框
                , tips: false
                , value: 90
                , change: function (value) {
                    verticalAngle = value;                   
                }
 
            });
            slider.render({
                elem: '#distance'
                , min: 1 //最小值
                , max: 999 //最大值
                , input: true //输入框
                , tips: false
                , value: 10
                , change: function (value) {
                    distance = value;
                }
            });
 
 
        });
        function viewshed1() {
            var options = {
                'horizontalAngle': horizontalAngle,
                'verticalAngle': verticalAngle,
                'distance': distance
            }
            parent.onViewshed(options);
        };          
        function clearViewshed() {
            parent.clearViewshed();
        };
    </script>
</body>
 
</html>