mapbox-directions-swift

Traffic-aware directions and map matching in Swift on iOS, macOS, tvOS, watchOS, and Linux

ISC License

Stars
176
Committers
44

Bot releases are hidden (Show)

mapbox-directions-swift - v1.0.0

Published by 1ec5 about 4 years ago

Changes since v0.33.2:

  • Added the Directions.refreshRoute(responseIdentifier:routeIndex:fromLegAtIndex:completionHandler:) method for refreshing attributes along the legs of a route and the Route.refreshLegAttributes(from:) method for merging the refreshed attributes into an existing route. To enable route refreshing for the routes in a particular route response, set RouteOptions.refreshingEnabled to true before passing the RouteOptions object into Directions.calculate(_:completionHandler:). (#420)
  • Fixed a crash that could occur if the Mapbox Directions API includes unrecognized RoadClasses values in its response. (#450)
  • Fixed malformed RouteStep.shape values that could occur when RouteStep.maneuverType is ManeuverType.arrive, DirectionsOptions.shapeFormat is RouteShapeFormat.polyline6, and the Mapbox Directions API returns certain encoded Polyline strings. (#456)
  • Restored the DirectionsOptions.urlQueryItems property so that subclasses of RouteOptions and MatchOptions can add any additional URL query parameters that are supported by the Mapbox Directions and Map Matching APIs. (#461)

Documentation is available online or within Xcode.

mapbox-directions-swift - v1.0.0-rc.2

Published by 1ec5 about 4 years ago

Changes since v1.0.0-rc.1:

  • Fixed malformed RouteStep.shape values that could occur when RouteStep.maneuverType is ManeuverType.arrive, DirectionsOptions.shapeFormat is RouteShapeFormat.polyline6, and the Mapbox Directions API returns certain encoded Polyline strings. (#456)

Documentation is available online or within Xcode.

mapbox-directions-swift - v1.0.0-rc.1

Published by 1ec5 about 4 years ago

Changes since v0.33.2:

  • Added the Directions.refreshRoute(responseIdentifier:routeIndex:fromLegAtIndex:completionHandler:) method for refreshing attributes along the legs of a route and the Route.refreshLegAttributes(from:) method for merging the refreshed attributes into an existing route. To enable route refreshing for the routes in a particular route response, set RouteOptions.refreshingEnabled to true before passing the RouteOptions object into Directions.calculate(_:completionHandler:). (#420)
  • Fixed a crash that could occur if the Mapbox Directions API includes unrecognized RoadClasses values in its response. (#450)

Documentation is available online or within Xcode.

mapbox-directions-swift - v0.33.2

Published by MaximAlien about 4 years ago

Changes since v0.33.1:

  • Fixed an issue where waypoints in a RouteResponse did not persist the Waypoint.targetCoordinate, Waypoint.heading, Waypoint.headingAccuracy, and Waypoint.allowsArrivingOnOppositeSide properties from the initial RouteOptions object. (#446)

Documentation is available online or within Xcode.

mapbox-directions-swift - v0.33.1

Published by 1ec5 about 4 years ago

Changes since v0.33.0:

  • Fixed an issue where RouteResponse(matching:options:credentials:) and Directions.calculateRoutes(matching:completionHandler:) resulted in misshappen Route.shapes and RouteStep.shapes in the Atlantic Ocean if MatchOptions.shapeFormat was set to RouteShapeFormat.polyline6. (#437)

Documentation is available online or within Xcode.

mapbox-directions-swift -

Published by 1ec5 about 4 years ago

Changes since v0.31.0:

  • Fixed an issue where RouteResponse(matching:options:credentials:) and Directions.calculateRoutes(matching:completionHandler:) resulted in misshappen Route.shapes and RouteStep.shapes in the Atlantic Ocean if MatchOptions.shapeFormat was set to RouteShapeFormat.polyline6. (#437)

Documentation is available online or within Xcode.

mapbox-directions-swift - v0.33.0

Published by fabian-guerra over 4 years ago

Changes since v0.32.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:) and Route(from:) initializers. (#430)
  • Fixed an issue where VisualInstruction.Component.guidanceView lacked an image URL. (#432)

Documentation is available online or within Xcode.

mapbox-directions-swift - v0.32.0

Published by fabian-guerra over 4 years ago

Changes since v0.31.0:

  • Removed the CoordinateBounds struct in favor of BoundingBox from Turf. (#427)
  • Added the VisualInstructionBanner.quaternaryInstruction property and VisualInstruction.Component.guidanceView(image:alternativeText:) enumeration case to represent a detailed image of an upcoming junction. (#425)

Documentation is available online or within Xcode.

mapbox-directions-swift - v0.31.0

Published by 1ec5 over 4 years ago

Changes since v0.30.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 and MatchCompletionHandler closures’ error argument is now a DirectionsError instead of an NSError. (#382)
  • Classes such as Route, Match, and RouteStep conform to the Codable protocol, so you can create instances of them from JSON-formatted Data using JSONDecoder and round-trip them back to JSON using JSONEncoder. Malformed input now throws decoding errors instead of crashing by unwrapping nils. (#382)

Visual instructions

  • Removed the Lane class in favor of storing an array of LaneIndications directly in the Intersection.approachLanes property. (#382)
  • Removed the ComponentRepresentable protocol, VisualInstructionComponent class, and LaneIndicationComponent class in favor of a VisualInstruction.Component enumeration that contains a VisualInstruction.Component.TextRepresentation and/or VisualInstruction.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, and MBMaximumWalkingSpeed constants with CLLocationSpeed.normalWalking, CLLocationSpeed.minimumWalking, and CLLocationSpeed.maximumWalking, respectively.
  • Replaced the Route.coordinates property with Route.shape and the RouteStep.coordinates property with RouteStep.shape. The Route.coordinateCount and RouteStep.coordinateCount properties have been removed, but you can use the LineString.coordinates property to get the array of CLLocationCoordinate2Ds. (#382)
  • RouteLeg.source and RouteLeg.destination are now optional. They can be nil when the RouteLeg object is decoded individually from JSON. (#382)
  • Removed TransportType.none, ManeuverType.none, and ManeuverDirection.none. Unrecognized TransportType and ManeuverDirection values now raise decoding errors. (#382)
  • RouteStep.maneuverType is now optional. (#382)
  • Renamed the Tracepoint.alternateCount property to Tracepoint.countOfAlternatives. (#382)
  • The Intersection.approachIndex and Intersection.outletIndex properties are now optional, not −1, in the case of a departure or arrival maneuver. (#393)
  • Added initializers for Route, Match, RouteLeg, and RouteStep. (#393)
  • Various properties of Route, RouteLeg, and RouteStep are now writable. (#393)
  • Added AttributeOptions.maximumSpeedLimit for getting maximum posted speed limits in the RouteLeg.segmentMaximumSpeedLimits property. (#367)
  • Added the RouteLeg.segmentRangesByStep property for more easily associating RouteSteps with the values in segment-based arrays such as RouteLeg.segmentCongestionLevels. (#367)
  • The RouteOptions.alleyPriority property now works with DirectionsProfileIdentifier.automobile, allowing you to request routes that prefer or avoid alleys while driving. (#416)

Documentation is available online or within Xcode.

mapbox-directions-swift - v1.0.0-alpha.1

Published by 1ec5 almost 5 years ago

Changes since v0.30.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 and MatchCompletionHandler closures’ error argument is now a DirectionsError instead of an NSError. (#382)
  • Classes such as Route, Match, and RouteStep conform to the Codable protocol, so you can create instances of them from JSON-formatted Data using JSONDecoder and round-trip them back to JSON using JSONEncoder. Malformed input now throws decoding errors instead of crashing by unwrapping nils. (#382)

Visual instructions

  • Removed the Lane class in favor of storing an array of LaneIndications directly in the Intersection.approachLanes property. (#382)
  • Removed the ComponentRepresentable protocol, VisualInstructionComponent class, and LaneIndicationComponent class in favor of a VisualInstruction.Component enumeration that contains a VisualInstruction.Component.TextRepresentation and/or VisualInstruction.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, and MBMaximumWalkingSpeed constants with CLLocationSpeed.normalWalking, CLLocationSpeed.minimumWalking, and CLLocationSpeed.maximumWalking, respectively.
  • Replaced the Route.coordinates property with Route.shape and the RouteStep.coordinates property with RouteStep.shape. The Route.coordinateCount and RouteStep.coordinateCount properties have been removed, but you can use the LineString.coordinates property to get the array of CLLocationCoordinate2Ds. (#382)
  • RouteLeg.source and RouteLeg.destination are now optional. They can be nil when the RouteLeg object is decoded individually from JSON. (#382)
  • Removed TransportType.none, ManeuverType.none, and ManeuverDirection.none. Unrecognized TransportType and ManeuverDirection values now raise decoding errors. (#382)
  • RouteStep.maneuverType is now optional. (#382)
  • Renamed the Tracepoint.alternateCount property to Tracepoint.countOfAlternatives. (#382)
  • The Intersection.approachIndex and Intersection.outletIndex properties are now optional, not −1, in the case of a departure or arrival maneuver. (#393)
  • Added initializers for Route, Match, RouteLeg, and RouteStep. (#393)
  • Various properties of Route, RouteLeg, and RouteStep are now writable. (#393)
  • Added AttributeOptions.maximumSpeedLimit for getting maximum posted speed limits in the RouteLeg.segmentMaximumSpeedLimits property. (#367)
  • Added the RouteLeg.segmentRangesByStep property for more easily associating RouteSteps with the values in segment-based arrays such as RouteLeg.segmentCongestionLevels. (#367)

Documentation is available online or within Xcode.

mapbox-directions-swift - v0.30.0

Published by 1ec5 about 5 years ago

Changes since v0.29.0:

  • Directions.fetchAvailableOfflineVersions(completionHandler:) and Directions.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.

mapbox-directions-swift - v0.29.0

Published by 1ec5 over 5 years ago

Changes since v0.28.0:

  • Added support for Swift Package Manager. (#362)
mapbox-directions-swift - v0.28.0

Published by 1ec5 over 5 years ago

Changes since v0.27.3:

  • Added the RouteOptions.alleyPriority, RouteOptions.walkwayPriority, and RouteOptions.speed properties for fine-tuning walking directions. (#370)
  • Added the MBStringFromManeuverType(), MBStringFromManeuverDirection(), MBStringFromDrivingSide(), and MBStringFromTransportType() functions, which are intended for use in Objective-C. (#369)

Documentation is available online or within Xcode.

mapbox-directions-swift - v0.27.3

Published by JThramer over 5 years ago

Changes since v0.27.2:

  • Fixed compatibility issues with Xcode 10.2 when the SDK is installed using Carthage. (#363)

Documentation is available online or within Xcode.

mapbox-directions-swift - v0.27.2

Published by 1ec5 over 5 years ago

Changes since v0.27.1:

  • Fixed an issue where Waypoint.separatesLegs caused the resulting RouteLeg.source and RouteLeg.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 has Waypoint.name set and Waypoint.separatesLegs set to false. (#358)

Documentation is available online or within Xcode.

mapbox-directions-swift - v0.27.1

Published by 1ec5 over 5 years ago

Changes since v0.27.0:

Offline routing

  • Fixed an issue where Directions.downloadTiles(in:version:session:completionHandler:) always failed with an error after passing in a CoordinateBounds created using the CoordinateBounds(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, and RouteOptionsV4 objects failed to roundtrip through NSCoder. (#351)

Documentation is available online or within Xcode.

mapbox-directions-swift - v0.27.0

Published by 1ec5 over 5 years ago

Changes since v0.26.1:

  • If a RouteOptions object has exceptionally many waypoints or if many of the waypoint have very long names, Directions.calculate(_:completionHandler:) sends a POST request to the Mapbox Directions API instead of sending a GET request that returns an error. (#341)
  • When possible, Directions.calculateRoutes(matching:completionHandler:) now sends a GET request to the Mapbox Map Matching API instead of a POST request. (#341)
  • Fixed an issue where certain waypoint names would cause Directions.calculateRoutes(matching:completionHandler:) to return an error. (#341)
  • Added the Directions.url(forCalculating:httpMethod:) and Directions.urlRequest(forCalculating:) methods for implementing custom GET- and POST-compatible request code. (#341)
  • Added the Waypoint.separatesLegs property, which you can set to false to create a route that travels “via” the waypoint but doesn’t stop there. Deprecated the MatchOptions.waypointIndices property in favor of Waypoint.separatesLegs, which also works with RouteOptions. (#340)
  • Fixed unset properties in Waypoint objects that are included in a calculated Routes or Matches. (#340)
  • Added DirectionsResult.fetchStartDate and DirectionsResult.requestEndDate properties. (#335)
  • Added a DirectionsOptions.urlQueryItems property so that subclasses of RouteOptions and MatchOptions can add any additional URL query parameters that are supported by the Mapbox Directions and Map Matching APIs. (#343)

Documentation is available online or within Xcode.

mapbox-directions-swift - v0.26.1

Published by 1ec5 over 5 years ago

Changes since v0.26.0:

  • Waypoints and Tracepoints can now be compared for object equality. (#331)
  • Fixed an issue where the DirectionsResult.accessToken and DirectionsResult.apiEndpoint properties failed to roundtrip through NSCoder. (#331)
  • Route now supports secure coding via the NSSecureCoding protocol. (#331)
  • Fixed an issue where Intersection failed to decode when an outlet road has no road classes (i.e., a normal road that isn’t a bridge, tunnel, toll road, or motorway). (#331)

Documentation is available online or within Xcode.

mapbox-directions-swift - v0.26.0

Published by 1ec5 almost 6 years ago

Changes since v0.25.2:

  • Renamed CoordinateBounds(_:) to CoordinateBounds(coordinates:). (#325)
  • Added a Waypoint.targetCoordinate property for specifying a more specific destination for arrival instructions. (#326)
  • Fixed an issue where the Waypoint.allowsArrivingOnOppositeSide property was not copied when copying a Waypoint object. (#326)

Documentation is available online or within Xcode.

mapbox-directions-swift - v0.25.2

Published by 1ec5 almost 6 years ago

Changes since v0.25.1:

  • Fixed an issue where VisualInstructionComponent(json:) would set VisualInstructionComponent.imageURL to an invalid URL when the JSON representation includes an empty image URL. (#322)

Documentation is available online or within Xcode.

Package Rankings
Top 3.07% on Cocoapods.org
Top 9.12% on Swiftpackageindex.com
Top 23.17% on Carthage
Badges
Extracted from project README
CircleCI Carthage compatible CocoaPods SPM compatible codecov