1
13693261870
2022-09-16 762f2fb45db004618ba099aa3c0bd89dba1eb843
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
var daluanxianObject; //大陆岸线
 
//测试大陆岸线
function showDaLuAnXian() {
    dojo.style(dojo.byId("testDaLuAnXian"), "display", "block");
}
function closeDaLuAnXian() {
    dojo.style(dojo.byId("testDaLuAnXian"), "display", "none");
}
function checkedDaLuAnXian() {
    var visible = [];
    dojo.query(".chkDaLuAnXian").forEach(function(node, index) {
        if (node.checked) {
            visible.push(node.value);
        }
    });
    if (!daluanxianObject) {
        daluanxianObject = new DaLuAnXian();
    }
    daluanxianObject.checked(visible);
}
function testDaLuAnXian(flag) {
    if (flag == "test1") {
        document.getElementById("chkDaLuAnXian1").click();
        document.getElementById("chkDaLuAnXian2").click();
    }
    else if (flag == "test2") {
        document.getElementById("chkDaLuAnXian2").click();
        document.getElementById("chkDaLuAnXian3").click();
    }
}
 
 
function addLayers(obj) {
    var sLayerId;
    var sLayerUrl;
    var sLayerType;
    var sIsVisible;
 
    sLayerId = obj.value;
 
    if (obj.checked) {
        isVisible = true;
    }
    else {
        isVisible = false;
    }
 
    if (sLayerId == 1) {
        sLayerUrl = "http://18.1.2.12:6080/arcgis/rest/services/AX908/MapServer/0";
        sLayerType = "dynamic";
    }
    else if (sLayerId == 2) {
        sLayerUrl = "http://18.1.2.14:6080/arcgis/rest/services/%E6%B3%A2%E6%B5%AA%E8%83%BD%E5%8A%9F%E7%8E%87/MapServer/0";
        sLayerType = "dynamic";
    }
    else if (sLayerId == 6) {
        sLayerUrl = "http://18.1.2.15:6080/arcgis/rest/services/JCDL/AnXiang/MapServer/1";
        sLayerType = "dynamic";
    }
    else if (sLayerId == 7) {
        sLayerUrl = "http://18.1.2.15:6080/arcgis/rest/services/JCDL/AnXiang/MapServer/2";
        sLayerType = "dynamic";
    }
    else if (sLayerId == 8) {
        sLayerUrl = "http://18.1.2.15:6080/arcgis/rest/services/JCDL/AnXiang/MapServer/3";
        sLayerType = "dynamic";
    }
    else if (sLayerId == 9) {
        sLayerUrl = "http://18.1.2.15:6080/arcgis/rest/services/JCDL/AnXiang/MapServer/4";
        sLayerType = "dynamic";
    }
    else if (sLayerId == 10) {
        sLayerUrl = "http://18.1.2.15:6080/arcgis/rest/services/JCDL/AnXiang/MapServer/5";
        sLayerType = "dynamic";
    }
    else if (sLayerId == 11) {
        sLayerUrl = "http://18.1.2.15:6080/arcgis/rest/services/JCDL/AnXiang/MapServer/6";
        sLayerType = "dynamic";
    }
    else if (sLayerId == 12) {
        sLayerUrl = "";
        sLayerType = "dynamic";
    }
    else if (sLayerId == 13) {
        sLayerUrl = "http://18.1.2.12:6080/arcgis/rest/services/TaiZhan/MapServer/0";
        sLayerType = "dynamic";
    }
    else if (sLayerId == 14) {
        sLayerUrl = "http://18.1.2.12:6080/arcgis/rest/services/LeiDa/MapServer/0";
        sLayerType = "dynamic";
    }
    
    else if (sLayerId == 111) {
        sLayerUrl = "http://18.1.2.12:6080/arcgis/rest/services/JJDCG/MapServer/1";
        sLayerType = "dynamic";
    }
    else if (sLayerId == 222) {
        sLayerUrl = "http://18.1.2.12:6080/arcgis/rest/services/JJDCG/MapServer/2";
        sLayerType = "dynamic";
    }
    else if (sLayerId == 333) {
        sLayerUrl = "http://18.1.2.12:6080/arcgis/rest/services/JJDCG/MapServer/3";
        sLayerType = "dynamic";
    }
    else if (sLayerId == 444) {
        sLayerUrl = "http://41.3.0.6:6080/arcgis/rest/services/YBJZ/YBJZ_JBXXML/MapServer/3";
        sLayerType = "feature";
    }
    else if (sLayerId == 555) {
        sLayerUrl = "http://10.1.4.27:6080/arcgis/rest/services/HYQS/MapServer/2";
        sLayerType = "wfs";
    }
    else if (sLayerId == 666) {
        sLayerUrl = "http://10.3.1.29:6080/arcgis/rest/services/ZT/MapServer/30";
        sLayerType = "dynamic";
    }
    else if (sLayerId == 777) {
        sLayerUrl = "http://gis.nmsmp.com/arcgis/rest/services/HYYYJC/HDZY/MapServer/12";
        sLayerType = "dynamic";
    }
    else if (sLayerId == 888) {
        sLayerUrl = "http://18.1.2.12:6080/arcgis/rest/services/%E5%8C%BA%E5%9D%97/MapServer/3";
        sLayerType = "dynamic";
    }
 
    var layerObject = {
        layerId: sLayerId,
        layerUrl: sLayerUrl,
        layerType: sLayerType
    }
 
    myLayers = getMyLayer();
    myLayers.checked(layerObject, isVisible);
}
 
//拉框或者是多边形
function drawtools(tool) {
    var draw = new Draw();
    draw.drawtools(tool);
}
 
 
//=================== 测试 ======================
        
function test_addWFS() {
    console.log("叠加WFS...");
    var layerObject = {
        layerId: "wfs1",
        layerUrl: "http://10.1.4.27:6080/arcgis/rest/services/HYQS/MapServer/2",
        layerType: "wfs"
    }
    layerChecked(layerObject, true);
}
 
function test_removeWFS() {
    console.log("清除WFS...");
    var layerObject = {
        layerId: "wfs1",
        layerUrl: "http://10.1.4.27:6080/arcgis/rest/services/HYQS/MapServer/2",
        layerType: "wfs"
    }
    layerChecked(layerObject, false);
}
 
function test_addDynamic() {
    console.log("叠加Dynamic...");
    var layerObject = {
        layerId: "dynamic1",
        layerUrl: "http://18.1.2.12:6080/arcgis/rest/services/JJDCG/MapServer/",
        layerType: "dynamic"
    }
    layerChecked(layerObject, true);
    //http://gis.nmsmp.com/arcgis/rest/services/HYYYJC/HDZY/MapServer/12
    //http://10.3.4.32/ArcGIS/rest/services/WFSWMS/MapServer/0
    //http://18.1.2.12:6080/arcgis/rest/services/JJDCG/MapServer
}
 
function test_removeDynamic() {
    console.log("清除Dynamic...");
    var layerObject = {
        layerId: "dynamic1",
        layerUrl: "http://10.3.4.32/ArcGIS/rest/services/WFSWMS/MapServer/0",
        layerType: "dynamic"
    }
    layerChecked(layerObject, false);
}
 
// //书签
// function bookmarks() {
//     //var extent = JSON.stringify(map.extent);
//     //alert(extent);
//     bookmark_extent = map.extent;
// }
 
function test_bookmark() {
    if (bookmark_extent != undefined && bookmark_extent != null) {
        var type = bookmark_extent.type;
        var xmin = bookmark_extent.xmin;
        var ymin = bookmark_extent.ymin;
        var xmax = bookmark_extent.xmax;
        var ymax = bookmark_extent.ymax;
        var spatialReference = bookmark_extent.spatialReference;
        var wkid = spatialReference.wkid;
        var mapExtent = new esri.geometry.Extent(xmin, ymin, xmax, ymax, map.spatialReference);
        map.setExtent(mapExtent);
    }
}
 
function showLayers() {
    var mc = dojo.byId("testLayers");
    if (dojo.style(mc, "display") == "none") {
        dojo.style(mc, "display", "block");
    }
    else {
        dojo.style(mc, "display", "none");
    }
}
 
function test_showHeatmap(isVisible) {
    var layerObject = {
        layerId: "Heatmap1",
        layerUrl: "http://18.1.2.12:6080/arcgis/rest/services/JJDCG/MapServer/14",
    }
    showHeatmap(layerObject, isVisible);
    //debugger
}
 
var mapCharts;
function test_showMapCharts(flag, num) {
    if (flag == "add") {
        var url = "";
        if (num == 1) {
            url = "data/test2.json";
        }
        else {
            url = "data/test3.json";
        }
        $.ajax({
            url: url,
            type: 'GET',
            async: false,
            success: function (result) {
                mapCharts = eval('(' + result + ')');
                //var mapCharts = new MapCharts();
                //mapCharts.show(JieShouContent);
                showMapCharts(mapCharts, true);
            },
            error: function (e) { }
        });
    }
    else if (flag == "remove") {
        showMapCharts(mapCharts, false);
    }
}
 
function test_showRegionByCoords(tool) {
    var geometry = "";
    var radius = -1;
    if (tool == "rectangle") {
        //geometry = "[[11618210.878466144,5516764.155426176],[12420493.927347142,5516764.155426176],[12420493.927347142,5311301.4233956775],[11618210.878466144,5311301.4233956775],[11618210.878466144,5516764.155426176]]";
        geometry = "[[112.23,23.56],[113.58,23.56],[113.58,52.66],[112.23,52.66],[112.23,23.56]]";
    }
    else if (tool == "polygon") {
        geometry = "[[12068272.101009142,5506980.215805677],[12850987.270649139,5458060.517703177],[12753147.87444414,5144974.4498471785],[12322654.531142142,5144974.4498471785], [12822654.531142142,5944974.4498471785],[12068272.101009142,5506980.215805677]]";
    }
    else if (tool == "circle") {
        geometry = "[112.35,23.65]";
        radius = 100000;
    }
    showRegionByCoords(tool, geometry, radius);
}
 
function mytest(regiontext) {
    alert("哈哈:" + regiontext);
}