Skip to content

Upgrading from v1.x to v2.0.x

Minh Nguyễn edited this page Mar 10, 2021 · 20 revisions

Mapbox Navigation SDK for iOS v2.0.0 is a major new version of the SDK. To upgrade, follow the installation instructions. Note that the MapboxNavigation framework’s Carthage support has been discontinued in favor of Swift Package Manager.

Starting with version v2.0.0, the Mapbox Navigation SDK is licensed under the Mapbox Terms of Service, a proprietary license. It is no longer available under the permissive ISC License.

Version 2.0.0 includes numerous important changes to the public APIs of the MapboxNavigation and MapboxCoreNavigation frameworks as well as their dependencies. There are several backwards-incompatible changes to be aware of as you upgrade, which are discussed below and divided by framework so that you can upgrade different portions of your application at different times.

System requirements

  • Supported dependency managers:
    • Swift Package Manager (new)
    • CocoaPods
    • Carthage (MapboxCoreNavigation only; MapboxNavigation no longer supported)
  • Minimum Xcode version required to build the SDK: 12.4 (11.x no longer supported)
  • Minimum iOS deployment target: 11.0 (10.x no longer supported)

Upgrading Turf from v1.x to v2.0.0

Symbols renamed or replaced:

  • Renamed BoundingBox(_:_:) to BoundingBox(southWest:northEast:).

Upgrading MapboxDirections from v1.x to v2.0.0

  • The preferred way to set your Mapbox access token is to set the MBXAccessToken key in your application’s Info.plist. MGLMapboxAccessToken is still supported as a deprecated fallback.

Upgrading MapboxSpeech from v1.x to v2.0.0

  • The preferred way to set your Mapbox access token is to set the MBXAccessToken key in your application’s Info.plist. MGLMapboxAccessToken is still supported as a deprecated fallback.

Upgrading from Mapbox Maps SDK v6.x to MapboxMaps v10.0.0

Mapbox Maps SDK v10 introduces 3D terrain, improves performance, and upgrades from OpenGL to Metal. Please consult the v10 migration guide, which details many changes that likely affect your application’s user interface code.

Other changes:

  • The preferred way to set your Mapbox access token is to set the MBXAccessToken key in your application’s Info.plist. MGLMapboxAccessToken is no longer supported.

Upgrading MapboxNavigation from v1.x to v2.0.0

Map

Symbols renamed or replaced:

  • Removed obsoleted NavigationMapView.navigationMapDelegate, which was replaced by NavigationMapView.delegate.
  • Renamed NavigationMapView.navigationMapViewDelegate to NavigationMapView.delegate.
  • Renamed NavigationMapViewController.mapView to NavigationMapViewController.navigationMapView.
  • Removed NavigationAnnotation.
  • NavigationMapView.updateCourseTracking(location:camera:animated:) accepts a CameraOptions as an argument instead of an MGLMapCamera.
  • Removed NavigationMapView.showsUserLocation, because NavigationMapView no longer inherits from MGLMapView. NavigationMapView.mapView is now exposed as public property instead.
  • Changed the type of NavigationViewController.pendingCamera from MGLMapCamera to CameraOptions.
  • Renamed the Constants.MBRouteLineWidthByZoomLevel variable to Constants.MBRouteLineWidthByZoomLevel, which now accepts Double for keys and values.
  • Renamed the MBCurrentLegAttribute property to CurrentLegAttribute.
  • Renamed the MBCongestionAttribute property to CongestionAttribute.
  • Renamed NavigationViewController.mapView to NavigationViewController.navigationMapView.
  • Renamed NavigationMapView.highlightBuildings(at:in3D:) to NavigationMapView.highlightBuildings(at:in3D:completion:).

Location tracking

Symbols renamed or replaced:

  • PassiveLocationManager now conforms to LocationProvider protocol instead of MGLLocationManager.
  • Changed the type of the PassiveLocationManager.delegate property from MGLLocationManagerDelegate to LocationProviderDelegate.
  • Replaced the PassiveLocationManager.accuracyAuthorization() method with the PassiveLocationManager.accuracyAuthorization property, which now returns CLAccuracyAuthorization instead of MBNavigationAccuracyAuthorization.
  • Renamed PassiveLocationManager.startUpdatingLocation(completionHandler:) to PassiveLocationManager.startUpdatingLocation(). This method now runs synchronously like CLLocationManager.startUpdatingLocation().

CarPlay

Symbols renamed or replaced:

  • Removed the deprecated CarPlayNavigationDelegate.carPlayNavigationViewControllerDidArrive(_:) method.
  • Renamed CarPlayManager.mapView to CarPlayManager.navigationMapView.
  • Removed the deprecated CarPlayManager.overviewButton property.
  • Removed the unused CarPlayNavigationViewController.drivingSide property.

Other changes

Symbols renamed or replaced:

  • Removed the deprecated InstructionsBannerViewDelegate.didDragInstructionsBanner(_:) method.
  • Removed the unused NavigationViewController.origin property.

If you have any questions, please contact Mapbox’s support team.

Clone this wiki locally