maps-utils-v3-ktx / com.google.maps.android.ktx.utils / kotlin.collections.List / isLocationOnPath

isLocationOnPath

fun List<LatLng>.isLocationOnPath(latLng: LatLng, geodesic: Boolean, tolerance: Double = 0.1): Boolean

Computes whether the given latLng lies on or is near this polyline within tolerance (in meters).

Parameters

latLng - the LatLng to inspect

geodesic - if this polyline is geodesic or not

tolerance - the tolerance in meters

Return
true if latLng is on this path, otherwise, false

See Also

PolyUtil.isLocationOnPath