北京经济技术开发区经开区虚拟城市项目-【前端】--政府服务中心-1号屏Web
Surpriseplus
2023-10-07 a77448eb072f10dd3827694140f87c3069b1dba4
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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
<!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">
    <link rel="stylesheet" href="../css/prop_form.css">
    <style>
        html,
        body,
        .layui-prop {
            height: 100% !important;
        }
        form{
            width: 95%;
        }
        html {
            overflow: hidden;
        }
 
        .layui-form-item {
            width: 313px !important;
            /* border: 1px #14e8de solid;
            margin-bottom: 0px !important;
            border-bottom: none; */
        }
 
        .layui-input {
            background-color: #fff !important;
            height: 30px;
            margin-top: 5px;
        }
 
        .layui-form-label {
            width: 125px !important;
            /* padding: 11px 15px !important;
            border-right: 1px #fff solid;
            font-weight: bold !important;
            font-size: 14px;
            text-align: center; */
        }
 
        .layui-input-block {
            width: 150px !important;
            margin-left: 150px !important;
        }
 
        .mCSB_container {
            margin-right: 17px !important;
        }
 
        legend {
            text-align: center;
            font-size: 16px;
            font-weight: bold;
            margin-bottom: 15px;
            margin-top: 20px;
        }
 
        .layui-tab-title .layui-this:after {
            border-bottom: 2px solid rgb(27, 83, 140) !important;
        }
 
        .layui-tab-content {
            padding: 0 !important;
        }
 
        .layui-prop {
            margin-left: 10px;
            margin-top: 20px;
        }
 
        .layui-form-item .line {
            display: block;
        }
 
        .layui-form-item .wall {
            display: none;
        }
 
        .bnt-box {
            text-align: center;
            height: 58px;
            /*/ / border-bottom: 1 px #999 solid;*/
        }
 
        .bnt-box button {
            margin-top: 10px;
        }
 
        .fly {
            display: none;
        }
    </style>
</head>
 
<body>
    <div class="layui-prop">
        <form class="layui-form" action="">
            <div class="layui-form-item">
                <label class="layui-form-label">路线名称</label>
                <div class="layui-input-block">
                    <input id="roadName" type="text" value="" name="roadName" lay-filter="roadName" class="layui-input">
                </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">
                <label class="layui-form-label">漫游模型</label>
                <div class="layui-input-block">
                    <button onclick="FHK('node_modules/FHK/library/library.html',FHKCb)"
                        style="height: 30px;line-height: 30px;margin-top: 5px;" type="button" class="layui-btn"
                        id="upload-cylinder">选择文件
                    </button>
                </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">
                    <input id="lineHeight" type="text" value="0" name="lineHeight" lay-filter="lineHeight"
                        class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">是否循环漫游</label>
                <div class="layui-input-block">
                    <input id="isLoop" type="checkbox" lay-skin="switch" lay-filter="isLoop" value="off" lay-text="是|否">
                </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.selectRouteData;
        var ratio = 0;
        var geometry = routeData.geojson.geometry.coordinates;
        var line = sgworld.Creator.createPolyline(geometry, "#ffff00", 1, 0, "线");
        parent.PathAnimationData.showLine = line.item;
        sgworld.Navigate.flyToObj(line.item);
 
        layui.use(['form', 'element'], function () {
            var form, element;
            form = layui.form;
            element = layui.element;
 
            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;
            }
            if (routeData.lineHeight) {
                document.getElementById("lineHeight").value = routeData.lineHeight;
            }
            document.getElementById("roadName").value = routeData.name;
 
            $('#roadName').on('input propertychange', function (event) {
                routeData && (routeData.name = $(this).val());
            });
            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;
                }
            }
            form.on('select(sjms)', function (data) {
                if (data.value === "0") {
                    routeData && (routeData.mode = 0);
                    $('.fly').hide();
                } else if (data.value === "1") {
                    routeData && (routeData.mode = 1);
                    $('.fly').show();
                } else if (data.value === "2") {
                    routeData && (routeData.mode = 2);
                    $('.fly').show();
                    $('.notGod').hide();
                }
            });
            $('#cameraDistance').on('input propertychange', function (event) {
                var distance = $(this).val().replace(/[^\d\.\-]/g, '');
                routeData && (routeData.range = parseFloat(distance));
            });
            $('#cameraHeight').on('input propertychange', function (event) {
                var height = $(this).val().replace(/[^\d\.\-]/g, '');
                routeData && (routeData.height = parseFloat(height));
            });
            $('#pitch').on('input propertychange', function (event) {
                var pitch = $(this).val().replace(/[^\d\.\-]/g, '');
                routeData && (routeData.pitch = parseFloat(pitch));
            });
            $('#lineHeight').on('input propertychange', function (event) {
                var lineHeight = $(this).val().replace(/[^\d\.\-]/g, '');
                routeData && (routeData.lineHeight = parseFloat(lineHeight));
            });
            if (routeData.showModel) {
                $('#showModel').next().click();
                $('#showModel').attr('value', 'on');
            }
            form.on('switch(showModel)', function (data) {
                routeData && (routeData.showModel = this.checked);
            });
            if (routeData.showLine) {
                $('#showLine').next().click();
                $('#showLine').attr('value', 'on');
            }
            form.on('switch(showLine)', function (data) {
                routeData && (routeData.showLine = this.checked);
            });
            if (routeData.isLoop) {
                $('#isLoop').next().click();
                $('#isLoop').attr('value', 'on');
            }
            form.on('switch(isLoop)', function (data) {
                routeData && (routeData.isLoop = this.checked);
            });
        });
 
        function FHK(url, fn) {
            window.parent.libraryFn(url, fn);
        }
 
        //符号库回调函数
        function FHKCb(url) {
            routeData && (routeData.url = url);
        }
    </script>
</body>
 
</html>