RoadObjectStore
public final class RoadObjectStore
extension RoadObjectStore: RoadObjectsStoreObserver
Stores and provides access to metadata about road objects.
You do not create a RoadObjectStore object manually. Instead, use the RouteController.roadObjectStore or PassiveLocationManager.roadObjectStore to access the currently active road object store.
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.-
The road object store’s delegate.
Declaration
Swift
public weak var delegate: RoadObjectStoreDelegate? { get set }
-
Returns mapping
road object identifier -> RoadObject.EdgeLocationfor all road objects which are lying on the edge with given identifier.Declaration
Swift
public func roadObjectEdgeLocations(edgeIdentifier: RoadGraph.Edge.Identifier) -> [RoadObject.Identifier : RoadObject.EdgeLocation]Parameters
edgeIdentifierThe identifier of the edge to query.
-
Returns road object with given identifier, if such object cannot be found returns null. NB: since road objects can be removed/added in background we should always check return value for null, even if we know that we have object with such identifier based on previous calls.
Declaration
Swift
public func roadObject(identifier roadObjectIdentifier: RoadObject.Identifier) -> RoadObject?Parameters
roadObjectIdentifierThe identifier of the road object to query.
-
Returns list of road object ids which are (partially) belong to
edgeIds.Declaration
Swift
public func roadObjectIdentifiers(edgeIdentifiers: [RoadGraph.Edge.Identifier]) -> [RoadObject.Identifier]
-
Adds a road object to be tracked in the electronic horizon. In case if an object with such identifier already exists, updates it. NB: a road object obtained from route alerts cannot be added via this API.
Declaration
Swift
public func addUserDefinedRoadObject(_ roadObject: RoadObject)Parameters
roadObjectCustom road object, acquired from
RoadObjectMatcher. -
Removes road object and stops tracking it in the electronic horizon.
Declaration
Swift
public func removeUserDefinedRoadObject(identifier: RoadObject.Identifier)Parameters
identifierIdentifier of the road object that should be removed.
-
Removes all user-defined road objects from the store and stops tracking them in the electronic horizon.
Declaration
Swift
public func removeAllUserDefinedRoadObjects() -
Declaration
Swift
public func onRoadObjectAdded(forId id: String) -
Declaration
Swift
public func onRoadObjectUpdated(forId id: String) -
Declaration
Swift
public func onRoadObjectRemoved(forId id: String)
Install in Dash
RoadObjectStore Class Reference