guanqb
2023-04-05 e48903bf53af065d6edbd6ee5bd1142b07d13e5d
src/components/map/index.vue
@@ -744,7 +744,7 @@
         * @param {*} layerName 图层名称
         * @param {*} type 图层类型
         */
        mapAddLayer (layerName, type) {
        mapAddLayer (layerName, type, ClusterLayerType) {
            if (type == 'VectorLayer') {
                if (!layersObjcect[layerName]) layersObjcect[layerName] = null
@@ -753,9 +753,8 @@
                layersObjcect[layerName].addTo(global.viewer)
            } else if (type == 'ClusterLayer') {
                if (!layersObjcect[layerName]) layersObjcect[layerName] = null
                layersObjcect[layerName] = new global.DC.ClusterLayer(layerName, {
                    pixelRange: 40
                    pixelRange: 40, style: ClusterLayerType
                })
                layersObjcect[layerName].addTo(global.viewer)
@@ -831,7 +830,7 @@
            far: Number.MAX_VALUE //最远距离
        }, incident = (e) => { }, mouseOverIncident = (e) => { }, mouseOutIncident = (e) => { }, pointMouseMove = (e) => { }) {
            if (!layersObjcect[layerName] || layersObjcect[layerName] == null) {
                this.mapAddLayer(layerName, layerType)
                this.mapAddLayer(layerName, layerType, params.ClusterLayerType)
            }
            let pointElement
@@ -844,6 +843,7 @@
                pointElement = new global.DC.Billboard(new global.DC.Position(Number(params.lng), Number(params.lat), 4), params.url)
                pointElement.setStyle(params.setStyle)
                pointElement.size = [32, 32]
                pointElement.style = "clustering"
                pointElement.attrParams = params
                layersObjcect[layerName].addOverlay(pointElement)
                pointElement.on(global.DC.MouseEventType.CLICK, incident)