This commit is contained in:
yanran200730
2022-07-02 15:19:27 +08:00
parent 32935d94fc
commit 54f0d57b37
3 changed files with 47 additions and 20 deletions

View File

@@ -71,9 +71,6 @@
let {lib: TMap, map} = this
if (map) {
if (this.markers.length) {
console.log(this.MarkerCluster)
// this.MarkerCluster.destroy()
// this.MarkerCluster = null
this.markers.forEach(v => {
v.setMap(null)
})
@@ -134,6 +131,7 @@
enableDefaultStyle: false, // 关闭默认样式
geometries: points.map(e => ({
position: new TMap.LatLng(e.lat, e.lng),
id: e.id,
content: `${e.name}`,
properties: {...e}
})) || [],
@@ -164,11 +162,12 @@
cls.push(clusterBubble)
} else {
//点标记样式
let {content} = item.geometries?.[0] || {},
let {content, id} = item.geometries?.[0] || {},
overlay = new ClusterBubble({map, position: item.center, content})
overlay.on('click', () => {
this.buildPopup = true
this.building = item.geometries?.[0]?.properties || {}
uni.navigateTo({
url: `../AppMerchantManage/detail?id=${id}`
})
})
this.markers.push(overlay)
}