|
@@ -84,7 +84,7 @@ const initDeviceMarkers = () => {
|
|
map.value.clearOverlays()
|
|
map.value.clearOverlays()
|
|
|
|
|
|
const zoomLevel = map.value.getZoom()
|
|
const zoomLevel = map.value.getZoom()
|
|
- if (zoomLevel > 8) {
|
|
|
|
|
|
+ if (zoomLevel > 9) {
|
|
// 高缩放级别下显示单个设备标记
|
|
// 高缩放级别下显示单个设备标记
|
|
devices.value.forEach((device) => {
|
|
devices.value.forEach((device) => {
|
|
const point = new (window as any).BMap.Point(device.lng, device.lat)
|
|
const point = new (window as any).BMap.Point(device.lng, device.lat)
|
|
@@ -170,7 +170,7 @@ const createClusterLabel = (cluster: Cluster, point: any) => {
|
|
fontWeight: 'bold',
|
|
fontWeight: 'bold',
|
|
boxShadow: '0 2px 4px rgba(0, 0, 0, 0.2)',
|
|
boxShadow: '0 2px 4px rgba(0, 0, 0, 0.2)',
|
|
transition: 'all 0.3s ease',
|
|
transition: 'all 0.3s ease',
|
|
- border: '4px solid rgba(255, 255, 255, 0.5)', // 添加带有不透明度的边框
|
|
|
|
|
|
+ border: '7px solid rgba(255, 255, 255, 0.5)', // 添加带有不透明度的边框
|
|
animation: 'breathing 2s infinite' // 添加呼吸动画
|
|
animation: 'breathing 2s infinite' // 添加呼吸动画
|
|
})
|
|
})
|
|
|
|
|
|
@@ -188,7 +188,7 @@ const createClusterLabel = (cluster: Cluster, point: any) => {
|
|
|
|
|
|
// 添加点击事件
|
|
// 添加点击事件
|
|
label.addEventListener('click', () => {
|
|
label.addEventListener('click', () => {
|
|
- map.value?.setZoom(9)
|
|
|
|
|
|
+ map.value?.setZoom(10)
|
|
map.value?.panTo(point)
|
|
map.value?.panTo(point)
|
|
})
|
|
})
|
|
|
|
|
|
@@ -223,7 +223,7 @@ const clusterDevices = (devices: IotDeviceVO[], map: any): Cluster[] => {
|
|
}
|
|
}
|
|
|
|
|
|
const getGridSize = (zoom: number): number => {
|
|
const getGridSize = (zoom: number): number => {
|
|
- if (zoom <= 5) return 2
|
|
|
|
|
|
+ if (zoom <= 5) return 1
|
|
if (zoom <= 8) return 1
|
|
if (zoom <= 8) return 1
|
|
if (zoom < 10) return 5
|
|
if (zoom < 10) return 5
|
|
return 0.1
|
|
return 0.1
|