Friday, July 26, 2024
HomeiOS Developmentswift - iOS 17 MapKit .customary does not enable for a globe...

swift – iOS 17 MapKit .customary does not enable for a globe view when zoomed out


I am engaged on organising a really fundamental mapview with MapKit for my iPhone on iOS 17. I seen that the Apple maps app does not have this situation however I actually could not discover a lot about this matter apart from a thread in August of 2023 the place a poster stated that there was a bug not permitting the .customary map type to seem as a globe when zoomed out.

import SwiftUI
import MapKit

struct MapViewRepresentable: UIViewRepresentable {
    func makeUIView(context: Context) -> MKMapView {
        let mapView = MKMapView(body: .zero)
        
        // Set map kind to hybrid flyover for a extra globe-like look
        mapView.mapType = .hybridFlyover
        
        // Configure digital camera for a globe-like view
        let digital camera = MKMapCamera()
        digital camera.centerCoordinate = CLLocationCoordinate2D(latitude: 0, longitude: 0)
        digital camera.altitude = 20000000 // Regulate altitude for desired zoom degree
        digital camera.pitch = 60 // Regulate pitch for a extra globe-like view
        digital camera.heading = 0
        
        mapView.setCamera(digital camera, animated: false)
        
        return mapView
    }
    
    func updateUIView(_ uiView: MKMapView, context: Context) {
        // Replace the view if wanted
    }
}

struct ContentView: View {
    var physique: some View {
        MapViewRepresentable()
            .edgesIgnoringSafeArea(.all)
    }
}

#Preview {
    ContentView()
}

anyway, that’s my code and I’ve actually tried all kinds of how to get the .customary map type to seem as a globe, however to the most effective of my data it is not doable in iOS 17 and I am unable to appear to determine why? It is fairly puzzling because the satellite tv for pc view works simply superb.



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments