IOS MKMapCamera三维地图

2019-07-10 15:45:04 浏览数 (2)

1 override func viewDidLoad() { 2 super.viewDidLoad() 3 // Do any additional setup after loading the view, typically from a nib. 4 5 let mapView = MKMapView(frame:self.view.bounds) 6 mapView.mapType = MKMapType.standard 7 8 let center = CLLocationCoordinate2DMake(39.915352, 116.397105) 9 let fromEye = CLLocationCoordinate2DMake(39.915352 0.1, 116.397105 0.1) 10 let altitude:CLLocationDistance = 100 11 let camera = MKMapCamera(lookingAtCenter:center, fromEyeCoordinate:fromEye, eyeAltitude: altitude) 12 mapView.camera = camera 13 14 self.view.addSubview(mapView) 15 }

0 人点赞