13693261870
2024-04-02 2a1b873b4b78b508d5d53c57992e734c56619df8
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
sgworld = window.external.createSgworld();
var url = window.location.href.substring(0, window.location.href.lastIndexOf('/') + 1);
var lb = new leftBottomDatlog();
var rb = new rightBottomDatlog();
var lc = new leftCenterDatlog();
new CusScrollBar({
    contentSelector: '.scroll_cont1', //滚动内容区
    barSelector: '.scroll_bar1', //滚动条
    sliderSelector: '.scroll_slider1' //滚动滑块
});
$(function () {
    init();
    Close();
 
})
 
function init() {
    var Rhtml = "";
    var SonRootType = getUrlParam("type");
    let CurrentRoot = YingYongDataSencond.filter(function (item) { return item.Type == SonRootType });
 
    $.each(CurrentRoot[0].ChildRen, function (j, value) {
        Rhtml += '<li> <img class="timg" src="img/a7.png"  /> &nbsp;<span data-close="f"  title="' + value.name +
            '"  data-type="' + CurrentRoot[0].Type + '"  data-url="' + CurrentRoot[0].rootname + '\\' + CurrentRoot[0].name + '\\' + CurrentRoot[0].sname + '\\' + value.name + '">' +
            ((value.name.length > 12) ? value.name.substring(0, 12) : value.name) + '</span>';
        //if (value.timeZhou != "false") {
        //    Rhtml += '<img    class="spanImg"   onclick="clickLine(\'' + value.rootname + '=' + value.fname + '=' + value.pname + '=' + value.name + '\')" src="img/123_18.png" title="时间轴" /> &nbsp;';
        //}
        //if (value.legend != "false") {
        //    Rhtml += ' <img   class="spanImg" onclick="clickImg(\'' + value.rootname + '\\\\' + value.fname + '\\\\' + value.pname + '\\\\' + value.name + '\')" src="img/123_20.png" title="图例" />&nbsp;';
        //}
        //if (value.chart != "false") {
        //    Rhtml += '<img   class="spanImg" src="img/yan.png" onclick="play(\'' + value.rootname + '\\' + value.fname + '\\' + value.pname + '\\' + value.name + '\')" title="预案播放" /> ';
        //}
        Rhtml += "</li>";
        $(".name").attr("title", CurrentRoot[0].sname);
        $(".name").text((CurrentRoot[0].sname.length > 9) ? CurrentRoot[0].sname.substring(0, 9) : CurrentRoot[0].sname);
    });
    $("ul").empty();
    $("ul").append(Rhtml);
    SonClick();
 
    //都兰矿产和重点区自然资源遥感巡查解译产品特殊处理
    if (SonRootType == "DLZD" || SonRootType == "DLKC") {
        return;
    }
 
    window.external.createPmDialogDock("右中", url + "legendQL.html?sk=" + CurrentRoot[0].id , lc.width, lc.height, lc.top, lc.left, lc.bottom, lc.right);
    window.external.createPmDialogDock("右下", url + "chart/chartQL.html?type=" + CurrentRoot[0].Type, rb.width, rb.height, rb.top, rb.left, rb.bottom, rb.right);
 
 
};
 
    //$.ajax({
    //    url: "../Ashx/Third.ashx",
    //    type: "post",
    //    data: { Action: "GetThirdData", id: pid },//81258c6425be4694af2575731f4e8831
    //    dataType: "json",
    //    async: true,
    //    success: function (result) {
    //        $.each(result, function (c, value) {
    //            Rhtml += '<li> <img class="timg" src="img/a7.png"  /> &nbsp;<span data-close="f"  title="' + value.name +
    //                '"  data-type="' + value.Type + '"  data-url="' + value.rootname + '\\' + value.fname + '\\' + value.pname + '\\' + value.name + '">' +
    //                ((value.name.length > 12) ? value.name.substring(0, 12) : value.name) + '</span>';
 
    //            if (value.timeZhou != "false") {
    //                Rhtml += '<img    class="spanImg"   onclick="clickLine(\'' + value.rootname + '=' + value.fname + '=' + value.pname + '=' + value.name + '\')" src="img/123_18.png" title="时间轴" /> &nbsp;';
    //            }
    //            if (value.legend != "false") {
    //                Rhtml += ' <img   class="spanImg" onclick="clickImg(\'' + value.rootname + '\\\\' + value.fname + '\\\\' + value.pname + '\\\\' + value.name + '\')" src="img/123_20.png" title="图例" />&nbsp;';
    //            }
    //            if (value.chart != "false") {
    //                Rhtml += '<img   class="spanImg" src="img/yan.png" onclick="play(\'' + value.rootname + '\\' + value.fname + '\\' + value.pname + '\\' + value.name + '\')" title="预案播放" /> ';
    //            }
    //            Rhtml += "</li>";
    //            $(".name").attr("title", value.pname);
    //            $(".name").text((value.pname.length > 9) ? value.pname.substring(0, 9) : value.pname);
    //        });
    //        $("ul").empty();
    //        $("ul").append(Rhtml);
    //        SonClick();
 
    //        window.external.createPmDialogDock("右中", url + "legendQL.html?sk=" + pid, lc.width, lc.height, lc.top, lc.left, lc.bottom, lc.right);
    //        window.external.createPmDialogDock("右下", url + "chart/chartQL.html", rb.width, rb.height, rb.top, rb.left, rb.bottom, rb.right);
 
    //    }
    //});
 
//}
 
//关闭点击事件
function Close() {
    $(".imgx").click(function () {
        //调用弹出层方法
        window.external.InvokeScript("左上", "ReFresh", "");
        //关闭图层
        sgworld.ProjectTree.SetVisibility("", false);
        sgworld.ProjectTree.SetVisibility(sgworld.ProjectTree.FindItem("qinghai"), true);
        window.external.closeDialog("右上");
        window.external.closeDialog("右中");
        window.external.closeDialog("左下");
        window.external.closeDialog("右下");
    });
 
}
 
//子项点击事件
var timeStr = "";
var pointType = "";
function SonClick() {
    $("span").click(function () {
        var urlPathName = $(this).attr("data-url");
        pointType = $(this).attr("data-type");
        var layerId = sgworld.ProjectTree.FindItem(urlPathName);
        if (layerId == "") return;
        var Isclose = $(this).attr("data-close");
        //关闭其他图层
        //sgworld.ProjectTree.SetVisibility("", false);
        if (layerId == "") {
            return false;
        };
 
        if (Isclose == "f") {
            sgworld.ProjectTree.SetVisibility(layerId, true);
            if (layerId == "") {
                return false;
            }
            if (sgworld.ProjectTree.GetObject(layerId) == null && sgworld.ProjectTree.IsGroup(layerId)) {
                let sonId= sgworld.ProjectTree.GetNextItem(layerId,11);
                sgworld.Navigate.FlyTo(sonId);
            } else {
                sgworld.Navigate.FlyTo(layerId);
            }
 
 
            
            
            $(this).attr("data-close", "t");
            $(this).css("color", "#31CFBE");
        } else {
            var layerId = sgworld.ProjectTree.FindItem(urlPathName);
            if (layerId == "") {
                return false;
            }
           
            sgworld.ProjectTree.SetVisibility(layerId, false);
 
            $(this).attr("data-close", "f");
            $(this).css("color", "#FFFFFF");
        }
    });
}
 
function clickLine(urlPathName) {
    urlPathName = urlPathName.replace(new RegExp(/=/g), "\\");
    if (localStorage.getItem("rootUrl") == "" | localStorage.getItem("rootUrl") == null | localStorage.getItem("rootUrl") == "undefined") {
        localStorage.setItem("rootUrl", urlPathName);
    } else {
        if (localStorage.getItem("rootUrl") != urlPathName) {
            localStorage.setItem("rootUrl", urlPathName);
            localStorage.setItem("CheckPointYear", "");
        }
    }
    window.external.createPmDialogDock("左下", url + "timeLine.html?tm=" + timeStr, lb.width, lb.height, lb.top, lb.left, lb.bottom, lb.right);
}
 
let leg = false;
function clickImg(parm) {
    if (leg == false) {
        window.external.createPmDialogDock("右下", url + "legendQL.html", rb.width, rb.height, rb.top, rb.left, rb.bottom, rb.right);
        leg = true;
    } else {
        window.external.closeDialog("右下");
        leg = false;
    }
}
 
function clickImg(parm) {
    var layer = sgworld.ProjectTree.FindItem(parm);
    var obj = sgworld.ProjectTree.GetObject(layer);
    if (obj.Visibility.show) {
        sgworld.ProjectTree.SetVisibility(layer, false);
        var parm1 = parm + "3d";
        var layer3d = sgworld.ProjectTree.FindItem(parm1);
        sgworld.ProjectTree.SetVisibility(layer3d, true);
    } else {
        sgworld.ProjectTree.SetVisibility(layer, true);
        var parm1 = parm + "3d";
        var layer3d = sgworld.ProjectTree.FindItem(parm1);
        sgworld.ProjectTree.SetVisibility(layer3d, false);
    }
}
 
 
function disPlay(fileName, type) {
    var layer = sgworld.ProjectTree.FindItem(fileName);
    if (layer == '') return;
    switch (type) {
        case 'normal':
            break;
        case '3Dpolygon':
            displayAs(layer, type);
            break;
        case 'float':
            displayAs(layer, type);
            break;
    }
}
 
function displayAs(ID, type) {
    var classStr = "<Classification FuncType=\"0\"><Class><Value>&lt;[index]*20 + 20&gt;</Value></Class><DefaultValue>0</DefaultValue></Classification>";
    var floatStr = "<Classification FuncType=\"0\"><Class><Value>&lt;[index]*100 + 200&gt;</Value></Class><DefaultValue>0</DefaultValue></Classification>";
    var obj = sgworld.ProjectTree.GetObject(ID);
    //     if(obj.FeatureGroups.Item(0).DisplayAs == 6 || obj.FeatureGroups.Item(0).GetProperty("Altitude Method") ==10 || obj.FeatureGroups.Item(0).GetProperty("Fill Opacity")==0.9){
    //         obj.FeatureGroups.Item(0).DisplayAs = 2;
    //         obj.FeatureGroups.Item(0).SetProperty("Altitude Method",12);
    //         obj.FeatureGroups.Item(0).SetProperty("Fill Opacity",0.7);
    //         return false;
    //     }
    alert(obj.FeatureGroups.Polygon)
    switch (type) {
 
        case '3Dpolygon':
 
            obj.FeatureGroups.Item(0).DisplayAs = 6;
            obj.Position.AltitudeType = 0;
            obj.FeatureGroups.Item(0).SetClassification("Height", classStr);
            // obj.Refresh();
            //obj.FeatureGroups.Item(0).SetProperty("Altitude",50);
            obj.FeatureGroups.Item(0).SetProperty("Fill Opacity", 0.7);
            obj.Refresh();
            break;
        case 'float':
            alert(3);
            obj.FeatureGroups.Item(0).SetProperty("Altitude Method", 10);
            obj.FeatureGroups.Item(0).SetClassification("Altitude", floatStr);
            obj.FeatureGroups.Item(0).SetProperty("Fill Opacity", 0.9);
            obj.Refresh();
            alert(4);
            break;
    }
}