RoadObjectMatcher

class RoadObjectMatcher

MapboxNavigation.roadObjectMatcher provides methods to match custom road objects.

Functions

Link copied to clipboard
fun cancel(roadObjectIds: List<String>)

Cancel road objects matching

Link copied to clipboard
fun cancelAll()

Cancel all road objects matching

Link copied to clipboard
fun matchGantryObject(roadObjectId: String, gantry: List<Point>)

Matches given gantry (i.e. polyline orthogonal to the road) to the graph. "Matching" here means we try to find all intersections of gantry with road graph and track distances to those intersections as distance to gantry. In case of error (if there are no tiles in cache, decoding failed, etc.) object won't be matched.

Link copied to clipboard
fun matchGantryObjects(matchableGeometries: List<MatchableGeometry>, useOnlyPreloadedTiles: Boolean = false)

Matches given gantries (i.e. polyline orthogonal to the road) to the graph. "Matching" here means we try to find all intersections of gantry with road graph and track distances to those intersections as distance to gantry. In case of error (if there are no tiles in cache, decoding failed, etc.) object won't be matched.

Link copied to clipboard
fun matchOpenLRObject(    roadObjectId: String,     openLRLocation: String,     openLRStandard: String)

Matches given OpenLR object to the graph.

Link copied to clipboard
fun matchOpenLRObjects(matchableOpenLrs: List<MatchableOpenLr>, useOnlyPreloadedTiles: Boolean = false)

Matches given OpenLR objects to the graph.

Link copied to clipboard
fun matchPointObject(roadObjectId: String, point: Point)

Matches given point to road graph. In case of error (if there are no tiles in cache, decoding failed, etc.) object won't be matched.

Link copied to clipboard
fun matchPointObjects(matchablePoints: List<MatchablePoint>, useOnlyPreloadedTiles: Boolean = false)

Matches given points to road graph. In case of error (if there are no tiles in cache, decoding failed, etc.) object won't be matched.

Link copied to clipboard
fun matchPolygonObject(roadObjectId: String, polygon: List<Point>)

Matches given polygon to graph. "Matching" here means we try to find all intersections of polygon with the road graph and track distances to those intersections as distance to polygon. In case of error (if there are no tiles in cache, decoding failed, etc.) object won't be matched.

Link copied to clipboard
fun matchPolygonObjects(matchableGeometries: List<MatchableGeometry>, useOnlyPreloadedTiles: Boolean = false)

Matches given polygons to graph. "Matching" here means we try to find all intersections of polygon with the road graph and track distances to those intersections as distance to polygon. In case of error (if there are no tiles in cache, decoding failed, etc.) object won't be matched.

Link copied to clipboard
fun matchPolylineObject(roadObjectId: String, polyline: List<Point>)

Matches given polyline to graph. Polyline should define valid path on graph, i.e. it should be possible to drive this path according to traffic rules. In case of error (if there are no tiles in cache, decoding failed, etc.) object won't be matched.

Link copied to clipboard
fun matchPolylineObjects(matchableGeometries: List<MatchableGeometry>, useOnlyPreloadedTiles: Boolean = false)

Matches given polylines to graph. Polyline should define valid path on graph, i.e. it should be possible to drive this path according to traffic rules. In case of error (if there are no tiles in cache, decoding failed, etc.) object won't be matched.

Link copied to clipboard
fun registerRoadObjectMatcherObserver(roadObjectMatcherObserver: RoadObjectMatcherObserver)

Register road object matcher observer. It needs to be registered before any of the other methods are called. Otherwise, the results are lost.