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
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
<!--
功能描述:二维地图
开发公司:广东蓝图
开发人员:蔡工
开发时间:2019-07-25 ~ 2019-09
-->
<!DOCTYPE html>
<html>
 
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no" />
    <title>专题数据库</title>
    <script type="text/javascript" src="scripts/js/config.js"></script>
    <script type="text/javascript">
        remoteToLoadCss(arcgis_lib_css);
    </script>
 
    <!-- <script src="./js/echarts.min.js"></script> -->
 
    <!-- <link rel="stylesheet" href="./js/colorpicker/css/colorpicker.css"> -->
    <link rel="stylesheet" href="./js/layui-v2.6.7/layui/css/layui.css" />
    <link rel="stylesheet" href="styles/map.css">
    <link rel="stylesheet" href="styles/public.css">
    <link rel="stylesheet" href="styles/MyPaging.css">
    <link rel="stylesheet" href="styles/ColorPicker.css">
    <script type="text/javascript" src="scripts/libs/jquery-1.8.3.min.js"></script>
    <script type="text/javascript" src="scripts/libs/MyPaging.js"></script>
    <script type="text/javascript" src="scripts/js/ui.js"></script>
    <script type="text/javascript" src="scripts/js/services.js"></script>
    <!-- <script type="text/javascript" src="scripts/widget/echarts.min.js"></script> -->
    <script type="text/javascript" src="../../js/echarts5/dist/echarts.min.js"></script>
 
    <script src="./js/lodash.min.js"></script>
    <link rel="stylesheet" href="./css/index1.css">
    <link rel="stylesheet" href="./js/ztreev3/css/bootstrapStyle/bootstrapStyle.css">
    <link rel="stylesheet" href="./css/layui-table.css">
    <link rel="stylesheet" href="./js/Animate/animate.min.css">
 
    <!-- 泰瑞 start -->
    <style>
        .scalebar_bottom-left {
            bottom: 50px !important;
        }
 
        #map_zoom_slider {
            display: none;
        }
 
        .ztsjms {
            padding: 20px;
            width: 100%;
            height: 300px;
            height: 100%;
            /* background-color: rgba(45, 95, 139, 0.9); */
            /* background-color: rgba(71, 120, 255, 0.328); */
            background-color: rgba(74, 91, 139, 0.9);
            position: absolute;
            left: 0;
            right: 0;
            z-index: 9999;
            font-size: 16px;
            letter-spacing: 4px;
            /* font-weight: bold; */
            color: #fff;
        }
 
        .slider {
            width: 100%;
            height: 1px;
            border-top: 1px solid rgb(45, 95, 139);
            margin-top: 20px;
            margin-bottom: 20px;
        }
 
        strong {
            border: 1px solid #fb424250;
            border-radius: 5px;
            padding-left: 2px;
            padding-right: 2px;
            margin-left: 2px;
            margin-right: 2px;
            font-weight: normal;
            font-size: 16px;
            background-color: rgba(235, 183, 183, 0.6);
            color: rgb(92, 33, 33);
        }
    </style>
    <!-- 泰瑞 end -->
    <script type="text/javascript">
        var color = window.localStorage.getItem('--bgcolor');
 
        document.documentElement.style.setProperty('--bgcolor', color);
 
        //下面这段代码必须放到下面几个脚本文件的上面,否则会错误
        var dojoConfig = {
            api_url: config_ip + "/libs/arcgis/3.21",
            async: false,
            isDebug: false,
            parseOnLoad: true,
            mblHideAddressBar: false,
            packages: [{
                name: "scripts",
                location: location.pathname.replace(/\/[^/]+$/, '') + '/scripts'
            }]
        };
        function showOrHideZtms(css) {
            $("#ztsjms").removeClass('fadeInDown').removeClass('fadeOutUp').removeClass('animated').addClass(css + ' animated ');
        }
    </script>
    <script type="text/javascript">
        remoteToLoadJs(arcgis_lib_js);
    </script>
    <script type="text/javascript">
        var myechart = echarts;   //统计图对象
        var map;                  //地图对象
        var measurementObject;    //测量工具对象
        var bookmarksObject;      //地图书签对象
        var basemapGalleryObject; //底图选择对象
        var isTools = false;      //工具操作标识(区分地图点击事件)
 
        //暂时放这
        var drawRegionUrl = "";   //拉框查询地址
 
        var colorSign = "";
        var sizeSign = "";
        var plotPointColor = [255, 255, 0];   //点颜色
        var plotLineColor = [255, 0, 0];    //线颜色
        var plotPolygonColor = [255, 255, 0];    //面颜色
        var plotPointSize = 10;    //点大小
        var plotLineSize = 1;   //线粗细
        var plotOperate;  //撤销(0),清除全部(-1)
        var showPlotLayer;   //显示绘画图层
        var glitterGraphic;
        var tempGraphic;
        var layerDefaultHighLightColor = "[71, 169, 5, 0]";
        var plotGraphicLayer;
 
        var navigation;
        var navigationPAN;
 
        var loadJJMap = null;
        var removeJJMap = null;
        var JJFeatureLayer = null;
        require([
            "dojo/dom",
            "dojo/dom-construct",
            "esri/map",
            "esri/config",
            "esri/geometry/webMercatorUtils", //坐标转换
            "esri/toolbars/navigation", //地图操作
            "esri/dijit/HomeButton",
            "esri/dijit/Scalebar",
            "esri/layers/GraphicsLayer",
            "esri/layers/FeatureLayer",
            "esri/layers/WMSLayer",
            "esri/layers/WMTSLayer",
            "esri/layers/WMTSLayerInfo",
            'esri/layers/WebTiledLayer',
            'esri/layers/TileInfo',
            "esri/InfoTemplate",
            "esri/symbols/SimpleFillSymbol",
            "esri/symbols/SimpleLineSymbol",
            "esri/renderers/SimpleRenderer",
            "esri/renderers/UniqueValueRenderer",
            "esri/renderers/ClassBreaksRenderer",
            "esri/Color",
 
 
            "scripts/widget/bookmark",
            "scripts/widget/measurement",
            "scripts/widget/daluanxian",
            "scripts/widget/heatmap",
            "scripts/widget/basemapGallery",
            "scripts/widget/cluster",
            "scripts/js/utils",
            "scripts/js/mylayer",
            "scripts/js/draw",
            "scripts/js/plot",
            "scripts/js/print",
            "scripts/js/buffer",
            "scripts/js/mapcharts",
            "scripts/js/zzxst",
            "scripts/js/grid",
 
            "dojox/widget/ColorPicker",
            "dojo/_base/fx", //泰瑞
            "dojo/dom", //泰瑞
            "dojo/dom-construct", //泰瑞
            "dojo/dom-attr", //泰瑞
            "dojo/dom-style", //泰瑞
 
            "dijit/layout/BorderContainer",
            "dijit/layout/ContentPane",
            "dijit/TitlePane",
            "dijit/form/CheckBox",
            "dojo/domReady!"
        ], function (dom, domConstruct, Map, esriConfig, webMercatorUtils, Navigation, HomeButton, Scalebar, GraphicsLayer,
            FeatureLayer, WMSLayer, WMTSLayer, WMTSLayerInfo, WebTiledLayer, TileInfo, InfoTemplate, SimpleFillSymbol, SimpleLineSymbol, SimpleRenderer, UniqueValueRenderer, ClassBreaksRenderer, Color,
            Bookmark, Measurement, DaLuAnXian, Heatmap, BasemapGallery, Cluster, Utils, MyLayer, Draw, Plot, Print, Buffer, MapCharts, ZZXST, Grid, ColorPicker
            , mbasefx, dom, domConstruct, domAttr, domStyle
        ) {
 
            //esriConfig.defaults.io.proxyUrl = "/proxy/";
            //esriConfig.defaults.io.alwaysUseProxy = false;
 
            basefx = mbasefx; //泰瑞
            //window.parent.$('.nav_menu_area li').eq(0).click();
            //var zttcIframe = parent.document.getElementById("zttcIframe").contentWindow;
            //zttcIframe.HYDP.windowOnloadLayer();
 
            var utils = new Utils();
 
            //创建GeometryService
            esriConfig.defaults.geometryService = utils.createGeometryService(config_services.geometryService);
 
            //创建Map
            map = new Map("map", {
                center: [config_map.center.longitude, config_map.center.latitude], // longitude, latitude
                zoom: config_map.zoom,
                logo: config_map.logo,
                maxZoom: 16, //限制底图放大级别,
                spatialReference: { wkid: 4326 }
            });
 
            //创建基础底图
 
            var basemap = utils.createBaseMapLayer(config_basemap.layerId, config_basemap.layerURL, config_basemap.isVisible); //默认基础底图配置(config.js)
 
 
            map.addLayer(basemap);
 
            map.graphics = new esri.layers.GraphicsLayer();
 
            // var legend = new ltLegend();
            // legend.show()
            //featureLayer.on("update-end", function () {
            //    console.log(featureLayer.graphics.length);
            //    for (var i = 0; i < featureLayer.graphics.length;i++)
            //    {
            //        featureLayer.graphics[i].attributes["jcount"] = i;
            //    }
            //    featureLayer.setRenderer(renderer);
            //    featureLayer.redraw();
            //});
 
 
 
            //地图点击事件
            map.on("click", mapClick);
 
            //地图点击方法
            function mapClick(e) {
                if (!isTools) {
                    //点选查询
                    myLayers = getMyLayer();
                    myLayers.mapClick(e);
                }
            }
 
            //地图加载完成,调用初始化方法
            map.on("load", init);
 
            // map.on("extent-change", function() {
            //     console.log("当前比例尺:" + map.getScale());
            // });
 
            //地图初化
            function init() {
                //创建比例尺工具
                var scalebar = new Scalebar({
                    map: map,
                    scalebarUnit: "dual"
                });
                scalebar.show();
 
                //创建默认范围按钮
                addHomeButton();
 
                //创建地图工具栏
                addMapToolBar();
 
                initLayers();
 
                //地图工具
                navigation = new Navigation(map);
                navigationPAN = Navigation.PAN;
                dojo.query(".btnTool").forEach(function (node, index) {
                    dojo.connect(node, "onclick", function (evt) {
                        switch (node.title) {
                            case "平移":
                                navigation.activate(Navigation.PAN);
                                break;
                            case "拉框放大":
                                navigation.activate(Navigation.ZOOM_IN);
                                break;
                            case "拉框缩小":
                                navigation.activate(Navigation.ZOOM_OUT);
                                break;
                            case "测量工具":
                                if (!measurementObject) {
                                    measurementObject = new Measurement();
                                }
                                measurementObject.show();
                                break;
                            case "打印工具":
                                showPrintTools();
                                break;
                            case "地图书签":
                                if (!bookmarksObject) {
                                    bookmarksObject = new Bookmark();
                                }
                                bookmarksObject.show();
                                break;
                            case "绘图工具":
                                showPlotTools();
                                break;
                            case "清除标记":
                                myLayers = getMyLayer();
                                myLayers.clearGraphics();
                                break;
                            case "底图选择":
                                if (!basemapGalleryObject) {
                                    basemapGalleryObject = new BasemapGallery();
                                }
                                basemapGalleryObject.show();
                                break;
                        }
                    });
                });
 
                //绘图工具
                dojo.query(".plottool").forEach(function (node, index) {
                    dojo.connect(node, "onclick", function (evt) {
                        switch (node.value) {
                            case "点":
                                plottools("point");
                                break;
                            case "多点":
                                plottools("multipoint");
                                break;
                            case "线":
                                plottools("line");
                                break;
                            case "折线":
                                plottools("polyline");
                                break;
                            case "面":
                                plottools("polygon");
                                break;
                            case "矩形":
                                plottools("rectangle");
                                break;
                            case "手绘折线":
                                plottools("freehandpolyline");
                                break;
                            case "手绘面":
                                plottools("freehandpolygon");
                                break;
                            case "箭头":
                                plottools("arrow");
                                break;
                            case "三角形":
                                plottools("triangle");
                                break;
                            case "圆形":
                                plottools("circle");
                                break;
                            case "椭圆":
                                plottools("ellipse");
                                break;
                        }
                    });
                });
 
                //创建默认范围按钮
                function addHomeButton() {
                    // var home = new HomeButton({
                    //     map: map
                    // },"HomeButton");
                    // home.startup();
                    var a = dom.byId("map_zoom_slider");
                    domConstruct.create("div", {
                        id: "homeButtonDiv"
                    }, a, 1);
                    // domConstruct.place(e, a, "after");
                    var homeButton = new HomeButton({
                        map: map
                    }, "homeButtonDiv");
                    homeButton.startup();
                }
 
                //默认显示12海里岸线和
                function initLayers() {
 
                }
                //========================= init() end =========================
            }
 
            plotGraphicLayer = new GraphicsLayer({
                id: "plotLayer"
            })
            map.addLayer(plotGraphicLayer);
 
            //=================== 二维和三维地图联动 ======================
 
            dojo.connect(map, "onClick", extChange);
            function extChange(evt) {
                //     var xMax = evt.xmax;
                //     var yMax = evt.ymax;
                //     var xMin = evt.xmin;
                //     var yMin = evt.ymin;
 
                //     var pointLB = webMercatorUtils.xyToLngLat(xMin, yMin); //左下
                //     var pointRT = webMercatorUtils.xyToLngLat(xMax, yMax); //右上
 
                //     var xMax = pointRT[0];
                //     var yMax = pointRT[1];
                //     var xMin = pointLB[0];
                //     var yMin = pointLB[1];
 
                //     parent.iLeft.Move3DMapTo(xMax, yMax, xMin, yMin);
 
                try {
                    window.parent.D2D3();
                }
                catch (ex) { }
            }
 
        });
        //====================================== domReady end =========================================
 
        //获取图层操作对象
        var myLayer;
        function getMyLayer() {
            if (!myLayer) {
                myLayer = new MyLayer();
                map.addLayer(myLayer);
            }
            return myLayer;
        }
 
        var myDraw;
        function getMyDraw() {
            if (!myDraw) {
                myDraw = new Draw();
            }
            return myDraw;
        }
        var myBuffer;
        function getMyBuffer() {
            if (!myBuffer) {
                myBuffer = new Buffer();
            }
            return myBuffer;
        }
 
        //打印
        function printtools() {
            var print = new Print();
            print.printtools();
        }
 
        /*===========绘图模块Begin===========*/
        //绘图
        function plottools(tool) {
            var plot = new Plot();
            plot.plottools(tool);
        }
 
        //创建绘画图层
        function createLayer() {
            var plot = new Plot();
            plot.createLayer();
        }
 
        //清除所有绘画图层
        function removeAllLayer() {
            var plot = new Plot();
            plot.removeAllLayer();
        }
 
        //绘画后退
        function revocationLayer() {
            var plot = new Plot();
            plot.revocationLayer();
        }
 
        //绘图保存
        function savePlotPayer() {
            var plot = new Plot();
            plot.savePlotPayer();
        }
 
        //展示绘图
        function getPlotPayer(datalist) {
            var plot = new Plot();
            plot.getPlotPayer(datalist);
        }
 
        //获取绘图数据
        function getPlotData() {
            var plot = new Plot();
            return plot.getPlotData();
        }
 
        //删除绘图数据
        function deletePlotData(index) {
            var plot = new Plot();
            plot.deletePlotData(index);
        }
 
        function changeColor(id) {
            $('.colorpicker').show();
            colorSign = id;
        }
 
        function comfirmColor() {
            if (colorSign == "pointcolor") {
                plotPointColor = [parseInt($("#picker2_0_r").val()), parseInt($("#picker2_0_g").val()), parseInt($("#picker2_0_b").val())]
            } else if (colorSign == "linecolor") {
                plotLineColor = [parseInt($("#picker2_0_r").val()), parseInt($("#picker2_0_g").val()), parseInt($("#picker2_0_b").val())]
            } else if (colorSign == "polygoncolor") {
                plotPolygonColor = [parseInt($("#picker2_0_r").val()), parseInt($("#picker2_0_g").val()), parseInt($("#picker2_0_b").val())]
            }
            $('.colorpicker').hide();
        }
 
        function changeSize(id) {
            if (colorSign == "pointsize") {
                $("#plsize").val(10);
            } else if (colorSign == "linesize") {
                $("#plsize").val(1);
            }
            $('.sizepicker').show();
            sizeSign = id;
        }
 
        function comfirmSize() {
            if (sizeSign == "pointsize") {
                plotPointSize = $("#plsize").val();
            } else if (sizeSign == "linesize") {
                plotLineSize = $("#plsize").val();
            }
            $('.sizepicker').hide();
        }
        /*================绘图模块End============*/
 
        /**
        * @Description: 显示隐藏绘画工具面板
        * @author ykm
        * @function
        * @date 2019-8-19 9:46
        */
        function showPlotTools() {
            createLayer();
            var tools = dojo.byId("plotToolContainer");
            if (dojo.style(tools, "display") == "none") {
                dojo.style(tools, "display", "block");
            }
            else {
                dojo.style(tools, "display", "none");
            }
        }
 
        function showPrintTools() {
            var tools = dojo.byId("printToolContainer");
            if (dojo.style(tools, "display") == "none") {
                dojo.style(tools, "display", "block");
            }
            else {
                dojo.style(tools, "display", "none");
            }
        }
 
        function closePlotTool() {
            $("#plotToolContainer").hide();
            createLayer();
 
        };
 
        function closePrintTool() {
            $("#printToolContainer").hide();
        };
 
        function togglePanel() {
            if ($('#legendDiv').css('display') == 'none') {
                $('#legendDiv').show();
            }
            else {
                $('#legendDiv').hide();
            }
        }
 
        //地图工具(通过传参调用)
        var currentMapTool = "";
        function chooseMapTool(type) {
            closeAllMapTool(type);
            switch (type) {
                case "平移":
                    navigation.activate(navigationPAN);
                    break;
                case "拉框放大":
                    navigation.activate(Navigation.ZOOM_IN);
                    break;
                case "拉框缩小":
                    navigation.activate(Navigation.ZOOM_OUT);
                    break;
                case "测量工具":
                    if (!measurementObject) {
                        measurementObject = new Measurement();
                    }
                    measurementObject.show();
                    break;
                case "打印工具":
                    showPrintTools();
                    break;
                case "地图书签":
                    if (!bookmarksObject) {
                        bookmarksObject = new Bookmark();
                    }
                    bookmarksObject.show();
                    break;
                case "绘图工具":
                    showPlotTools();
                    break;
                case "清除标记":
                    myLayers = getMyLayer();
                    myLayers.clearGraphics();
                    break;
                case "底图选择":
                    if (!basemapGalleryObject) {
                        basemapGalleryObject = new BasemapGallery();
                    }
                    basemapGalleryObject.show();
                    break;
            }
            currentMapTool = type; //记录当前操作工具
        }
 
        //关闭地图工具所有面板
        function closeAllMapTool(type) {
            if (type != "测量工具" && type != "打印工具" && type != "地图书签" && type != "绘图工具" && type != "底图选择") {
                return;
            }
            if (type == currentMapTool) {
                return;
            }
            //测量工具
            if (dojo.style("measurementContainer", "display") == "block") {
                if (!measurementObject) {
                    measurementObject = new Measurement();
                }
                measurementObject.show();
            }
            //打印工具
            dojo.style(dojo.byId("printToolContainer"), "display", "none");
            //地图书签
            if (dojo.style("bookmarksContainer", "display") == "block") {
                if (!bookmarksObject) {
                    bookmarksObject = new Bookmark();
                }
                bookmarksObject.show();
            }
 
            //绘图工具
            dojo.style(dojo.byId("plotToolContainer"), "display", "none");
            //底图选择
            if (dojo.style(dojo.byId("basemapGalleryContainer"), "display") == "block") {
                if (!basemapGalleryObject) {
                    basemapGalleryObject = new BasemapGallery();
                }
                basemapGalleryObject.show();
            }
        }
 
 
 
        var wmslayer = null;
        var resourceInfo = null;
        function testSkylineWms() {
 
            var layerInfo = new esri.layers.WMSLayerInfo({
                name: "sgwms",
                title: "sgwms",
                spatialReferences: [4326]
            });
            var extent = new esri.geometry.Extent(-180, -90, 180, 90, new esri.SpatialReference({ wkid: 4326 }));
            resourceInfo = {
                copyright: "sgWms",
                description: "sg",
                extent: extent,
                layerInfos: [layerInfo],
                version: '1.1.1',
                customLayerParameters: {
                    SRS: "EPSG:4326",
                    WIDTH: 256,
                    HEIGHT: 256
                }
            };
            var wmsUrl = "http://71.3.110.200/sg/Imagery";
            wmslayer = new esri.layers.WMSLayer(wmsUrl, {
                resourceInfo: resourceInfo,
                visibleLayers: ["QJGPT2Q20210112.412893.mpt"],
                spatialReferences: [4326]
            });
            map.addLayer(wmslayer);
 
        }
 
 
        function testWMTS2() {
            var url = "http://71.3.110.202:6080/arcgis/rest/services/HYQY/QP_ZGDL12HLX/MapServer/WMTS";
            var wmtslayer = new esri.layers.WMTSLayer(url);
            map.addLayer(wmtslayer);
        }
        function testChaoTuWMTS() {
            var url = "http://18.1.2.15:8090/iserver/services/map-agscachev2-TuCeng2/wmts100";
            var wmtslayer = new esri.layers.WMTSLayer(url);
            map.addLayer(wmtslayer);
        }
 
        function testSHJJServer() {
            ;
            var dynamicLayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://71.3.110.202:6080/arcgis/rest/services/YBJZ/FBC/MapServer", {
                id: "TC_JJTEST",
                visible: true
            });
            dynamicLayer.setVisibleLayers([12]);
            map.addLayer(dynamicLayer);
        }
    </script>
</head>
 
<body>
    <div id="ztsjms" class="ztsjms">
        <div style="margin-left: 226px;
        margin-top: 44px;
        font-size: 18px;
        font-weight: bold;
        color: white;
        position: absolute;">专题数据</div>
        <div class="ztsjms-content" style="    
        margin-top: 155px;
        width: 800px;
        height: 250px;
        position: absolute;">
 
        </div>
 
        <!-- <div class="slider"></div> -->
 
        <div id="chartLeft" style="margin-left: 800px;
        width: 50%;
        height: 300px;
        -webkit-tap-highlight-color: transparent;
        user-select: none;">
        </div>
        <div id="chartRight" style="margin-left: 710px;
        width: 50%;
        height: 300px;
        float: left;
        -webkit-tap-highlight-color: transparent;
        user-select: none;
        position: relative;">
        </div>
    </div>
    <!-- 数据表格 -->
    <div class="tab">
        <div class="close"><span>×</span></div>
        <div class="tabbox">
            <table data-treeid="" id="metadata">
                <thead></thead>
                <tbody></tbody>
            </table>
        </div>
        <div class="subbox">
            <button onclick="submitfunc()">提交</button>
            <button onclick="openInResource()">在资源池打开</button>
            <button onclick="addtabtr()">+</button>
        </div>
    </div>
    <div id="mainWindow" data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="design:'headline',gutters:false"
        style="width:100%; height:100%;">
        <div id="map" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'center'">
 
            <!-- 测量工具面板 -->
            <div id="measurementContainer"
                style="position:absolute; right:66px; top:110px; z-Index:999; display: none;">
                <!-- alert ykm -->
                <span style="font-size: 20px;margin: 10px; line-height: 35px;">测量工具</span>&nbsp;&nbsp;
                <span id="measurementClose"
                    style="float: right;margin-right: 10px;font-size: 18px;cursor: pointer;">x</span>
                <hr />
                <div id="measurementTool"></div>
            </div>
            <!-- 底图选择面板 -->
            <!-- alert ykm -->
            <div id="basemapGalleryContainer"
                style="background-color:white;border: 1px solid rgb(226, 227, 227); border-image: none; top: 110px; width: 385px; min-height: 100px; right: 66px; position: absolute; z-index: 9999; max-height: 600px;display: none;">
                <span style="font-size: 20px;margin: 10px; line-height: 35px;">选择底图</span>&nbsp;&nbsp;
                <span id="basemapClose"
                    style="float: right;margin-right: 10px;font-size: 18px;cursor: pointer;">x</span>
                <hr />
                <div id="basemapGalleryDiv" style="font-size: 13px;"></div>
            </div>
            <!-- 地图书签面板 -->
            <div id="bookmarksContainer"
                style="background-color:white;border: 1px solid rgb(226, 227, 227); border-image: none; top: 110px; width: 300px; min-height: 100px; right: 66px; position: absolute; z-index: 9999; max-height: 600px;display: none;">
                <span style="font-size: 20px;margin: 10px; line-height: 35px;">地图书签</span>&nbsp;&nbsp;
                <span id="bookmarksClose"
                    style="float: right;margin-right: 10px;font-size: 18px;cursor: pointer;">x</span>
                <hr />
                <div id="bookmarksTool">
                </div>
            </div>
            <!-- 绘图工具面板 -->
            <div id="plotToolContainer" style="position:absolute; right:66px; top:110px; z-Index:999; display: none;">
                <span style="font-size: 20px;margin: 10px; line-height: 35px;">绘图工具</span>&nbsp;&nbsp;
                <span id="plotToolClose" onclick="closePlotTool()"
                    style="float: right;margin-right: 10px;font-size: 18px;cursor: pointer;">x</span>
                <hr />
                <div id="plottools" style="display: block;padding: 10px;">
                    <input type="button" class="plottool" value="点" title="点"
                        style="background: url(images/printIcon/point.png)" />
                    <input type="button" class="plottool" value="多点" title="多点"
                        style="background: url(images/printIcon/multiPoint.png)" />
                    <input type="button" class="plottool" value="线" title="线"
                        style="background: url(images/printIcon/line.png)" />
                    <input type="button" class="plottool" value="折线" title="折线"
                        style="background: url(images/printIcon/poly-line.png)" />
                    <input type="button" class="plottool" value="矩形" title="矩形"
                        style="background: url(images/printIcon/rectangle.png)" />
                    <input type="button" class="plottool" value="面" title="面"
                        style="background: url(images/printIcon/polygon.png)" />
                    <input type="button" class="plottool" value="手绘折线" title="手绘折线"
                        style="background: url(images/printIcon/freehandpolyline.png)" />
                    <input type="button" class="plottool" value="手绘面" title="手绘面"
                        style="background: url(images/printIcon/freehandpolygon.png)" />
                    <input type="button" class="plottool" value="箭头" title="箭头"
                        style="background: url(images/printIcon/arrow.png)" />
                    <input type="button" class="plottool" value="三角形" title="三角形"
                        style="background: url(images/printIcon/triangle.png)" />
                    <input type="button" class="plottool" value="圆形" title="圆形"
                        style="background: url(images/printIcon/circle.png)" />
                    <input type="button" class="plottool" value="椭圆" title="椭圆"
                        style="background: url(images/printIcon/ellipse.png)" />
                    <div>
                        <input type="button" id="pointcolor" class="plotButton" value="清除全部"
                            onclick="removeAllLayer();" />
                        <input type="button" id="pointcolor" class="plotButton" value="后退"
                            onclick="revocationLayer();" />
                        <input type="button" id="pointcolor" class="plotButton" value="点颜色"
                            onclick="changeColor(this.id);" />
                        <input type="button" id="linecolor" class="plotButton" value="线颜色"
                            onclick="changeColor(this.id);" />
                        <input type="button" id="polygoncolor" class="plotButton" value="面颜色"
                            onclick="changeColor(this.id);" />
                        <input type="button" id="pointsize" class="plotButton" value="点大小"
                            onclick="changeSize(this.id);" />
                        <input type="button" id="linesize" class="plotButton" value="线粗细"
                            onclick="changeSize(this.id);" />
                        <hr />
                        <div style="margin: 6px 0px 0 7px;font-size: 14px;">
                            图层名称:<input type="text" id="plotLayerName" />
                            <div style="float: right;clear: right;">
                                <input type="button" id="savePlotLayer" class="plotLayer" value="保存图层"
                                    onclick="savePlotPayer();" />
                                <input type="button" id="pointcolor" class="plotLayer" value="绘画列表"
                                    onclick="showPlotList();" />
                            </div>
                        </div>
                    </div>
                </div>
                <div class="colorpicker" style="display: none;font-size: 13px;padding: 2px;">
                    <div data-dojo-type="dojox.widget.ColorPicker" id="picker2"></div>
                    <div style="height: 50px;">
                        <button style="position: absolute;right: 91px;" class="plotLayer"
                            onclick="comfirmColor()">确定</button>
                        <button style="position: absolute;right: 13px;" class="plotLayer"
                            onclick="$('.colorpicker').hide();">取消</button>
                    </div>
                </div>
                <div class="sizepicker"
                    style="height: 50px;background-color: #ffffff;display: none;padding: 0 13px;margin-top: 7px;">
                    <input type="range" id="plsize" min="1" max="40" step="1" value="1.0" />
                    <div style="float: right;clear: right;">
                        <button class="plotLayer" onclick="comfirmSize()">确定</button>
                        <button class="plotLayer" onclick="$('.sizepicker').hide();">取消</button>
                    </div>
                </div>
                <div id="PlotsList" style="display: none;">
                    <div class="pagemain">
                        <table border="1">
                            <thead>
                                <tr>
                                    <th style="width: 85%;">名称</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody class="pagetbody">
                                <tr></tr>
                            </tbody>
                        </table>
                        <div class="PagingBox" style="width: 46%;margin: 0 auto;"></div>
                    </div>
                </div>
            </div>
            <!-- 打印工具面板 -->
            <div id="printToolContainer"
                style="background-color:white;border: 1px solid rgb(226, 227, 227); border-image: none; top: 110px; width: 300px; min-height: 100px; right: 66px; position: absolute; z-index: 9999; max-height: 600px;display: none;">
                <span style="font-size: 20px;margin: 10px; line-height: 35px;">地图打印</span>&nbsp;&nbsp;
                <span id="printToolClose" onclick="closePrintTool()"
                    style="float: right;margin-right: 10px;font-size: 18px;cursor: pointer;">x</span>
                <hr />
                <div id="printTool" style="display: block;padding: 10px;">
                    <div style="margin: 7px auto;width: 94%;">
                        页面设置:<select id="pageSetting"
                            style="width: 66%;text-align: center;height: 30px;margin-bottom: 10px;">
                            <option value="Letter ANSI A Landscape">字母Ansi A横向</option>
                            <option value="A3 Landscape">A3横向</option>
                            <option value="A3 Portrait">A3纵向</option>
                            <option value="A4 Landscape">A4横向</option>
                            <option value="A4 Portrait">A4纵向</option>
                            <option value="Letter ANSI A Portrait">字母Ansi A纵向</option>
                            <option value="Tabloid ANSI B Landscape">Tabloid ANSI B横向</option>
                            <option value="Tabloid ANSI B Portrait">Tabloid ANSI B纵向</option>
                        </select><br>
                        打印格式:<select id="printType" style="width: 66%;text-align: center;height: 30px;">
                            <option value="PDF">PDF</option>
                            <option value="PNG32">PNG32</option>
                            <option value="PNG8">PNG8</option>
                            <option value="JPG">JPG</option>
                            <option value="GIF">GIF</option>
                            <option value="EPS">EPS</option>
                            <option value="SVG">SVG</option>
                            <option value="SVGZ">SVGZ</option>
                        </select>
                        <div style="border: 1px solid #adacac;width: 54%;margin: 10px auto;text-align: center;line-height: 30px;cursor:pointer;"
                            onclick="printtools();">打印</div>
                    </div>
                </div>
            </div>
            <!-- 通用图例 -->
            <div id="lengedBox" style="bottom: 30px;position: absolute;right: 105px;z-index: 1;">
                <div id="legend_lr" style="display: inline-block;float:left;position: relative;margin-right: 1px;">
                    <span class="esri-icon-media" id="Legned_icon" title="隐藏图例"
                        style="float: left;cursor: pointer;padding: 6px;background-color: white;line-height: 1.35rem;;font-size: 18px;border: 1px solid #bbb;border-radius: 11px 0px 0px 11px;cursor: pointer;"
                        onclick="showLD()" aria-label="toggle icon"></span>
                </div>
                <div id="lengedContent"
                    style="width:274px; max-height:290px; border:solid 1px #D5E3F0; z-index: 999; background-color: white; overflow: auto;padding: 6px;">
                    <div>
                        <label style="font-weight: bold;">图例</label>
                        <span class="esri-icon-up-down-arrows"
                            style="float: right; cursor: pointer; padding:5px;margin: -3px 0px;font-size: 18px;cursor: pointer;"
                            onclick="togglePanel();" aria-label="toggle icon"></span>
                    </div>
                    <div id="legendDiv" style="display: none;"></div>
                </div>
            </div>
        </div>
    </div>
</body>
 
</html>
<script type="text/javascript">
    //=================== 二维和三维地图联动 ======================
 
    //设置地图位置
    function setMapPosition(xMax, yMax, xMin, yMin) {
        var extent = new esri.geometry.Extent({ "xmax": xMax, "ymax": yMax, "xmin": xMin, "ymin": yMin });
        map.setExtent(extent);
    }
 
 
 
    function showPlotList() {
 
        if ($("#PlotsList").css("display") == "none") {
            $("#PlotsList").show();
            initLoadPage();
        }
        else {
            $("#PlotsList").hide();
        }
    }
 
    function initLoadPage() {
        // 初始化分页
        $('.PagingBox').MyPaging({
            size: 3,
            total: 0,
            current: 1,
            linkNum: 1,
            prevHtml: '上一页',
            nextHtml: '下一页',
            //layout: 'total, totalPage, prev, pager, next, jumper',
            layout: 'prev, next',
            jump: function () {
                var _this = this;
                setTimeout(function () {
                    var res = getPageData({
                        size: _this.size,
                        current: _this.current
                    })
 
                    setTbody(res.list);
                    _this.setTotal(res.total);
                }, 100);
            }
        });
    }
 
    var nowPage;
    function getPageData(params) {
        var data = eval(getPlotData());
        var start = (params.current - 1) * params.size;
        var end = params.current * params.size;
        nowPage = params.current;
        return {
            total: data.length,
            list: data.splice((params.current - 1) * params.size, params.size)
        }
    }
 
    // 设置tbody的html
    function setTbody(arr) {
        var html = "";
        for (var i = 0; i < arr.length; i++) {
            var item = arr[i];
            //显示
            html += '<tr><td><span style=\"cursor:pointer;text-decoration:underline;\" onclick=\'getPlotPayer(' + JSON.stringify(item) + ')\'>' + item.layername + '</span></td><td><span style=\"cursor:pointer;\" onclick=\"deletePlotData(' + (nowPage * 3 - 3 + parseInt(i)) + ')\"><img style=\"width: 16px;\" src="images/maptoolbar/delete.png"/></span></td></tr>';
        }
        $('.pagetbody').html(html);
    }
 
    ///二维是否加载完成
    var isOnLoad = false;
    window.onload = function () {
        isOnLoad = true;
    }
</script>
 
 
<script src="./js/ztreev3/js/jquery.ztree.all.min.js"></script>
<script src="./js/layui-v2.6.7/layui/layui.js"></script>
<script src="./js/jquery-ui.min.js"></script>
<!-- -->
<script src="./js/tanchaung.js"></script>
<script src="./js/index1.js"></script>
<!-- 
<script src="./js/Charts.js"></script> -->
<!-- <script src="./js/colorpicker/js/colorpicker.js"></script> -->
<script src="./js/layui-v2.6.7/layui/layui.js"></script>
<script src="./js/url.js"></script>
<script src="./js/Charts1.js"></script>