你如何设置地图的标题?

时间:2016-10-25 20:30:50

标签: ios swift dictionary camera mapbox

我正在使用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);

谢谢!

1 个答案:

答案 0 :(得分:1)

你大部分时间都在那里:使用MGLUserTrackingModeFollowWithHeading.FollowWithHeading)。