1
13693261870
2022-11-19 dc201899900ef47d4abbbcf242b7df67ec048659
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
<!DOCTYPE html>
 
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title></title>
    <script src="Resources/jquery.3.2.1.js"></script>
    <script src="Resources/LZBuilding.json"></script>
    <script src="Resources/LZProperty.json"></script>
    <script src="Resources/Camera.json"></script>
    <script>
        function ReadLZBuilding() {
            LZBuilding.features.sort(function (a, b) {
                if (a.properties.name == b.properties.name) return 0;
 
                return a.properties.name > b.properties.name ? 1 : -1;
            });
 
            var strs = [];
            for (var i = 0, c = LZBuilding.features.length; i < c; i++) {
                var p = LZBuilding.features[i].properties;
                strs.push("insert into Building values (" + p.Id + ",1,'" + p.name + "'," + p.height + "," + p.Floor + ",'','','');");
            }
 
            var vals = strs.join("\r\n");
            $("#txtArea").val(vals);
        }
 
        function ReadLZProperty() {
            LZProperty.features.sort(function (a, b) {
                return a.properties.Id - b.properties.Id;
            });
 
            var strs = [], lastId = -1;
            for (var i = 0, c = LZProperty.features.length; i < c; i++) {
                var p = LZProperty.features[i].properties;
                if (p.Id == lastId) continue;
 
                lastId = p.Id;
                strs.push("insert into Property (Id,Name) values (" + p.Id + ",'" + p.PPE_Name + "');");
            }
 
            var vals = strs.join("\r\n");
            $("#txtArea").val(vals);
        }
 
        function ReadCamera() {
            var strs = [];
            for (var i = 0, c = Camera.features.length; i < c; i++) {
                var p = Camera.features[i].properties;
                strs.push("insert into Camera values (" + p.Id + ",'" + p.CType + "','" + p.CName + "','');");
            }
 
            var vals = strs.join("\r\n");
            $("#txtArea").val(vals);
        }
    </script>
</head>
<body>
    <button onclick="ReadLZBuilding();">Read LZBuilding Json</button>
    <button onclick="ReadLZProperty();">Read LZProperty Json</button>
    <button onclick="ReadCamera();">Read Camera Json</button>
    
    <br /><br />
    <textarea id="txtArea" style="height: 300px; width: 500px;"></textarea>
</body>
</html>