Releases: mapbox/mapbox-directions-swift
Releases · mapbox/mapbox-directions-swift
v0.33.0
- Fixed an issue where decoding and reencoding a JSON-formatted response from the Mapbox Directions API would cause the
voiceLocale
property to be omitted from route objects. (#424) - Added the
Route(legs:shape:distance:expectedTravelTime:)
andRoute(from:)
initializers. (#430) - Fixed an issue where
VisualInstruction.Component.guidanceView
lacked an image URL. (#432)
Documentation is available online or within Xcode.
v0.32.0
- Removed the
CoordinateBounds
struct in favor ofBoundingBox
from Turf. (#427) - Added the
VisualInstructionBanner.quaternaryInstruction
property andVisualInstruction.Component.guidanceView(image:alternativeText:)
enumeration case to represent a detailed image of an upcoming junction. (#425)
Documentation is available online or within Xcode.
v0.31.0
Packaging
- Renamed MapboxDirections.swift to Mapbox Directions for Swift. The CocoaPods pod is now named MapboxDirections, matching the module name. (#400)
- This library now requires a minimum deployment target of iOS 10.0 or above, macOS 10.12.0 or above, tvOS 10.0 or above, or watchOS 3.0 or above. Older operating system versions are no longer supported. (#379)
- Swift is now required to directly use public types and methods defined by this library. If your application is written in Objective-C or Cocoa-AppleScript, you need to implement your own wrapper in Swift that bridges to Objective-C. (#382)
- This library now depends on Turf. (#382)
Error handling
- The
RouteCompletionHandler
andMatchCompletionHandler
closures’error
argument is now aDirectionsError
instead of anNSError
. (#382) - Classes such as
Route
,Match
, andRouteStep
conform to theCodable
protocol, so you can create instances of them from JSON-formattedData
usingJSONDecoder
and round-trip them back to JSON usingJSONEncoder
. Malformed input now throws decoding errors instead of crashing by unwrappingnil
s. (#382)
Visual instructions
- Removed the
Lane
class in favor of storing an array ofLaneIndication
s directly in theIntersection.approachLanes
property. (#382) - Removed the
ComponentRepresentable
protocol,VisualInstructionComponent
class, andLaneIndicationComponent
class in favor of aVisualInstruction.Component
enumeration that contains aVisualInstruction.Component.TextRepresentation
and/orVisualInstruction.Component.ImageRepresentation
, depending on the type of component. (#382) - Added the
VisualInstruction.Component.ImageRepresentation.imageURL(scale:format:)
method for fetching images with scales other than the current screen’s native scale or formats other than PNG. (#382)
Other changes
- Removed support for Mapbox Directions API v4. (#382)
- Replaced the
MBDefaultWalkingSpeed
,MBMinimumWalkingSpeed
, andMBMaximumWalkingSpeed
constants withCLLocationSpeed.normalWalking
,CLLocationSpeed.minimumWalking
, andCLLocationSpeed.maximumWalking
, respectively. - Replaced the
Route.coordinates
property withRoute.shape
and theRouteStep.coordinates
property withRouteStep.shape
. TheRoute.coordinateCount
andRouteStep.coordinateCount
properties have been removed, but you can use theLineString.coordinates
property to get the array ofCLLocationCoordinate2D
s. (#382) RouteLeg.source
andRouteLeg.destination
are now optional. They can benil
when theRouteLeg
object is decoded individually from JSON. (#382)- Removed
TransportType.none
,ManeuverType.none
, andManeuverDirection.none
. UnrecognizedTransportType
andManeuverDirection
values now raise decoding errors. (#382) RouteStep.maneuverType
is now optional. (#382)- Renamed the
Tracepoint.alternateCount
property toTracepoint.countOfAlternatives
. (#382) - The
Intersection.approachIndex
andIntersection.outletIndex
properties are now optional, not −1, in the case of a departure or arrival maneuver. (#393) - Added initializers for
Route
,Match
,RouteLeg
, andRouteStep
. (#393) - Various properties of
Route
,RouteLeg
, andRouteStep
are now writable. (#393) - Added
AttributeOptions.maximumSpeedLimit
for getting maximum posted speed limits in theRouteLeg.segmentMaximumSpeedLimits
property. (#367) - Added the
RouteLeg.segmentRangesByStep
property for more easily associatingRouteStep
s with the values in segment-based arrays such asRouteLeg.segmentCongestionLevels
. (#367) - The
RouteOptions.alleyPriority
property now works withDirectionsProfileIdentifier.automobile
, allowing you to request routes that prefer or avoid alleys while driving. (#416)
Documentation is available online or within Xcode.
v1.0.0-alpha.1
Packaging
- Renamed MapboxDirections.swift to Mapbox Directions for Swift. The CocoaPods pod is now named MapboxDirections, matching the module name. (#400)
- This library now requires a minimum deployment target of iOS 10.0 or above, macOS 10.12.0 or above, tvOS 10.0 or above, or watchOS 3.0 or above. Older operating system versions are no longer supported. (#379)
- Swift is now required to directly use public types and methods defined by this library. If your application is written in Objective-C or Cocoa-AppleScript, you need to implement your own wrapper in Swift that bridges to Objective-C. (#382)
- This library now depends on Turf. (#382)
Error handling
- The
RouteCompletionHandler
andMatchCompletionHandler
closures’error
argument is now aDirectionsError
instead of anNSError
. (#382) - Classes such as
Route
,Match
, andRouteStep
conform to theCodable
protocol, so you can create instances of them from JSON-formattedData
usingJSONDecoder
and round-trip them back to JSON usingJSONEncoder
. Malformed input now throws decoding errors instead of crashing by unwrappingnil
s. (#382)
Visual instructions
- Removed the
Lane
class in favor of storing an array ofLaneIndication
s directly in theIntersection.approachLanes
property. (#382) - Removed the
ComponentRepresentable
protocol,VisualInstructionComponent
class, andLaneIndicationComponent
class in favor of aVisualInstruction.Component
enumeration that contains aVisualInstruction.Component.TextRepresentation
and/orVisualInstruction.Component.ImageRepresentation
, depending on the type of component. (#382) - Added the
VisualInstruction.Component.ImageRepresentation.imageURL(scale:format:)
method for fetching images with scales other than the current screen’s native scale or formats other than PNG. (#382)
Other changes
- Removed support for Mapbox Directions API v4. (#382)
- Replaced the
MBDefaultWalkingSpeed
,MBMinimumWalkingSpeed
, andMBMaximumWalkingSpeed
constants withCLLocationSpeed.normalWalking
,CLLocationSpeed.minimumWalking
, andCLLocationSpeed.maximumWalking
, respectively. - Replaced the
Route.coordinates
property withRoute.shape
and theRouteStep.coordinates
property withRouteStep.shape
. TheRoute.coordinateCount
andRouteStep.coordinateCount
properties have been removed, but you can use theLineString.coordinates
property to get the array ofCLLocationCoordinate2D
s. (#382) RouteLeg.source
andRouteLeg.destination
are now optional. They can benil
when theRouteLeg
object is decoded individually from JSON. (#382)- Removed
TransportType.none
,ManeuverType.none
, andManeuverDirection.none
. UnrecognizedTransportType
andManeuverDirection
values now raise decoding errors. (#382) RouteStep.maneuverType
is now optional. (#382)- Renamed the
Tracepoint.alternateCount
property toTracepoint.countOfAlternatives
. (#382) - The
Intersection.approachIndex
andIntersection.outletIndex
properties are now optional, not −1, in the case of a departure or arrival maneuver. (#393) - Added initializers for
Route
,Match
,RouteLeg
, andRouteStep
. (#393) - Various properties of
Route
,RouteLeg
, andRouteStep
are now writable. (#393) - Added
AttributeOptions.maximumSpeedLimit
for getting maximum posted speed limits in theRouteLeg.segmentMaximumSpeedLimits
property. (#367) - Added the
RouteLeg.segmentRangesByStep
property for more easily associatingRouteStep
s with the values in segment-based arrays such asRouteLeg.segmentCongestionLevels
. (#367)
Documentation is available online or within Xcode.
v0.30.0
Directions.fetchAvailableOfflineVersions(completionHandler:)
andDirections.downloadTiles(in:version:completionHandler:)
now resumes the data task before returning it to conform to its naming conventions and avoid confusion. (#353)
Documentation is available online or within Xcode.
v0.29.0
v0.28.0
- Added the
RouteOptions.alleyPriority
,RouteOptions.walkwayPriority
, andRouteOptions.speed
properties for fine-tuning walking directions. (#370) - Added the
MBStringFromManeuverType()
,MBStringFromManeuverDirection()
,MBStringFromDrivingSide()
, andMBStringFromTransportType()
functions, which are intended for use in Objective-C. (#369)
Documentation is available online or within Xcode.
v0.27.3
v0.27.2
- Fixed an issue where
Waypoint.separatesLegs
caused the resultingRouteLeg.source
andRouteLeg.destination
to have mismatched coordinates and names. (#358) - Fixed an issue where a Directions API or Map Matching API request would fail if a
Waypoint
hasWaypoint.name
set andWaypoint.separatesLegs
set tofalse
. (#358)
Documentation is available online or within Xcode.
v0.27.1
Offline routing
- Fixed an issue where
Directions.downloadTiles(in:version:session:completionHandler:)
always failed with an error after passing in aCoordinateBounds
created using theCoordinateBounds(northWest:southEast:)
initializer. (#349) - Added a
CoordinateBounds(southWest:northEast:)
initializer. (#349) - The versions passed into the completion handler of
Directions.fetchAvailableOfflineVersions(completionHandler:)
are now sorted in reverse chronological order. (#350)
Other changes
- Fixed issues where
VisualInstruction
,VisualInstructionBanner
,VisualInstructionComponent
,LaneIndicationComponent
, andRouteOptionsV4
objects failed to roundtrip throughNSCoder
. (#351)
Documentation is available online or within Xcode.