I hope to use SwiftUI and MapKit to achieve the effect of a globe view when zooming out on the map. The code works in Xcode’s simulator and Simulator, but when running on my iPhone, it only zooms out to a flat world map. I haven’t found anyone else encountering the same issue, so I’d like to ask where the problem might be. Below is the simple code:
import SwiftUI
import MapKit
struct GlobalTest: View {
var body: some View {
Map(position: .constant(.automatic), interactionModes: [.all, .pan, .pitch, .rotate, .zoom]) {
}
.mapStyle(.hybrid(elevation: .realistic,
pointsOfInterest: .including([.park]),
showsTraffic: false))
}
}
#Preview {
GlobalTest()
}
I have also tried setting the camera properties, but it still doesn’t work. My phone is an iPhone 15 Pro Max, running iOS 17.5.1, and I am in mainland China. The Xcode version is the latest. If anyone understands the reason, please let me know. This is very important to me, and I would be very grateful!