How to display entire globe in MKMapView

扶醉桌前 提交于 2019-12-02 00:38:48

Change the map to Hybrid Flyover or Satellite Flyover and Enable 3D View from storyboard

Call this function from viewDidLoad updateMapToShowGlobe(location: mapView.centerCoordinate)

// MARK: Snippet to show full globe in 3d view
private func updateMapToShowGlobe(location :CLLocationCoordinate2D) {
    let span = MKCoordinateSpanMake(130, 130)
    let region = MKCoordinateRegionMake(location, span)
    if( region.center.latitude > -90 && region.center.latitude < 90 && region.center.longitude > -180 && region.center.longitude < 180 ){
        mapView.setRegion(region, animated: true)
    }
}

It's like so sad since there have been so wrong informations down below.
It's so easy to do at least in iOS 12, November 2018.

That's all you need to do to get globe view.

either

mapView.mapType = .satelliteFlyover 

or

mapView.mapType = .hybridFlyover

(I am not sure and it has no technical basis but it feels like .hybridFlyover shows better performance in my experience)

That's all though :p;;
I make sure it works because I did it right before.

I hope you find it useful.

According to one of Apple's technical support staff, it appears that this view is not accessible using MapKit:

This view is not available through MapKit.

https://forums.developer.apple.com/thread/101479

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!