SafetyLocation

public struct SafetyLocation
extension SafetyLocation: Equatable
extension SafetyLocation: Hashable

Define a common safety location.

  • Creates a new SafetyLocation instance.

    Declaration

    Swift

    public init(
        id: SafetyLocationID,
        type: SafetyLocationType,
        speedLimit: Measurement<UnitSpeed>?,
        startLocation: CLLocationCoordinate2D,
        endLocation: CLLocationCoordinate2D
    )

    Parameters

    id

    Safety location identifier SafetyLocationID of this safety location.

    type

    Safety location type SafetyLocationType of this safety location.

    speedLimit

    Speed limit applicable to this safety location type, otherwise nil.

    startLocation

    Start location of this safety location.

    endLocation

    End location of this safety location. If startLocation and endLocation are equal, the safety location is a spot.

  • Creates a new SafetyLocation instance.

    Declaration

    Swift

    public init(
        id: SafetyLocationID,
        type: SafetyLocationType,
        speedLimit: Measurement<UnitSpeed>?,
        location: CLLocationCoordinate2D
    )

    Parameters

    id

    Safety location identifier SafetyLocationID of this safety location.

    type

    Safety location type SafetyLocationType of this safety location.

    speedLimit

    Speed limit applicable to this safety location type, otherwise nil.

    location

    Position of a spot safety location.

  • Describes the type of a safety location.

    See more

    Declaration

    Swift

    public enum SafetyLocationType : CaseIterable
  • id

    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 SafetyLocations 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 SafetyLocations 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.