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)