智慧园区前端大屏
shuishen
2025-09-15 17a81d641608545682e3f79f7c6090cac48fe81a
src/pages/map/components/scomponents/layersControl.vue
@@ -2,7 +2,7 @@
 * @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-15 18:09:46
 * @FilePath: \bigScreen\src\pages\map\components\scomponents\layersControl.vue
 * @Description:
 *
@@ -149,6 +149,7 @@
        label: '企业分布',
        type: 'layer',
        subType: 'labelPoint',
        customWx: true,
        method: getPage,
        params: {
            size: 1000
@@ -212,6 +213,7 @@
                label: '应急池',
                type: 'layer',
                subType: 'labelPoint',
                customWx: true,
                method: getList,
                params: {
                    type: 2,
@@ -738,6 +740,16 @@
    label: 'label',
}
let curAddClassDoms = []
watch(
    () => mapStore.needSelectID,
    (newValue, oldValue) => {
        curAddClassDoms = []
    }
)
const checkType = (value) => {
    if (typeof value === 'object' && value !== null && !Array.isArray(value)) {
        return 'obj'
@@ -846,6 +858,10 @@
                        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 = `
@@ -891,6 +907,15 @@
                            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