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

Extensions for kotlin.collections.List

containsLocation

Computes whether the latLng lies inside this.

fun List<LatLng>.containsLocation(latLng: LatLng, geodesic: Boolean): Boolean

isClosedPolygon

Checks whether or not this LatLng list is a closed Polygon.

fun List<LatLng>.isClosedPolygon(): Boolean

isLocationOnPath

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

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

isOnEdge

Checks whether or not latLng lies on or is near the edge of this polygon within the tolerance (in meters). The default value is PolyUtil.DEFAULT_TOLERANCE.

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

latLngListEncode

Encodes this LatLng list in a String using the Polyline Algorithm Format.

fun List<LatLng>.latLngListEncode(): String

simplify

Simplifies this list of LatLng using the Douglas-Peucker decimation. Increasing the value of tolerance will result in fewer points.

fun List<LatLng>.simplify(tolerance: Double): List<LatLng>

sphericalPathLength

Computes the length of this path on Earth.

fun List<LatLng>.sphericalPathLength(): Double

sphericalPolygonArea

Computes the area under a closed path on Earth.

fun List<LatLng>.sphericalPolygonArea(): Double

sphericalPolygonSignedArea

Computes the signed area under a closed path on Earth. The sign of the area may be used to determine the orientation of the path.

fun List<LatLng>.sphericalPolygonSignedArea(): Double