From 4e105e71279d5b2fd680c07f86ddf89ec45b348d Mon Sep 17 00:00:00 2001 From: caill <815519168@qq.com> Date: Fri, 31 Oct 2025 10:06:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BB=BA=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/modules/build/gl-map.vue | 5 ++++- src/pages/modules/build/index.vue | 8 +++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/pages/modules/build/gl-map.vue b/src/pages/modules/build/gl-map.vue index f56fefa..da4c703 100644 --- a/src/pages/modules/build/gl-map.vue +++ b/src/pages/modules/build/gl-map.vue @@ -68,6 +68,7 @@ export default { updateThrottle: 50, // 数据更新节流间隔(ms) lastUpdateTime: 0, // resizeHandler: null // 存储resize事件处理函数 + hasYellowDot: false, yellowDotSprite: null, yellowDotInitialPos: null } @@ -221,6 +222,8 @@ export default { }); }, createYellowDot(initialX, initialY) { + if (this.hasYellowDot) return + this.hasYellowDot = true // 存储初始位置(后续不更新) this.yellowDotInitialPos = { x: initialX, y: initialY }; @@ -584,6 +587,7 @@ export default { if (this.reconnectTimer) clearTimeout(this.reconnectTimer) const pointData = JSON.parse(event.data) this.updatePointCloud(pointData.globalData) + this.createYellowDot(this.carPosition.x, this.carPosition.y) } catch (error) { console.error('解析点云数据失败:', error) } @@ -612,7 +616,6 @@ export default { }, init() { this.initWebSocket() - this.createYellowDot(this.carPosition.x, this.carPosition.y) // this.isLoading = false; // const pointData = points.data // this.updatePointCloud(pointData); diff --git a/src/pages/modules/build/index.vue b/src/pages/modules/build/index.vue index d6b4fe1..0009dbc 100644 --- a/src/pages/modules/build/index.vue +++ b/src/pages/modules/build/index.vue @@ -248,9 +248,11 @@ export default { if (res && res.code === 200) { this.message = this.$t('carbuildingmap') this.error = false - this.$nextTick(() => { - this.$refs.glMap.init() - }) + setTimeout(() => { + this.$nextTick(() => { + this.$refs.glMap.init() + }) + }, 2000) } this.loading.close() } catch (e) {