diff --git a/web/src/views/HandDevice/Home/components/services/animation.service.ts b/web/src/views/HandDevice/Home/components/services/animation.service.ts index 64de4bb..dba284c 100644 --- a/web/src/views/HandDevice/Home/components/services/animation.service.ts +++ b/web/src/views/HandDevice/Home/components/services/animation.service.ts @@ -138,7 +138,7 @@ export class AnimationService { } addAll(markers: MarkerData[]) { - console.time('animationService addAll') + // console.time('animationService addAll') this.statusColor.clear() this.statusColorStyleMap.clear() // this.clear() @@ -151,12 +151,13 @@ export class AnimationService { markers.forEach((marker) => { const feature = new Feature({ geometry: new Point(fromLonLat(marker.coordinates)), - markerData: marker + markerData: marker, + rippleColor: marker.statusColor }) // 设置动画开始时间 // feature.set('animationStart', Date.now()) - feature.set('rippleColor', marker.statusColor) + // feature.set('rippleColor', marker.statusColor) features.push(feature) if (marker.statusColor) { this.statusColor.add(marker.statusColor) @@ -164,7 +165,7 @@ export class AnimationService { }) source?.addFeatures(features) this.rippleLayer?.setSource(source) - console.timeEnd('animationService addAll') + // console.timeEnd('animationService addAll') } show() { diff --git a/web/src/views/HandDevice/Home/components/services/marker.service.ts b/web/src/views/HandDevice/Home/components/services/marker.service.ts index 1904710..61d3605 100644 --- a/web/src/views/HandDevice/Home/components/services/marker.service.ts +++ b/web/src/views/HandDevice/Home/components/services/marker.service.ts @@ -42,7 +42,7 @@ export class MarkerService { * 更新标记数据 */ async updateData(markers: MarkerData[]) { - console.time('create features') + // console.time('create features') const features: Feature[] = [] markers.forEach((marker) => { const feature = new Feature({ @@ -54,16 +54,16 @@ export class MarkerService { feature.setStyle(createMarkerStyle(statusColor)) features.push(feature) }) - console.timeEnd('create features') + // console.timeEnd('create features') await nextTick() - console.time('add features') + // console.time('add features') const vectorSource = new VectorSource() vectorSource.addFeatures(features) this.markerLayer?.getSource()?.setSource(vectorSource) - console.timeEnd('add features') + // console.timeEnd('add features') this.getSinglePointsInView() } setClusterDistance = debounce(() => { @@ -79,6 +79,8 @@ export class MarkerService { distance = 80 } else if (zoom <= 10) { distance = 50 + } else if (zoom <= 14) { + distance = 40 } else if (zoom <= 16) { distance = 20 } else if (zoom <= 17) { diff --git a/web/src/views/gas/handdetector/HandDetectorForm.vue b/web/src/views/gas/handdetector/HandDetectorForm.vue index 645b1ad..b9ed089 100644 --- a/web/src/views/gas/handdetector/HandDetectorForm.vue +++ b/web/src/views/gas/handdetector/HandDetectorForm.vue @@ -1,5 +1,5 @@