From d3ce652209c0dcd98ba46dc1ef101c21be737072 Mon Sep 17 00:00:00 2001 From: cwchen <1048842385@qq.com> Date: Thu, 15 Jan 2026 17:10:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=88=90=203=E7=A7=92=20?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=B8=80=E6=AC=A1=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/static/map.html | 41 ++++++----------------------------------- 1 file changed, 6 insertions(+), 35 deletions(-) diff --git a/src/static/map.html b/src/static/map.html index 0f54d43..aa8440d 100644 --- a/src/static/map.html +++ b/src/static/map.html @@ -561,40 +561,11 @@ }, /** - * 创建定位标记图标 + * 创建定位标记图标(使用 real_postion.png) */ createLocationIcon() { - // 创建一个带方向的箭头图标 - // 使用 Canvas 绘制一个圆形标记和方向箭头 - const canvas = document.createElement('canvas'); - canvas.width = 40; - canvas.height = 40; - const ctx = canvas.getContext('2d'); - - // 绘制圆形背景 - ctx.fillStyle = '#3388ff'; - ctx.beginPath(); - ctx.arc(20, 20, 15, 0, Math.PI * 2); - ctx.fill(); - - // 绘制白色边框 - ctx.strokeStyle = '#ffffff'; - ctx.lineWidth = 3; - ctx.beginPath(); - ctx.arc(20, 20, 15, 0, Math.PI * 2); - ctx.stroke(); - - // 绘制方向箭头(默认向上) - ctx.fillStyle = '#ffffff'; - ctx.beginPath(); - ctx.moveTo(20, 5); - ctx.lineTo(15, 15); - ctx.lineTo(25, 15); - ctx.closePath(); - ctx.fill(); - - // 转换为图片URL - this.locationIconUrl = canvas.toDataURL(); + // 直接使用静态图片作为定位图标 + this.locationIconUrl = './image/real_postion.png'; }, /** @@ -844,7 +815,7 @@ enableHighAccuracy: true, // 使用GPS精确定位 timeout: 15000 // 15秒超时(给GPS足够时间) }); - }, 5000); // 每5秒更新一次位置 + }, 3000); // 每5秒更新一次位置 // 保存geolocation实例,以便后续使用 this.baiduGeolocation = geolocation; @@ -928,7 +899,7 @@ console.error('uni-app GPS定位更新失败:', err); } }); - }, 5000); // 每5秒更新一次 + }, 3000); // 每3秒更新一次 }, /** @@ -1001,7 +972,7 @@ console.error('uni-app定位更新失败:', err); } }); - }, 5000); // 每5秒更新一次位置 + }, 3000); // 每3秒更新一次位置 }, /**