From e48903bf53af065d6edbd6ee5bd1142b07d13e5d Mon Sep 17 00:00:00 2001
From: guanqb <18720758508@163.com>
Date: Wed, 05 Apr 2023 00:30:35 +0800
Subject: [PATCH] 首页聚合样式
---
src/components/map/index.vue | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/components/map/index.vue b/src/components/map/index.vue
index 648000e..67f901d 100644
--- a/src/components/map/index.vue
+++ b/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)
--
Gitblit v1.9.3