fix: 瓦片类型仅由搜索结果坐标+蓝点推算,去掉其他判断逻辑

This commit is contained in:
xweiba
2026-08-05 23:15:06 +08:00
parent 3260af748b
commit 794cf9d004
3 changed files with 25 additions and 20 deletions
+12 -1
View File
@@ -795,7 +795,18 @@ struct MapHomeView: View {
searchError = error.localizedDescription
return
}
searchResults = (response?.mapItems ?? []).prefix(6).map { item in
let items = (response?.mapItems ?? []).prefix(6)
//
if let first = items.first {
let c = first.placemark.coordinate
if let newType = CoordinateConverter.detectTile(
resultCoord: (c.latitude, c.longitude),
userLocation: mapState.realtimeLocation
) {
CoordinateConverter.currentTileType = newType
}
}
searchResults = items.map { item in
let r = SearchLocationResult(
name: item.name ?? "未命名",
subtitle: [item.placemark.locality, item.placemark.subLocality, item.placemark.thoroughfare]