PointOfInterestManaging

public protocol PointOfInterestManaging : AnyObject
  • Declaration

    Swift

    var delegate: PointOfInterestManagerDelegate? { get set }
  • Indicates whether user interaction for selection is enabled.

    When set to true, the user can interact with the POIs to select them. When set to false, selection is disabled and user interaction will not result in any selection changes.

    The default value is true.

    Declaration

    Swift

    var isUserSelectionEnabled: Bool { get set }
  • Determines how POIs can be selected. See PointOfInterestManager.SelectionMode for possible values.

    When changing from .multiple to .single, all previously selected POIs, except one, will be unselected.

    Default value is .single.

    Declaration

    Swift

    var selectionMode: PointOfInterestManager.SelectionMode { get set }
  • Retrieves a set of all available Points of Interest (POIs).

    Declaration

    Swift

    func getPOIs() -> Set<PointOfInterest>

    Return Value

    A Set of PointOfInterest representing all known POIs. Returns an empty set if no POIs are available.

Show/hide POIs

  • Shows all Points of Interest (POIs).

    Declaration

    Swift

    func showAllPOIs() -> Bool

    Return Value

    true if the POIs were successfully shown, false otherwise.

  • Hides all Points of Interest (POIs).

    Declaration

    Swift

    func hideAllPOIs() -> Bool

    Return Value

    true if the POIs were successfully hidden, false otherwise.

  • Shows a specific Point of Interest (POI).

    Declaration

    Swift

    func showPOI(_ poi: PointOfInterest) -> Bool

    Parameters

    poi

    The PointOfInterest to show.

    Return Value

    true if the POI was successfully shown, false otherwise (e.g., if the POI was not found or could not be shown).

  • Hides a specific Point of Interest (POI).

    Declaration

    Swift

    func hidePOI(_ poi: PointOfInterest) -> Bool

    Parameters

    poi

    The PointOfInterest to hide.

    Return Value

    true if the POI was successfully hidden, false otherwise (e.g., if the POI was not found or could not be hidden).

  • Shows the POI with the specified ID.

    Declaration

    Swift

    func showPOI(id: Int) -> Bool

    Parameters

    id

    The unique identifier of the POI.

    Return Value

    true if the POI was shown, false otherwise (e.g., if the POI with the given ID was not found or could not be shown).

  • Hides the POI with the specified ID.

    Declaration

    Swift

    func hidePOI(id: Int) -> Bool

    Parameters

    id

    The unique identifier of the POI.

    Return Value

    true if the POI was hidden, false otherwise (e.g., if the POI with the given ID was not found or could not be hidden).

  • Shows a set of Points of Interest.

    Declaration

    Swift

    func showPOIs(_ pois: Set<PointOfInterest>) -> Bool

    Parameters

    pois

    The set of PointOfInterest to show.

    Return Value

    true if the POIs were shown successfully, false otherwise.

  • Hides a set of Points of Interest.

    Declaration

    Swift

    func hidePOIs(_ pois: Set<PointOfInterest>) -> Bool

    Parameters

    pois

    The set of PointOfInterest to hide.

    Return Value

    true if the POIs were hidden successfully, false otherwise.

Select/unselect POIs

  • Retrieves the set of currently selected POIs (for .multiple mode).

    This method should be used only when selectionMode is set to .multiple. If selectionMode is set to .single use getSelectedPOI.

    Declaration

    Swift

    func getSelectedPOIs() -> Set<PointOfInterest>

    Return Value

    A Set of currently selected PointOfInterest. May be empty.

  • Retrieves the currently selected POI (for .single mode).

    This method should be used only when selectionMode is set to .single. Otherwise, it will return the first selected POI. If selectionMode is set to .multiple use getSelectedPOIs.

    Declaration

    Swift

    func getSelectedPOI() -> PointOfInterest?

    Return Value

    The currently selected PointOfInterest, or nil if none is selected.

  • Unselects all selected POIs (for .multiple mode).

    This method should be used only when selectionMode is set to .multiple. If selectionMode is set to .single use unselectPOI.

    Declaration

    Swift

    func unselectAllPOIs() -> Bool

    Return Value

    true if the operation was successful, false otherwise.

  • Unselects a specific POI.

    Declaration

    Swift

    func unselectPOI(_ poi: PointOfInterest) -> Bool

    Parameters

    poi

    The POI to unselect.

    Return Value

    true if the POI was successfully unselected, false otherwise.

  • Unselects a POI by ID.

    Declaration

    Swift

    func unselectPOI(id: Int) -> Bool

    Parameters

    id

    The ID of the POI to unselect.

    Return Value

    true if the POI was unselected, false otherwise.

  • Unselects the currently selected POI (for .single mode).

    This method should be used only when selectionMode is set to .single. Otherwise, it will unselect the first selected POI. If selectionMode is set to .multiple use unselectAllPOIs or unselect a specific POI instead.

    Declaration

    Swift

    func unselectPOI() -> Bool

    Return Value

    true if a POI was selected and successfully unselected, false otherwise.

Filtering

  • Filters POIs based on the presence of a specific tag.

    This function checks if a given tag is present within a collection of tags associated with the PointOfInterest.

    Declaration

    Swift

    func filterByTag(_ tag: String) -> Bool

    Parameters

    tag

    The tag to filter by.

    Return Value

    true if any POI contains the tag, false otherwise.

  • Removes all active POI filters.

    Declaration

    Swift

    func removeFilters() -> Bool

    Return Value

    true if any filters were removed, false otherwise.

Sorting

  • Sorts POIs by graph distance from a given origin.

    This function utilizes a graph-based routing to calculate the distance from the origin to each POI. The POIs are then sorted in ascending order of distance.

    Declaration

    Swift

    func sortPOIsByGraphDistance(origin: Coordinate, pois: [PointOfInterest]) -> Single<[PointOfInterestWithInfo]>

    Parameters

    origin

    The origin Coordinate for distance calculation.

    pois

    An array of POIs to sort.

    Return Value

    A Single emitting an array of PointOfInterestWithInfo sorted by graph distance. The PointOfInterestWithInfo objects contain the original POI data and additional information including the calculated distance. If a POI’s distance cannot be determined, it will likely be placed at the end of the sorted array, or an error will be propagated through the Single.

  • Sorts POIs by estimated travel duration from a given origin.

    This function takes an origin coordinate and an array of POIs and returns a Single emitting an array of POIs sorted by the time it takes to travel from the origin to each POI. The returned array contains PointOfInterestWithInfo objects which encapsulate the original POI and associated travel information.

    Declaration

    Swift

    func sortPOIsByDuration(origin: Coordinate, pois: [PointOfInterest]) -> Single<[PointOfInterestWithInfo]>

    Parameters

    origin

    The origin Coordinate.

    pois

    An array of POIs to sort.

    Return Value

    A Single emitting an array of PointOfInterestWithInfo sorted by duration. The array will be sorted in ascending order of duration (shortest duration first). If the origin is the same as a POI, the duration will be 0. If a POI’s duration cannot be determined, it will likely be placed at the end of the sorted array, or an error will be propagated through the Single.

  • Sorts all POIs by graph distance from a given origin.

    This function utilizes a graph-based routing to calculate the distance from the origin to each POI. The POIs are then sorted in ascending order of distance.

    Declaration

    Swift

    func sortPOIsByGraphDistance(origin: Coordinate) -> Single<[PointOfInterestWithInfo]>

    Parameters

    origin

    The origin Coordinate for distance calculation.

    Return Value

    A Single emitting an array of PointOfInterestWithInfo sorted by graph distance. The PointOfInterestWithInfo objects contain the original POI data and additional information including the calculated distance. If a POI’s distance cannot be determined, it will likely be placed at the end of the sorted array, or an error will be propagated through the Single.

  • Sorts all POIs by estimated travel duration from a given origin.

    This function takes an origin coordinate and an array of all POIs and returns a Single emitting an array of POIs sorted by the time it takes to travel from the origin to each POI. The returned array contains PointOfInterestWithInfo objects which encapsulate the original POI and associated travel information.

    Declaration

    Swift

    func sortPOIsByDuration(origin: Coordinate) -> Single<[PointOfInterestWithInfo]>

    Parameters

    origin

    The origin Coordinate.

    Return Value

    A Single emitting an array of PointOfInterestWithInfo sorted by duration. The array will be sorted in ascending order of duration (shortest duration first). If the origin is the same as a POI, the duration will be 0. If a POI’s duration cannot be determined, it will likely be placed at the end of the sorted array, or an error will be propagated through the Single.