isLocationOnPath

fun isLocationOnPath(point: LatLng, polyline: List<LatLng>, geodesic: Boolean, tolerance: Double = DEFAULT_TOLERANCE): Boolean

Computes whether the given point lies on or near a polyline, within a specified tolerance in meters. The polyline is composed of great circle segments if geodesic is true, and of Rhumb segments otherwise. The polyline is not closed -- the closing segment between the first point and the last point is not included.

Return

true if the point is on the polyline, false otherwise.

Parameters

point

The point to check.

polyline

The polyline to check against.

geodesic

Whether to treat the polyline segments as geodesic or rhumb lines.

tolerance

The tolerance in meters.