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
| <template>
| <div class="box">
| <!-- <mapview></mapview> -->
| <div v-show="contLeft" class="content left">
| <left1_1></left1_1>
| <left1_2></left1_2>
| </div>
| <div class="content center">
| <el-dialog
| :visible.sync="isShowVideo"
| width="50%"
| top="5vh"
| :append-to-body="true"
| :modal-append-to-body="true"
| @open="open()"
| >
| <div
| id="valuechart"
| style="width: 100%; height: 2800%; position: absolute"
| ></div>
| </el-dialog>
|
| <div
| id="SenceChange"
| style="position: absolute; z-index: 30; top: 10%; left: 62%"
| >
| <ul id="senceli">
| <li>社区服务中心</li>
| <li>邮局快递</li>
| </ul>
| </div>
| <div id="MapView"></div>
| <div v-show="FullOpen" id="fullopen" @click="fullopen"></div>
| <div v-show="FullClose" id="fullclose" @click="fullclose"></div>
| <!-- <iframe
| src="http://127.0.0.1:8077/ArcGIS/demo.html"
| style="width: 100%; height: 100%"
| class="mapindex"
| ></iframe> -->
| </div>
| <div v-show="contLeft" class="content right">
| <div class="layout">
| <div id="RIGHT1_1" class="layout_box">
| <right1_1 @geturl="geturl(arguments)"></right1_1>
| </div>
| <div class="layout_box">
| <right2_1></right2_1>
| <right2_2></right2_2>
| </div>
| </div>
| </div>
|
| <!-- <div
| style="
| background: rgba(0, 0, 0, 0.5);
| width: 45%;
| height: 93%;
| position: absolute;
| z-index: 100;
| left: 26%;
| top: 5vh;
| "
| > -->
|
| <!-- </div> -->
| <!-- </div> -->
| <!-- <div id="valuechart"></div> -->
| </div>
| </template>
|
| <script>
| import left1_1 from "./left/left1-1.vue";
| import left1_2 from "./left/left1-2.vue";
| import right1_1 from "./right/right1-1.vue";
| import right2_1 from "./right/right2-1.vue";
| import right2_2 from "./right/right2-2.vue";
| import mapview from "../../../src/components/MapView.vue";
| import { loadModules } from "esri-loader";
| import $ from "jquery";
| import data from "@/assets/json/shouguang.json";
| import AGCUPARK from "../../assets/json/value4.json";
| import PROBASE from "../../assets/json/value3.json";
| var map;
| export default {
| //import引入的组件需要注入到对象中才能使用
| components: {
| left1_1,
| left1_2,
|
| right1_1,
| right2_1,
| right2_2,
| mapview,
| },
| data() {
| //这里存放数据
| return {
| contLeft: true,
| FullOpen: true,
| FullClose: false,
| isShowVideo: false,
| dataJson: {},
| leftoption: {},
| image: require("../../assets/img/YJKD.png"),
| image2: require("../../assets/img/SQFWZX.png"),
| };
| },
| mounted() {
| this.createView();
| this.dataJson = data;
| // this.drawLine();
| },
| //方法集合
| methods: {
| open() {
| this.$nextTick(() => {
| this.drawLine();
| });
| },
| async drawLine() {
| // 基于准备好的dom,初始化echarts实例
| // let leftChart = this.$echarts.init(document.getElementById("upperChart"));
| // 绘制图表
| // leftChart.setOption(this.leftoption);
| const { data: dt } = await this.$http.get(
| "/jeecg-boot/town_governance/townGovernance/queryall"
| );
| this.GetChartDataLeft1(dt.result);
| },
|
| GetChartDataLeft1(val) {
| this.$echarts.registerMap("shouguang", this.dataJson);
| var echarted = document.getElementById("valuechart");
| var myChart = this.$echarts.init(echarted);
| //图例
|
| var convertLineData = function (data) {
| var res = [];
| for (var i = 0; i < data.length; i++) {
| var dataItem = data[i];
| var coordS = dataItem.lineS; //线起点
| var coordM = dataItem.lineM; //线中间点
| var coordE = dataItem.lineE; //线尾点
| if (coordS && coordM && coordE) {
| res.push({
| coords: [coordS, coordM, coordE],
| });
| }
| }
| return res;
| };
| var convertValData = function (data) {
| var res = [];
| for (var i = 0; i < data.length; i++) {
| var dataItem = data[i];
| res.push({
| name: dataItem.areaName,
| value: dataItem.lineE.concat(dataItem.value),
| });
| }
| return res;
| };
| var json = {
| data: [
| {
| areaName: "羊口镇",
| value: 94,
| lineS: [119, 37.2891],
| lineM: [119, 37.2891],
| lineE: [119.1648, 37.3991],
| },
| {
| areaName: "双王城生态经济园区",
| value: 10,
| lineS: [118.6645, 37.1783],
| lineM: [118.6645, 37.1783],
| lineE: [118.5082, 37.4333],
| },
| {
| areaName: "营里镇",
| value: 10,
| lineS: [118.9036, 37.1056],
| lineM: [118.9036, 37.1056],
| lineE: [119.0976, 37.1847],
| },
| {
| areaName: "侯镇",
| value: 10,
| lineS: [119.0879, 37.0709],
| lineM: [119.0879, 37.0709],
| lineE: [119.3154, 37.1178],
| },
| {
| areaName: "上口镇",
| value: 10,
| lineS: [118.8978, 37.0184],
| lineM: [118.8978, 37.0184],
| lineE: [119.273, 37.043],
| },
| {
| areaName: "台头镇",
| value: 10,
| lineS: [118.5832, 37.0527],
| lineM: [118.5832, 37.0527],
| lineE: [118.4065, 37.1705],
| },
| {
| areaName: "田柳镇",
| value: 10,
| lineS: [118.7494, 37.0235],
| lineM: [118.7494, 37.0235],
| lineE: [118.5228, 37.2651],
| },
| {
| areaName: "化龙镇",
| value: 10,
| lineS: [118.566, 36.9794],
| lineM: [118.566, 36.9794],
| lineE: [118.2834, 36.9774],
| },
| {
| areaName: "文家街道",
| value: 10,
| lineS: [118.6409, 36.9005],
| lineM: [118.6409, 36.9005],
| lineE: [118.3368, 36.7948],
| },
| {
| areaName: "孙家集街道",
| value: 10,
| lineS: [118.6494, 36.8277],
| lineM: [118.6494, 36.8277],
| lineE: [118.4494, 36.7632],
| },
| {
| areaName: "纪台镇",
| value: 10,
| lineS: [118.7462, 36.7588],
| lineM: [118.7462, 36.7588],
| lineE: [118.7519, 36.6098],
| },
| {
| areaName: "稻田镇",
| value: 10,
| lineS: [118.9252, 36.7774],
| lineM: [118.9252, 36.7774],
| lineE: [118.9887, 36.5527],
| },
| {
| areaName: "洛城街道",
| value: 10,
| lineS: [118.9717, 36.8976],
| lineM: [118.9717, 36.8976],
| lineE: [119.3143, 36.896],
| },
| {
| areaName: "古城街道",
| value: 10,
| lineS: [118.8086, 36.9325],
| lineM: [118.8086, 36.9325],
| lineE: [119.1319, 36.6972],
| },
| {
| areaName: "圣城街道",
| value: 10,
| lineS: [118.7405, 36.8564],
| lineM: [118.7405, 36.8564],
| lineE: [118.4782, 36.6103],
| },
| ],
| };
| var data = json.data;
| var series = [];
| series.push(
| {
| name: "",
| type: "lines",
| zlevel: 2,
|
| symbol: "none",
| silent: true, //不响应鼠标点击或事件
| effect: {
| show: false, //关闭特效
| },
| tooltip: {
| show: false,
| },
| polyline: true, //支持多点连线
| lineStyle: {
| normal: {
| color: "white",
| width: 1.5,
| opacity: 0.9,
| curveness: 0,
| },
| },
| data: convertLineData(data),
| },
| {
| name: "",
|
| type: "scatter",
| coordinateSystem: "geo",
| zlevel: 2,
| hoverAnimation: false, //hover时不高亮点
| cursor: "default", //鼠标设置为箭头
| itemStyle: {
| normal: {
| color: "#FFF",
| },
| },
| tooltip: {
| show: false,
| },
| label: {
| normal: {
| show: true,
| position: "center",
| fontSize: 15,
| fontWeight: "bold",
| backgroundColor: "#06406e",
| color: "#fff",
| padding: [8, 8],
| formatter: function (param) {
| // console.log(param);
| return (
| "社区数:" +
| param.value[1] +
| "\n" +
| "已巡查数:" +
| param.value[2] +
| "\n" +
| "网格数:" +
| param.value[2] +
| "\n" +
| "已巡查网格数:" +
| param.value[2] +
| "\n" +
| "对象总数:" +
| param.value[2] +
| "\n" +
| "网格员数:" +
| param.value[2]
| );
| },
| },
| },
| layoutCenter: ["20%", "10%"],
|
| data: convertValData(data),
| }
| );
|
| this.leftoption = {
| title: {
| text: "寿光市",
| subtext: "",
| left: "center",
| top: "2%",
| textStyle: {
| fontSize: 30,
| color: "#fff",
| },
| },
| tooltip: {
| trigger: "item",
| },
| legend: {
| show: false,
| },
| // grid: {
| // top: "0%",
| // },shouguang
| geo: {
| map: "shouguang",
| top: "5%",
| zoom: 0.6,
| roam: true,
| label: {
| normal: {
| show: true,
| textStyle: {
| color: "#000000",
| fontSize: 20,
| },
| },
| },
|
| itemStyle: {
| normal: {
| areaColor: "#323c4800", //地图颜色
| borderColor: "#0258b6",
| borderWidth: 1,
| },
| },
| regions: [
| //对不同的区块进行着色
| {
| name: "羊口镇", //区块名称
| itemStyle: {
| normal: {
| areaColor: "#83bff9",
| },
| },
| },
| {
| name: "双王城生态经济园区",
| itemStyle: {
| normal: {
| areaColor: "#83bff9",
| },
| },
| },
| {
| name: "营里镇",
| itemStyle: {
| normal: {
| areaColor: "#d8a3c2",
| },
| },
| },
| {
| name: "台头镇",
| itemStyle: {
| normal: {
| areaColor: "#7ac19c",
| },
| },
| },
| {
| name: "田柳镇",
| itemStyle: {
| normal: {
| areaColor: "#b1c97e",
| },
| },
| },
| {
| name: "上口镇",
| itemStyle: {
| normal: {
| areaColor: "#afd5d2",
| },
| },
| },
| {
| name: "侯镇",
| itemStyle: {
| normal: {
| areaColor: "#c0d03d",
| },
| },
| },
| {
| name: "化龙镇",
| itemStyle: {
| normal: {
| areaColor: "#d7bf84",
| },
| },
| },
| {
| name: "古城街道",
| itemStyle: {
| normal: {
| areaColor: "#87d7d0",
| },
| },
| },
| {
| name: "文家街道",
| itemStyle: {
| normal: {
| areaColor: "#e2a011",
| },
| },
| },
| {
| name: "圣城街道",
| itemStyle: {
| normal: {
| areaColor: "#a9d672",
| },
| },
| },
| {
| name: "洛城街道",
| itemStyle: {
| normal: {
| areaColor: "#a0c8f3",
| },
| },
| },
| {
| name: "孙家集街道",
| itemStyle: {
| normal: {
| areaColor: "#e7ea74",
| },
| },
| },
| {
| name: "纪台镇",
| itemStyle: {
| normal: {
| areaColor: "#9bd64d",
| },
| },
| },
| {
| name: "稻田镇",
| itemStyle: {
| normal: {
| areaColor: "#f0ce69",
| },
| },
| },
| ],
| },
| series: series,
| };
|
| myChart.setOption(this.leftoption);
| },
| geturl(data) {
| this.isShowVideo = true;
| },
| showTWO() {
| this.isShowVideo = false;
| },
| fullclose() {
| this.contLeft = true;
| this.FullOpen = true;
| this.FullClose = false;
| document.getElementById("SenceChange").style.left = "62%";
| },
| fullopen() {
| this.contLeft = false;
| this.FullOpen = false;
| this.FullClose = true;
| document.getElementById("SenceChange").style.left = "95%";
| },
| createView() {
| var value1 = AGCUPARK.features;
| var value2 = PROBASE.features;
| var image = this.image;
| var image2 = this.image2;
| let options = {
| url: "https://js.arcgis.com/3.38/",
| css: "https://js.arcgis.com/3.38/esri/css/esri.css",
| };
|
| loadModules(
| [
| "esri/map",
| "esri/layers/ArcGISTiledMapServiceLayer",
| "esri/layers/ArcGISDynamicMapServiceLayer",
| "esri/layers/GraphicsLayer",
| "esri/graphic",
| "esri/symbols/SimpleLineSymbol",
| "esri/symbols/SimpleFillSymbol",
| "dojo/colors",
| "esri/toolbars/draw",
| "esri/symbols/SimpleMarkerSymbol",
| "esri/geometry/Polygon",
| "esri/dijit/Popup",
| "dojo/dom-class",
| "dojo/dom-construct",
| "esri/InfoTemplate",
| "esri/symbols/PictureMarkerSymbol",
| "esri/geometry/Point",
| "dojo/domReady!",
| ],
| options
| ).then(
| ([
| Map,
| ArcGISTiledMapServiceLayer,
| ArcGISDynamicMapServiceLayer,
| GraphicsLayer,
| Graphic,
| SimpleLineSymbol,
| SimpleFillSymbol,
| Color,
| Draw,
| SimpleMarkerSymbol,
| Polygon,
| Popup,
| domClass,
| domConstruct,
| InfoTemplate,
| PictureMarkerSymbol,
| Point,
| ]) => {
| var fill = new SimpleFillSymbol("solid", null, new Color("#A4CE67"));
| var popup = new Popup(
| {
| fillSymbol: fill,
| titleInBody: false,
| },
| domConstruct.create("div")
| );
| map = new Map("MapView", {
| slider: false,
| logo: false,
| infoWindow: popup,
| });
|
| var TileLayerOptions = {
| id: "dzdt",
| opacity: 1,
| showAttribution: false,
| };
| var url =
| "http://172.16.0.28:6080/arcgis/rest/services/2021/2021_SGMAP_CGCS2000_JQ/MapServer";
| var layer1 = new ArcGISTiledMapServiceLayer(url, TileLayerOptions);
| map.addLayer(layer1);
| map.centerAndZoom(
| {
| x: 118.74986854980213,
| y: 36.87927616901776,
| spatialReference: {
| wkid: 4490,
| },
| },
| 15
| );
| var polygon = new GraphicsLayer();
| var pointer = new GraphicsLayer();
| map.addLayer(polygon);
| map.addLayer(pointer);
| polygon.hide();
| pointer.hide();
| var polygonfille = new SimpleFillSymbol(
| SimpleFillSymbol.STYLE_SOLID,
| new SimpleLineSymbol(
| SimpleLineSymbol.STYLE_SOLID,
| new Color([0, 0, 0]),
| 0.4
| ),
| new Color([212, 247, 200, 0.5])
| );
| var pointfille = new PictureMarkerSymbol(image, 50, 50);
| var piintfilletwo = new PictureMarkerSymbol(image2, 50, 50);
| for (var i in value1) {
| var infoTemplate1 = new InfoTemplate("${社区名称}");
| var result1 = new Point(value1[i].geometry.x, value1[i].geometry.y);
| var graphic1 = new Graphic(
| result1,
| piintfilletwo,
| value1[i].attributes,
| infoTemplate1
| );
| polygon.add(graphic1);
| }
| for (var j in value2) {
| var infoTemplate1 = new InfoTemplate("${SIPNAME}");
| var result1 = new Point(value2[j].geometry.x, value2[j].geometry.y);
|
| var graphic1 = new Graphic(
| result1,
| pointfille,
| value2[j].attributes,
| infoTemplate1
| );
| pointer.add(graphic1);
| }
|
| var flag1 = 0;
| var flag2 = 0;
| $("#SenceChange li").on("click", function (e) {
| var value = e.target.innerText;
| var content = document.getElementById("senceli");
| var items = content.getElementsByTagName("li");
| if (value == items[0].innerText) {
| if (flag1 == 0) {
| polygon.show();
| flag1 = 1;
| } else {
| polygon.hide();
| flag1 = 0;
| }
| } else if (value == items[1].innerText) {
| if (flag2 == 0) {
| pointer.show();
| flag2 = 1;
| } else {
| pointer.hide();
| flag2 = 0;
| }
| }
| });
| }
| );
| },
| },
|
| created() {},
| };
| </script>
| <style lang="less" scoped>
| //@import url(); 引入公共css类
|
| .box {
| width: 100%;
| // height: 2624px;
| height: 100vh;
| overflow: hidden;
| position: relative;
|
| display: flex;
| .esriPopup {
| .titleButton {
| .maximize {
| display: none;
| }
| }
| }
| .content {
| font-size: 80px;
| width: 4616px;
| background-size: 100% 100%;
| padding: 0 102px;
| box-sizing: border-box;
| height: 100%;
| }
|
| #MapView {
| width: 100%;
| height: 100%;
| overflow: hidden;
| margin: 0;
| padding: 0;
| }
| #fullopen {
| z-index: 30;
| bottom: 0%;
| right: 34%;
| width: 2%;
| height: 10%;
| position: absolute;
| background: url("../../assets/img/fullopen.png") no-repeat center;
| background-size: 100% 100%;
| }
| #fullclose {
| z-index: 30;
| bottom: 0%;
| right: 1%;
| width: 2%;
| height: 10%;
| position: absolute;
| background: url("../../assets/img/fullclose.png") no-repeat center;
| background-size: 100% 100%;
| }
| #SenceChange li {
| list-style: none;
| padding: 15px;
| background: rgba(0, 0, 0, 0.23);
| text-align: center;
| margin-top: 36%;
| }
| .content:nth-child(2) {
| width: 100%;
| height: 100%;
| background-image: none !important;
| padding-right: 0;
| padding-left: 0;
| }
| .left {
| padding-top: 316px;
| position: absolute;
| left: 0;
| top: 0;
| z-index: 30;
| }
| .right {
| background-size: 100% 100%;
| padding-top: 316px;
| position: absolute;
| right: 0;
| top: 0;
| z-index: 30;
| }
| .center {
| width: 100%;
| height: 100%;
| background-image: none !important;
| padding-right: 0;
| padding-left: 0;
| }
| }
|
| .left {
| height: 100%;
| display: flex;
| flex-direction: column;
| }
| .right {
| height: 100%;
| width: 100%;
|
| .layout {
| height: 100%;
| display: flex;
| justify-content: space-between;
| flex-wrap: wrap;
| .layout_box {
| height: 100%;
| width: 50%;
| }
| }
| }
|
| @media only screen and (max-width: 2560px) {
| .box {
| // background-color: #fff;
|
| height: 100%;
| #fullopen {
| height: 5%;
| right: 28%;
| }
|
| #fullclose {
| height: 5%;
| }
|
| .left {
| background: rgba(8, 32, 58, 0.7);
| width: 3800px;
| }
| .right {
| background: rgba(8, 32, 58, 0.7);
| width: 3800px;
| #RIGHT1_1 {
| display: none;
| }
| }
| .content {
| height: 100%;
|
| .layout {
| height: 100%;
|
| .layout_box {
| height: 100%;
| width: 100% !important;
| }
| }
| }
| }
| }
|
| // @media only screen and (min-width: 6840px) {
| // .layout_box {
| // width: 100% !important;
| // }
| // }
| </style>
|
|