你如何设置地图的标题?
How do you set the heading of the map?
我正在使用 Mapbox,我试图在用户通过地图移动时跟随用户。但是如何让相机的转动方向与现实生活中用户的转动方向相同?
//Create a new MKMapCamera object
let newCameraPosition = MGLMapCamera(lookingAtCenterCoordinate: mapView.centerCoordinate, fromDistance: mapView.camera.altitude + 65, pitch: 70, heading: 0)
// Then you could call it like this
mapView.camera = newCameraPosition
// Track users location
self.mapView.setUserTrackingMode(MGLUserTrackingMode.Follow, animated: true);
谢谢!
您已完成大部分操作:使用 MGLUserTrackingModeFollowWithHeading
(.FollowWithHeading
)。
我正在使用 Mapbox,我试图在用户通过地图移动时跟随用户。但是如何让相机的转动方向与现实生活中用户的转动方向相同?
//Create a new MKMapCamera object
let newCameraPosition = MGLMapCamera(lookingAtCenterCoordinate: mapView.centerCoordinate, fromDistance: mapView.camera.altitude + 65, pitch: 70, heading: 0)
// Then you could call it like this
mapView.camera = newCameraPosition
// Track users location
self.mapView.setUserTrackingMode(MGLUserTrackingMode.Follow, animated: true);
谢谢!
您已完成大部分操作:使用 MGLUserTrackingModeFollowWithHeading
(.FollowWithHeading
)。