From 094027e3fe53a2171b6414c052c3d504e0d98e29 Mon Sep 17 00:00:00 2001 From: xweiba Date: Wed, 5 Aug 2026 23:05:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20MKLocalSearch=20=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E5=9D=90=E6=A0=87=E4=B8=8E=E8=BE=93=E5=85=A5=E5=9D=90=E6=A0=87?= =?UTF-8?q?=E5=AF=B9=E6=AF=94=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/MapHomeView.swift | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/App/MapHomeView.swift b/App/MapHomeView.swift index 1256caa..e715077 100644 --- a/App/MapHomeView.swift +++ b/App/MapHomeView.swift @@ -722,6 +722,13 @@ struct MapHomeView: View { mapState.selection.revision == revision, let placemark = placemarks.first else { return } + if let firstItem = mkResponse?.mapItems.first { + RuntimeLogger.info("APP", "Geocode", "MKLocalSearch 坐标对比", details: [ + "输入坐标": "\(coordinate.latitude), \(coordinate.longitude)", + "搜索返回坐标": "\(firstItem.placemark.coordinate.latitude), \(firstItem.placemark.coordinate.longitude)", + "名称": firstItem.name ?? "nil" + ]) + } let mapItemName = mkResponse?.mapItems.first?.name?.trimmingCharacters(in: .whitespacesAndNewlines) let mapItemPOI = mkResponse?.mapItems.first?.placemark.areasOfInterest?.first // 优先使⽤ MKLocalSearch 结果(与地图显⽰一致),CLGeocoder 作为 fallback