Apple Watch SwiftUI 地图事件?如何读取数字表冠旋转的当前区域跨度?

Apple Watch SwiftUI Map events? How do I read the current region span on digital crown rotation?

我的 Apple Watch SwiftUI 应用程序上有一个支持缩放的地图,我想在用户旋转数字表冠放大或缩小时保存当前缩放级别或区域跨度,以防止缩放到当新的用户位置到达时改变。这可能吗?如何使用 onChange 读取 Map.region.span 属性?

这是我在 watchOS 应用程序中使用的视图。如您所见,地图的初始化程序允许您使用所有这些不同的参数。因为这个视图是从提供信息的不同视图调用的,所以我使用 Bindings 作为参数,但如果视图是独立的,我可以很容易地使用 State 等。当然,地图上发生的任何变化都会反映在这些变量中。我传递的变量之一是区域。由于它在地图上以图形方式更改,因此它也在变量中更改。

struct WatchMapView: View {
    
    @EnvironmentObject var location: GeoLocation
    
    @ObservedObject var updater = Updater.shared

    @Binding var region: MKCoordinateRegion
    let userTrackingMode: MapUserTrackingMode = .none
    @Binding var currentPlace: Place
    @Binding var places: [Place]

    var body: some View {
        ZStack {
            Map(
                coordinateRegion: $region,
                interactionModes: MapInteractionModes.all,
                showsUserLocation: false,
                userTrackingMode: $userTrackingMode,
                annotationItems: places) { place in
                MapMarker(coordinate: place.coordinate, tint: .red)
            }
        }
    }
}