MapKit Mobile SDK

MMKPolylineIndex

class MMKPolylineIndex : NSObject

Provides methods for binding locations to a polyline

Summary

Instance methods

func closestPolylinePosition(with point: MMKPoint,
                               priority: MMKPolylineIndexPriority,
                        maxLocationBias: Double) -> MMKPolylinePosition?
Finds closest polyline position

func closestPolylinePosition(with point: MMKPoint,
                           positionFrom: MMKPolylinePosition,
                             positionTo: MMKPolylinePosition,
                        maxLocationBias: Double) -> MMKPolylinePosition?
Finds the closest polyline position between the two positions

Instance methods

closestPolylinePosition(with:priority:maxLocationBias:)

func closestPolylinePosition(with point: MMKPoint,
                               priority: MMKPolylineIndexPriority,
                        maxLocationBias: Double) -> MMKPolylinePosition?

Finds closest polyline position. Returns null if there is no position that satisfies the condition distance(point, position) < maxLocationBias.

Two modes are available: 1. Find the closest polyline position to a raw point MMKPolylineIndexPriorityClosestToRawPoint 2. Find the closest polyline position to the polyline start MMKPolylineIndexPriorityClosestToStart.


closestPolylinePosition(with:positionFrom:positionTo:maxLocationBias:)

func closestPolylinePosition(with point: MMKPoint,
                           positionFrom: MMKPolylinePosition,
                             positionTo: MMKPolylinePosition,
                        maxLocationBias: Double) -> MMKPolylinePosition?

Finds the closest polyline position between the two positions. Returns null if there is no position that satisfies the condition distance(point, position) < maxLocationBias.