IndoorWaypoint

public class IndoorWaypoint
extension IndoorWaypoint: NativeBase
extension IndoorWaypoint: Hashable

Represents an indoor waypoint, used as input for indoor route calculation.

IndoorWaypoint can be used to specify the origin, destination, and via waypoints in a route request. Each waypoint type has different constraints on the supported properties:

Origin Waypoint:

  • Does NOT support stop_duration
  • Does NOT support pass_through
  • Use the basic constructor make(coordinates, venue_id, level_id)

Destination Waypoint:

  • Supports stop_duration (e.g., for specifying arrival/waiting time)
  • Does NOT support pass_through
  • Use make(coordinates, venue_id, level_id) or make(coordinates, venue_id, level_id, stop_duration) constructors

Via Waypoint:

  • Supports both stop_duration and pass_through
  • Use make(coordinates, venue_id, level_id), make(coordinates, venue_id, level_id, stop_duration), or make(coordinates, venue_id, level_id, pass_through) constructors
  • When pass_through is true, the route continues without stopping
  • When pass_through is false or nil, the route stops at the waypoint
  • When stop_duration is specified, the route stops for the given duration

Validation: When a route request is made, the waypoints are validated according to the rules above. If validation fails (e.g., origin has stop_duration or pass_through, or destination has pass_through), the route request returns an error with IndoorRoutingError.badRequest.

  • Creates an indoor waypoint. This is the basic constructor that maintains backward compatibility. Sets IndoorWaypoint.stopDuration to nil and IndoorWaypoint.isPassThrough to nil (equivalent to false).

    Declaration

    Swift

    public init(coordinates: GeoCoordinates, venueId: String, levelId: String)

    Parameters

    coordinates

    A waypoint’s geographic coordinates.

    venueId

    An ID of the venue where the waypoint is located.

    levelId

    An ID of the level where the waypoint is located

  • Creates an indoor waypoint with stop duration.

    Declaration

    Swift

    public init(coordinates: GeoCoordinates, venueId: String, levelId: String, stopDuration: Int32)

    Parameters

    coordinates

    A waypoint’s geographic coordinates.

    venueId

    An ID of the venue where the waypoint is located.

    levelId

    An ID of the level where the waypoint is located.

    stopDuration

    The duration in seconds to stop at this waypoint (1-49999).

  • Creates a passthrough indoor waypoint (for via waypoints). The route will continue through this waypoint without stopping when pass_through is true. When pass_through is false, it behaves the same as the basic constructor.

    Declaration

    Swift

    public init(coordinates: GeoCoordinates, venueId: String, levelId: String, passThrough: Bool)

    Parameters

    coordinates

    A waypoint’s geographic coordinates.

    venueId

    An ID of the venue where the waypoint is located.

    levelId

    An ID of the level where the waypoint is located.

    passThrough

    If true, the route passes through without stopping. If false, the route stops at this waypoint.

  • Creates an outdoor waypoint.

    Declaration

    Swift

    public init(coordinates: GeoCoordinates)

    Parameters

    coordinates

    A waypoint’s geographic coordinates.

  • The waypoint’s geographic coordinates.

    Declaration

    Swift

    public var coordinates: GeoCoordinates { get }
  • The ID of the venue where the waypoint is located, if applicable.

    Declaration

    Swift

    public var venueId: String? { get }
  • The ID of the level where the waypoint is located, if applicable.

    Declaration

    Swift

    public var levelId: String? { get }
  • The duration in seconds to stop at this waypoint (0-49999 seconds). This is typically used for destination waypoints or via waypoints to specify a waiting time. Returns nil if no stop duration is specified.

    Declaration

    Swift

    public var stopDuration: Int32? { get }
  • If true, the route passes through this waypoint without stopping (for via waypoints). If false or nil, the route stops at this waypoint. Returns nil if not explicitly set (equivalent to false).

    Declaration

    Swift

    public var isPassThrough: Bool? { get }