SafetyLocation
public struct SafetyLocation
extension SafetyLocation: Equatable
extension SafetyLocation: Hashable
Define a common safety location.
Important
This is a Public Preview API. It may be changed or removed at any time.-
Initializes the safety location.
Declaration
Swift
public init( id: SafetyLocationID, type: SafetyLocationType, speedLimit: Measurement<UnitSpeed>?, startLocation: CLLocationCoordinate2D, endLocation: CLLocationCoordinate2D? = nil )
Parameters
id
Safety location identifier
SafetyLocationID
of this safety location.type
Safety location type
SafetyLocationType
of this safety location.speedLimit
Speed limit is applicable for the type of this safety location type, otherwise null.
startLocation
Start position of this safety location.
endLocation
End position of this safety location. By default endLocation is equal to the startLocation. If startLocation and endLocation are equal, the safety location is a spot.
-
Describes the type of a safety location.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public enum SafetyLocationType : CaseIterable
-
Identifier of a safety location.
Declaration
Swift
public let id: SafetyLocationID
-
Type of safety location
Declaration
Swift
public let type: SafetyLocationType
-
Defines the speed limit for the safety cameras of relevant type.
Declaration
Swift
public let speedLimit: Measurement<UnitSpeed>?
-
Start position of the safety location.
Declaration
Swift
public let startLocation: CLLocationCoordinate2D
-
End position of the safety location. By default endLocation is equal to the startLocation. If startLocation and endLocation are equal, the safety location is a spot.
Declaration
Swift
public let endLocation: CLLocationCoordinate2D
-
Returns a Boolean value indicating whether two
SafetyLocation
are equal.Declaration
Swift
public static func == ( lhs: SafetyLocation, rhs: SafetyLocation ) -> Bool
Parameters
lhs
A
SafetyLocation
to compare.rhs
Another
SafetyLocation
to compare.Return Value
Returns a Boolean value indicating whether two
SafetyLocation
s are equal.
-
Allowing instances of he containing type to be used in hash-based collections like sets and dictionaries.
Declaration
Swift
public func hash(into hasher: inout Hasher)
Parameters
hasher
The hasher used to combine the hash values of the essential properties.