北京经济技术开发区经开区虚拟城市项目-【前端】-移动端Web
lixuliang
2024-08-07 a916fc2df00bac9f8210b09fd7ee79f8b291e345
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
<!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>视域分析</title>
    <link href="../SmartEarthSDK/Workers/layui/css/layui.css" rel="stylesheet" />
    <link href="./css/AnalysisContour.css" rel="stylesheet" />
 
    <style type="text/css">
        .layui-btn {
            margin: 0.08rem 0 0 0.4rem;
        }
        .layui-input{
            /* display: inline-block; */
            /* height: 0.2rem; */
            line-height: 1.3;
            margin-right: 0.3rem !important;
            /* margin-top: 0.1rem; */
        }
        .layui-form-item{
            width: 80% !important;
        }
        .layui-btn+.layui-btn {
            margin-left: 0.2rem;
        }
 
        .demo-slider {
            display: inline-block !important;
            width: 1.7rem !important;
            
        }
 
        .color {
            width: 100%;
            float: left;
        }
 
        .top {
            margin-top: 0.1rem;
        }
 
        .layui-form-label {
            font-size: 0.1rem;
            color: white;
        }
 
        .lab {
            margin-right: 0.4rem;
        }
 
        label {
            font-weight: normal;
        }
 
        .layui-input-block {
            margin-left: 1rem;
            min-height: 0.36rem;
            margin-top: -0.24rem;
        }
        .smallbtn {
            display: inline-block;
            position: absolute;
            right: 0;
            top: 0px;
        }
 
    </style>
 
</head>
 
<body onload="test()">
    <div class="layui-form-item" style="margin-top:0.1rem !important;">
        <label class="layui-form-label ">相对高度</label>
        <div class="layui-input-inline">
            <input id="height" value="0" type="text" lay-verify="pass" autocomplete="off" placeholder="请输入相对高度"
                onkeyup="value=value.replace(/[^\d\.]/g,'')" class="layui-input ">
            <span class="iptline" style="color: white;">(米)</span>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label ">可见颜色</label>
        <div class="layui-input-inline">
            <input type="text" value="" placeholder="请选择颜色" class="layui-input" id="visibleArea-input">
            <div id="visibleArea" class="smallbtn"></div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label ">不可见颜色</label>
        <div class="layui-input-inline">
            <!--//style="width: 120px;"-->
            <input type="text" value="" placeholder="请选择颜色" class="layui-input" id="unVisibleArea-input">
            <div id="unVisibleArea" class="smallbtn"></div>
        </div>
 
    </div>
 
    <div class="layui-item" style=" width: 96%; margin: 0 auto 20px;text-align: center;">
        <button type="button" class=" layui-btn  layui-btn-normal  " onclick="addViewshed()">添加视点</button>
        <button type="button" class=" layui-btn   layui-btn-normal  " onclick="clearViewshed()">清除视域</button>
    </div>
    <script src="../jquery-2.0.3.js"></script>
    <script src="../SmartEarthSDK/Workers/layui/layui.js"></script>
    <script src="./js/layuiAnalysis.js"></script>
    <script>
        function test() {
            let htmlDom = document.getElementsByTagName('html')[0]
            htmlDom.style.fontSize = window.screen.availWidth / 3.75 + 'px';
            console.log(htmlDom.style.fontSize)
        }
        var height = 0;
        $('#height').on('input propertychange', function (event) {
            var value = this.value;
            if (value === '') {
                height = 0;
            } else {
                value = value.replace(/[^\d\.]/g, '');
                height = parseFloat(value);
            }
        });
 
        function addViewshed() { 
           parent.SmartEarthPopupData.layerContainer && parent.SmartEarthPopupData.layerContainer.hide();
           parent.addViewshed(height);
        }
        function clearViewshed() {
            parent.clearnViewshed();
        }
    </script>
 
</body>
 
</html>