-
Notifications
You must be signed in to change notification settings - Fork 326
Upgrading from v0.40.x to v1.0.x
Mapbox Navigation SDK for iOS v1.0.0 is the first major version of this SDK since the project started in 2016. To upgrade, follow the installation instructions. Note the new installation steps, including creating a secret Mapbox access token and adding it to a .netrc file.
Version 1.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.
- Minimum Carthage version required to install the SDK (if using Carthage): 0.35
- Minimum Xcode version required to build the SDK: 11.4.1
- Minimum iOS deployment target: 10.0
-
CoordinateBoundsclass was replaced byBoundingBox. -
Polylineis replaced withLineString. - Review existing
Polyline.closestCoordinate(to:)and otherLineString.IndexedCoordinateusage as its.distanceproperty now reflects it's description. Previously,Polyline.closestCoordinate(to:)showed distance between provided coordinate and the closestPolylinepoint. Now, it shows distance fromPolyline's first point, as stated in the doc.
Number of entities was renamed or replaced:
-
Tracepoint.alternateCountrenamed toTracepoint.countOfAlternatives. -
MBDefaultWalkingSpeedreplaced byCLLocationSpeed.normalWalking -
MBMinimumWalkingSpeedreplaced byCLLocationSpeed.minimumWalking -
MBMaximumWalkingSpeedreplaced byCLLocationSpeed.maximumWalking -
Route.coordinatesreplaced byRoute.shape -
RouteStep.coordinatesreplaced byRouteStep.shape -
Route.coordinateCountandRouteStep.coordinateCountproperties have been removed, useLineString.coordinatesinstead.
Other changes:
-
TransportType.none,ManeuverType.none, andManeuverDirection.noneare removed. To handle those cases, addcatching decoding error. - Removed the
Laneclass in favor of storing an array ofLaneIndicationsdirectly in theIntersection.approachLanes property. - Removed the
ComponentRepresentableprotocol,VisualInstructionComponentclass, andLaneIndicationComponentclass in favor of a VisualInstruction.Component enumeration that contains a VisualInstruction.Component.TextRepresentation and/or VisualInstruction.Component.ImageRepresentation, depending on the type of component. - The
RouteCompletionHandlerandMatchCompletionHandlerclosures’errorargument is now aDirectionsErrorinstead of anNSError. Update callbacks accordingly. - Classes such as
Route,Match, andRouteStepconform to theCodableprotocol. If you had your own implementation, remove it.
Symbols renamed or replaced:
- The
MGLStyle.navigationDayStyleURLandMGLStyle.navigationNightStyleURLproperties contain URLs to the Mapbox Navigation Day and Night v5 styles, both of which show traffic congestion lines on all roads by default. The traffic congestion layer is appropriate for a preview map; to tailor the style to turn-by-turn navigation, setMGLMapView.showsTraffictofalse. - Replaced the
MGLStyle.navigationPreviewDayStyleURLandMGLStyle.navigationGuidanceDayStyleURLproperties withMGLStyle.navigationDayStyleURL, and replacedMGLStyle.navigationPreviewNightStyleURLandMGLStyle.navigationGuidanceNightStyleURLwithMGLStyle.navigationNightStyleURL. - Removed
NavigationMapViewDelegate.navigationMapView(_:routeStyleLayerWithIdentifier:source:),NavigationMapViewDelegate.navigationMapView(_:routeCasingStyleLayerWithIdentifier:source:)in favor of four new delegate methods to customize the route styling. - Removed the
NavigationViewControllerDelegate.navigationViewController(_:imageFor:)andNavigationViewControllerDelegate.navigationViewController(_:viewFor:)methods in favor ofMGLMapViewDelegate.mapView(_:imageFor:)andMGLMapViewDelegate.mapView(_:viewFor:), respectively. - Deprecated
NavigationMapView.showRoutes(_:, legIndex:)andNavigationMapView.showWaypoints(_:legIndex:)methods. UseNavigationMapView.show(_:, legIndex:)andNavigationMapView.showWaypoints(on:legIndex:)instead.
Other changes:
- The
MGLStyle.navigationDayStyleURLandMGLStyle.navigationNightStyleURLproperties contain URLs to the Mapbox Navigation Day and Night v5 styles, both of which show traffic congestion lines on all roads by default. The traffic congestion layer is appropriate for a preview map; to tailor the style to turn-by-turn navigation, setMGLMapView.showsTraffictofalse. - Updated
FeedbackTypeenum to reflect new top level feedback categories and introduced newFeedbackSubTypesto support a more granular feedback mechanism. - Any classes, methods, or properties that were deprecated in v0.40.0 are no longer available. See your project’s build errors for details about replacements.
If you have any questions, please contact Mapbox’s support team.