From f9b137b0f7f0558fc2d479e07f5c897955774ef2 Mon Sep 17 00:00:00 2001 From: xweiba Date: Wed, 5 Aug 2026 22:44:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=93=A6=E7=89=87=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E7=94=A8=E5=9D=90=E6=A0=87=E5=9C=B0=E7=90=86=E8=BE=B9=E7=95=8C?= =?UTF-8?q?=E5=88=A4=E6=96=AD=EF=BC=8C=E8=93=9D=E7=82=B9=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E5=AD=98=E4=B8=8D=E8=BD=AC=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/MapViewRepresentable.swift | 2 +- Shared/CoordinateConverter.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/App/MapViewRepresentable.swift b/App/MapViewRepresentable.swift index 97b0e36..48ebe84 100644 --- a/App/MapViewRepresentable.swift +++ b/App/MapViewRepresentable.swift @@ -260,7 +260,7 @@ struct MapViewRepresentable: UIViewRepresentable { parent.onViewportChanged(distance) zoomLabel?.text = MapZoomMath.viewportScaleLabel(distanceMeters: distance) updatePinPosition(on: mapView) - // 每次地图区域变化时更新瓦片坐标系类型 + // 根据地图中心坐标地理位置判断瓦片类型(中国境内=GCJ-02,境外=WGS-84) let c = mapView.centerCoordinate CoordinateConverter.updateTileType(lat: c.latitude, lon: c.longitude) // 同步蓝点坐标(避免 delegate 更新不及时导致 mapState.realtimeLocation 为 nil) diff --git a/Shared/CoordinateConverter.swift b/Shared/CoordinateConverter.swift index 17fcf6b..98730c5 100644 --- a/Shared/CoordinateConverter.swift +++ b/Shared/CoordinateConverter.swift @@ -20,7 +20,7 @@ enum CoordinateConverter { /// 当前地图瓦片坐标系(每次从地图拿到坐标后更新) @MainActor static var currentTileType = CoordType.gcj02 - /// 从地图坐标推算当前瓦片类型并更新全局状态 + /// 根据坐标的地理位置判断 MKMapView 瓦片类型(中国境内 = GCJ-02,境外 = WGS-84) @MainActor static func updateTileType(lat: Double, lon: Double) { let type = detectType(lat: lat, lon: lon)