Skip to content

Commit

Permalink
Fixed camera initializer deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
1ec5 committed Nov 7, 2018
1 parent e39dcf0 commit 6f01af8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion MapboxNavigation/CarPlayNavigationViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public class CarPlayNavigationViewController: UIViewController {

// Update the user puck
mapView?.updatePreferredFrameRate(for: routeProgress)
let camera = MGLMapCamera(lookingAtCenter: location.coordinate, fromDistance: 120, pitch: 60, heading: location.course)
let camera = MGLMapCamera(lookingAtCenter: location.coordinate, altitude: 120, pitch: 60, heading: location.course)
mapView?.updateCourseTracking(location: location, camera: camera, animated: true)

let congestionLevel = routeProgress.averageCongestionLevelRemainingOnLeg ?? .unknown
Expand Down
2 changes: 1 addition & 1 deletion MapboxNavigation/NavigationMapView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ open class NavigationMapView: MGLMapView, UIGestureRecognizerDelegate {
if tracksUserCourse {
let point = userAnchorPoint
let padding = UIEdgeInsets(top: point.y, left: point.x, bottom: bounds.height - point.y, right: bounds.width - point.x)
let newCamera = camera ?? MGLMapCamera(lookingAtCenter: location.coordinate, fromDistance: altitude, pitch: 45, heading: location.course)
let newCamera = camera ?? MGLMapCamera(lookingAtCenter: location.coordinate, altitude: altitude, pitch: 45, heading: location.course)
let function: CAMediaTimingFunction? = animated ? CAMediaTimingFunction(name: kCAMediaTimingFunctionLinear) : nil
setCamera(newCamera, withDuration: duration, animationTimingFunction: function, edgePadding: padding, completionHandler: nil)
}
Expand Down

0 comments on commit 6f01af8

Please sign in to comment.