POI

public struct POI : Equatable

Represents a Point of Interest (POI) with associated metadata.

A POI encapsulates the data required to plot a point on a map, including its coordinates and additional information such as its category and potential detour metrics.

Important

This is a Public Preview API. It may be changed or removed at any time.
  • Initializes a new Point of Interest (POI) with the provided data.

    Declaration

    Swift

    public init(
        name: String,
        coordinates: CLLocationCoordinate2D,
        categoryID: Int,
        categoryName: String,
        detourTime: Measurement<UnitDuration>? = nil,
        detourDistance: Measurement<UnitLength>? = nil,
        detourOffset: Measurement<UnitLength>? = nil
    )

    Parameters

    name

    The name or title of the Point of Interest. For instance, “Eiffel Tower” or “Central Park”.

    coordinates

    The geographical coordinates that determine the exact location of thePOI` on a map.

    categoryID

    An identifier that represents the category of the POI. This could be used to differentiate between types of POIs, such as restaurants, parks, etc.

    categoryName

    The name associated with the category of the POI.

    detourTime

    An optional measurement that represents the time required to detour to this POI from a specific route. If not provided, it defaults to nil.

    detourDistance

    An optional measurement that represents the distance required to detour to this POI from a specific route. If not provided, it defaults to nil.

    detourOffset

    An optional measurement representing the distance from the starting point of a route to where a detour to the POI begins. If not provided, it defaults to nil.

  • The descriptive name or title associated with the POI.

    Declaration

    Swift

    public let name: String
  • The geographical coordinates that determine the exact location of the POI on a map.

    Declaration

    Swift

    @EquatableWrapper
    private(set) public var coordinates: CLLocationCoordinate2D { get set }
  • The name associated with the category of the POI.

    Declaration

    Swift

    public let categoryName: String
  • An identifier that represents the category of the POI.

    Declaration

    Swift

    public let categoryID: Int
  • The time required to detour to this POI from a specific route.

    Declaration

    Swift

    public let detourTime: Measurement<UnitDuration>?
  • The distance required to detour to this POI from a specific route.

    Declaration

    Swift

    public let detourDistance: Measurement<UnitLength>?
  • The length of the route part from the starting point to the detour starting point.

    Declaration

    Swift

    public let detourOffset: Measurement<UnitLength>?