RoadObject

public struct RoadObject

Describes the object on the road. There are two sources of road objects: active route and the electronic horizon.

  • Identifier of the road object. If we get the same objects (e.g. RoadObject.ObjectType.tunnel) from the electronic horizon and the active route, they will not have the same IDs.

    Declaration

    Swift

    public let identifier: RoadObject.Identifier
  • Length of the object, nil if the object is point-like.

    Declaration

    Swift

    public let length: CLLocationDistance?
  • Location of the road object.

    Declaration

    Swift

    public let location: RoadObject.Location
  • Kind of the road object with metadata.

    Declaration

    Swift

    public let kind: RoadObject.Kind
  • true if an object is added by user, false if it comes from Mapbox service.

    Declaration

    Swift

    public let isUserDefined: Bool
  • Initializes a new RoadObject object.

    Declaration

    Swift

    public init(identifier: RoadObject.Identifier,
                length: CLLocationDistance?,
                location: RoadObject.Location,
                kind: RoadObject.Kind)
  • Represents location of road object on road graph.

    A point object is represented by a single edge whose location has the same fractionFromStart and fractionToEnd.

    Note

    The Mapbox Electronic Horizon feature of the Mapbox Navigation SDK is in public beta and is subject to changes, including its pricing. Use of the feature is subject to the beta product restrictions in the Mapbox Terms of Service. Mapbox reserves the right to eliminate any free tier or free evaluation offers at any time and require customers to place an order to purchase the Mapbox Electronic Horizon feature, regardless of the level of use of the feature.
    See more

    Declaration

    Swift

    public struct EdgeLocation
  • Type of the road object.

    See more

    Declaration

    Swift

    public enum Kind
  • The location of a road object in the road graph.

    See more

    Declaration

    Swift

    public enum Location
  • Contains information about position of the point on the graph and it’s geo-position.

    See more

    Declaration

    Swift

    public struct Position
  • Identifies a road object in an electronic horizon. A road object represents a notable transition point along a road, such as a toll booth or tunnel entrance. A road object is similar to a RouteAlert but is more closely associated with the routing graph managed by the RoadGraph class.

    Use a RoadObjectStore object to get more information about a road object with a given identifier or get the locations of road objects along RoadGraph.Edges.

    Declaration

    Swift

    public typealias Identifier = String