|
@ -283,8 +283,11 @@ export default {
|
283
|
283
|
}, 1000)
|
284
|
284
|
EventBus.$on('person', (msg) => { // 获取镜屏推送消息
|
285
|
285
|
msg = JSON.parse(msg)
|
286
|
|
// console.log(msg)
|
|
286
|
console.log(msg)
|
287
|
287
|
this.personStatistics = msg.data.countMap
|
|
288
|
if (msg.data.aggregatedMapAreaList.length === 1 && msg.data.unaggregatedEntityPositionList.length === 0){
|
|
289
|
this.removeUnaggregated(msg.data.currentEntityPosition)
|
|
290
|
}
|
288
|
291
|
if (msg.data.aggregatedMapAreaList) {
|
289
|
292
|
this.changeLocation(msg.data.aggregatedMapAreaList)
|
290
|
293
|
}
|
|
@ -302,8 +305,8 @@ export default {
|
302
|
305
|
await this.$test
|
303
|
306
|
.post(services.mapTag.GET_MAP_PARAM, '')
|
304
|
307
|
.then((res) => {
|
305
|
|
this.$store.commit('setGisToken', res.data.result.ak)
|
306
|
|
this.$store.commit('setMapParam', {center: [res.data.result.latitude, res.data.result.longitude], zoom: res.data.result.scale})
|
|
308
|
this.$store.commit('setGisToken', res.data.ak)
|
|
309
|
this.$store.commit('setMapParam', {center: [res.data.latitude, res.data.longitude], zoom: res.data.scale})
|
307
|
310
|
})
|
308
|
311
|
.catch((res) => {
|
309
|
312
|
// 请求失败处理...
|
|
@ -376,8 +379,8 @@ export default {
|
376
|
379
|
this.map.addLayer(this.layer.equipmentLayer)
|
377
|
380
|
this.aggregatedMapAreaList.coreEntitys.forEach(e => {
|
378
|
381
|
if (e.latitude) {
|
379
|
|
var url = '/static/images/ship.png'
|
380
|
|
var businessTypeName = '设备'
|
|
382
|
var url = ''
|
|
383
|
var businessTypeName = ''
|
381
|
384
|
this.toolTypes.forEach(t => {
|
382
|
385
|
if (e.coreEntityType == t.resourceToolType) {
|
383
|
386
|
url = t.iconUrl
|
|
@ -419,7 +422,7 @@ export default {
|
419
|
422
|
this.map.addLayer(this.layer.areaLayer)
|
420
|
423
|
this.aggregatedMapAreaList.mapAreas.forEach(e => {
|
421
|
424
|
var coverWktStr = e.mapAreaContent
|
422
|
|
var coverLayer = Ai.Polygon(coverWktStr, {color: e.areaColor, opacity: 1.0})
|
|
425
|
var coverLayer = Ai.Polygon(coverWktStr, {color: e.areaColor, opacity: 1.0, weight: 1.2})
|
423
|
426
|
coverLayer.setAttributes({'elementId': e.mapAreaId, 'mapAreaBusinessType': e.businessType})
|
424
|
427
|
this.layer.areaLayer.addLayer(coverLayer)
|
425
|
428
|
if (e.ebcEntityPositionList.length > 0) {
|
|
@ -489,6 +492,7 @@ export default {
|
489
|
492
|
if (e.mapAreaId == la.getAttributes().elementId) {
|
490
|
493
|
if (la.point) {
|
491
|
494
|
this.map.closePopup(la.point.popup)
|
|
495
|
la.point.popup.remove()
|
492
|
496
|
this.map.removeLayer(la.point)
|
493
|
497
|
}
|
494
|
498
|
if (e.ebcEntityPositionList.length > 0) {
|
|
@ -520,6 +524,7 @@ export default {
|
520
|
524
|
if (e.coreEntityId == la.getAttributes().elementId) {
|
521
|
525
|
if (la.point) {
|
522
|
526
|
this.map.closePopup(la.point.popup)
|
|
527
|
la.point.popup.remove()
|
523
|
528
|
this.map.removeLayer(la.point)
|
524
|
529
|
}
|
525
|
530
|
console.log(la.getAttributes().elementId)
|
|
@ -565,6 +570,7 @@ export default {
|
565
|
570
|
}
|
566
|
571
|
point.popup = Ai.Popup({
|
567
|
572
|
maxWidth: maxWidth,
|
|
573
|
minWidth: 100,
|
568
|
574
|
offset: offset,
|
569
|
575
|
autoClose: false,
|
570
|
576
|
autoPan: false,
|
|
@ -573,19 +579,28 @@ export default {
|
573
|
579
|
var content = '<div class="tips-item">'
|
574
|
580
|
if (type) {
|
575
|
581
|
content += '<div class="top"><div><b>' + type + '</b></div><div>' + name + '</div></div>'
|
|
582
|
content += '<div class="container">'
|
|
583
|
positionList.forEach(e => {
|
|
584
|
content +=
|
|
585
|
'<div class="' + this.getClassByStatus(e.locationStatus) + '">' + e.name + '</div>'
|
|
586
|
})
|
|
587
|
content += '</div></div>'
|
|
588
|
} else {
|
|
589
|
content += '<div class="container1">'
|
|
590
|
positionList.forEach(e => {
|
|
591
|
content +=
|
|
592
|
'<div class="' + this.getClassByStatus(e.locationStatus) + '">' + e.name + '</div>'
|
|
593
|
})
|
|
594
|
content += '</div></div>'
|
576
|
595
|
}
|
577
|
|
content += '<div class="container">'
|
578
|
|
positionList.forEach(e => {
|
579
|
|
content +=
|
580
|
|
'<div class="' + this.getClassByStatus(e.locationStatus) + '">' + e.name + '</div>'
|
581
|
|
})
|
582
|
|
content += '</div></div>'
|
583
|
596
|
// 设置弹出框弹出位置
|
584
|
597
|
point.popup.setLatLng(point.getLatLng())
|
585
|
598
|
// 设置弹出框弹出内容
|
586
|
599
|
point.popup.setContent(content)
|
587
|
600
|
if (this.switch1) {
|
588
|
601
|
point.popup.openOn(this.map)
|
|
602
|
} else {
|
|
603
|
this.popClose(point.popup)
|
589
|
604
|
}
|
590
|
605
|
// point.popup = popup
|
591
|
606
|
point.on('click', (e) => {
|
|
@ -630,7 +645,6 @@ export default {
|
630
|
645
|
var is = true
|
631
|
646
|
this.layer.personLayer.eachLayer((la) => {
|
632
|
647
|
if (element.entityId == la.getAttributes().elementId) {
|
633
|
|
debugger
|
634
|
648
|
is = false
|
635
|
649
|
this.map.closePopup(la.popup)
|
636
|
650
|
la.popup.remove()
|
|
@ -673,6 +687,21 @@ export default {
|
673
|
687
|
})
|
674
|
688
|
// this.map.setViewPort([points])
|
675
|
689
|
},
|
|
690
|
removeUnaggregated(po) { // 删除不聚合的人
|
|
691
|
this.layer.personLayer.eachLayer((la) => {
|
|
692
|
var e = undefined;
|
|
693
|
if (po.entityId == la.getAttributes().elementId) {
|
|
694
|
console.log('删除' + po.name)
|
|
695
|
this.map.closePopup(la.popup)
|
|
696
|
la.popup.remove()
|
|
697
|
e = la
|
|
698
|
}
|
|
699
|
if (e) {
|
|
700
|
this.map.removeLayer(e)
|
|
701
|
this.layer.personLayer.removeLayer(e)
|
|
702
|
}
|
|
703
|
})
|
|
704
|
},
|
676
|
705
|
getClassByStatus(status) {
|
677
|
706
|
switch (status) {
|
678
|
707
|
case '060': // 救援人员 ------ 黄色
|