Navigatable

public protocol Navigatable

All classes that implement the Navigatable protocol can be navigated to and from any other Navigatable object.

For example, you can navigate from a Coordinate to a Location and you will get a path from that Coordinate to the closest entrance node belonging to that Location. Beyond just pathing to a store, this might also be used for a “take me to the closest washroom” function. You can also navigate from an array of Navigatables to an Array of other Navigatables, and you will get the shortest path between an item in the first group to the second. This allows the ability to do advanced, high level things like “find a place to park that takes you closest to any restaurant”.

  • an array of Coordinate that tells the navigation algorithm where to start or end at.

    Declaration

    Swift

    var navigatableCoordinates: [Coordinate] { get }
  • isNavigatable Extension method

    check if a node can be navigated to or from.

    Declaration

    Swift

    var isNavigatable: Bool { get }
  • directions(to:accessible:) Extension method

    Find the best path between the current point and the supplied destination.

    If there is no path, nil will be returned otherwise a Directions object will be returned with the path

    Accessible only directions can be specified as well

    Declaration

    Swift

    func directions<VenueNavigatable: Navigatable>(
        to destination: VenueNavigatable,
        accessible: Bool = false) -> Directions?
  • directions(from:accessible:) Extension method

    Find the best accessible path from the supplied origin to this location.

    If there is no path, nil will be returned otherwise a Directions object will be returned with the path

    Accessible only directions can be specified as well

    Declaration

    Swift

    func directions<VenueNavigatable: Navigatable>(
        from origin: VenueNavigatable,
        accessible: Bool = false) -> Directions?