| | |
| | | * @Author: shuishen 1109946754@qq.com |
| | | * @Date: 2024-10-31 10:47:29 |
| | | * @LastEditors: shuishen 1109946754@qq.com |
| | | * @LastEditTime: 2025-08-18 18:49:54 |
| | | * @LastEditTime: 2025-09-11 22:51:34 |
| | | * @FilePath: \bigScreen\src\pages\map\components\scomponents\layersControl.vue |
| | | * @Description: |
| | | * |
| | |
| | | label: '企业分布', |
| | | type: 'layer', |
| | | subType: 'labelPoint', |
| | | customWx: true, |
| | | method: getPage, |
| | | params: { |
| | | size: 1000 |
| | |
| | | label: '应急池', |
| | | type: 'layer', |
| | | subType: 'labelPoint', |
| | | customWx: true, |
| | | method: getList, |
| | | params: { |
| | | type: 2, |
| | |
| | | label: 'label', |
| | | } |
| | | |
| | | let curAddClassDoms = [] |
| | | |
| | | watch( |
| | | () => mapStore.needSelectID, |
| | | (newValue, oldValue) => { |
| | | curAddClassDoms = [] |
| | | } |
| | | ) |
| | | |
| | | |
| | | const checkType = (value) => { |
| | | if (typeof value === 'object' && value !== null && !Array.isArray(value)) { |
| | | return 'obj' |
| | |
| | | data.filter(i => i.lng && i.lng != '' && i.lat && i.lat != '').forEach(i => { |
| | | let iconEl = '' |
| | | |
| | | let flag = mapStore.needSelectID.some(o => i.id === o) |
| | | |
| | | flag && curAddClassDoms.push(i) |
| | | |
| | | if ('showPanel' in item && item.showPanel == false) { |
| | | if (item.backgroundIcon) { |
| | | iconEl = ` |
| | |
| | | |
| | | let divIcon = new DC.DivIcon( |
| | | new DC.Position(i.lng, i.lat, i.ele || 64), |
| | | `<div class="public-map-popup ${item.className || ''}"> |
| | | `<div class="public-map-popup ${item.className || ''} ${flag ? 'is-need-item' : ''}"> |
| | | ${iconEl} |
| | | </div>` |
| | | ) |
| | |
| | | |
| | | addTileLayers[item.layerName].addOverlay(divIcon) |
| | | }) |
| | | |
| | | if (curAddClassDoms.length == 1) { |
| | | window.$viewer.zoomToPosition(new DC.Position(curAddClassDoms[0].lng, curAddClassDoms[0].lat, 3000, 0, -90, 0)) |
| | | } |
| | | |
| | | if (curAddClassDoms.length > 1) { |
| | | let center = window.$turf.midpoint(...curAddClassDoms.map(i => window.$turf.point([i.lng, i.lat]))) |
| | | window.$viewer.zoomToPosition(new DC.Position(center.geometry.coordinates[0], center.geometry.coordinates[1], 4200, 0, -90, 0)) |
| | | } |
| | | }) |
| | | } else { |
| | | addTileLayers[item.layerName].show = true |