HazardLocation

public enum HazardLocation
extension HazardLocation: Equatable, Hashable

The location information for the hazard.

Important

This is a Public Preview API. It may be changed or removed at any time.
  • Represents a single spot location and its direction.

    Declaration

    Swift

    case spot(coordinate: CLLocationCoordinate2D, course: CLLocationDirection?)
  • Represents a linear location, i.e. a polyline.

    Note

    It is guaranteed to include start and end points, but not intermediate points.

    Declaration

    Swift

    case linear(coordinates: [CLLocationCoordinate2D])
  • Represents an area location, i.e. a polygon.

    Declaration

    Swift

    case area(coordinates: [CLLocationCoordinate2D])
  • Implements method to check two Location objects for equality

    Two Location objects are equal if they have same enum values and associated coordinates have exactly the same latitude and longitude. Double values compared directly without threshold of any kind.

    Declaration

    Swift

    public static func == (lhs: HazardLocation, rhs: HazardLocation) -> Bool

    Parameters

    lhs

    A value to compare.

    rhs

    Another value to compare.

    Return Value

    True if both coordinates are equal.

  • Hashes the essential components of this value by feeding them into the given hasher.

    Each enum case of Location has associated values, that being fed into hasher. But it is not enough to distinguish between different cases that might have identical associated values. To solve this issue, unique identifiers for each case are also being fed to the hasher.

    Declaration

    Swift

    public func hash(into hasher: inout Hasher)

    Parameters

    hasher

    The hasher to use when combining the components of this instance.