Skip to content

Commit d9e787e

Browse files
author
Bobby Sudekum
committed
Doc update, change names and types
1 parent 163c78e commit d9e787e

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

MapboxGeocoder/MBGeocodeOptions.swift

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,9 @@ open class GeocodeOptions: NSObject {
6666

6767

6868
/**
69-
If true, the response will possibly include a `routableLocation`.
70-
71-
`routableLocation` represents the best location for a vehicle to navigate to.
69+
A Boolean value that determines whether the resulting placemarks have the `Placemark.routableLocation` property set.
7270
*/
73-
@objc open var includeRoutableLocations: Bool = false
71+
@objc open var includesRoutableLocations: Bool = false
7472

7573
fileprivate override init() {
7674
self.maximumResultCount = 0
@@ -110,7 +108,7 @@ open class GeocodeOptions: NSObject {
110108
params.append(URLQueryItem(name: "language", value: languageCode))
111109
}
112110

113-
params.append(URLQueryItem(name: "routing", value: String(describing: includeRoutableLocations)))
111+
params.append(URLQueryItem(name: "routing", value: String(describing: includesRoutableLocations)))
114112

115113
return params
116114
}

MapboxGeocoder/MBPlacemark.swift

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ open class Placemark: NSObject, Codable {
117117

118118
if let points = try? container.nestedContainer(keyedBy: RoutableLocationsKeys.self, forKey: .routableLocations),
119119
let coordinatePairs = try points.decodeIfPresent([[CLLocationDegrees]].self, forKey: .points) {
120-
let coordinates = coordinatePairs.map { CLLocationCoordinate2D(geoJSON: $0) }
121-
routableLocations = coordinates
120+
let locations = coordinatePairs.map { CLLocation(coordinate: CLLocationCoordinate2D(geoJSON: $0)) }
121+
routableLocations = locations
122122
}
123123
}
124124

@@ -366,9 +366,13 @@ open class Placemark: NSObject, Codable {
366366
}
367367

368368
/**
369-
An array of locations representing the location a user should navigate to to reach the `Placemark`.
369+
An array of locations that serve as hints for navigating to the placemark.
370+
371+
If the `GeocodeOptions.includesRoutableLocations` property is set to `true`, this property contains locations that are suitable to use as a waypoint in a routing engine such as MapboxDirections.swift. Otherwise, if the `GeocodeOptions.includesRoutableLocations` property is set to `false`, this property is set to `nil`.
372+
373+
For the placemark’s geographic center, use the `location` property. The routable locations may differ from the geographic center. For example, if a house’s driveway leads to a street other than the nearest street (by straight-line distance), then this property may contain the location where the driveway meets the street. A route to the placemark’s geographic center may be impassable, but a route to the routable location would end on the correct street with access to the house.
370374
*/
371-
@objc open var routableLocations: [CLLocationCoordinate2D]?
375+
@objc open var routableLocations: [CLLocation]?
372376
}
373377

374378
internal struct GeocodeResult: Codable {

0 commit comments

Comments
 (0)