From 39e3d266e9d59ec693797a334ba59f100f7643a0 Mon Sep 17 00:00:00 2001 From: cwchen <1048842385@qq.com> Date: Thu, 15 Jan 2026 18:21:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/static/map.html | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/static/map.html b/src/static/map.html index 8796e6f..350da37 100644 --- a/src/static/map.html +++ b/src/static/map.html @@ -759,6 +759,16 @@ this.initLocationTracking(); } }); + + // 网络状态监听(如果运行在 UniApp 环境中) + window.addEventListener('online', () => { + if (App.map) { + // 网络恢复时,稍微缩放一下地图,触发瓦片重新加载,避免卡死在白屏状态 + const zoom = App.map.getZoom(); + App.map.setZoom(zoom + 0.01); + setTimeout(() => App.map.setZoom(zoom), 100); + } + }); }, /**