sortedByDistanceTo

fun sortedByDistanceTo(currentLocation: LngLatAlt, featureCollection: FeatureCollection): FeatureCollection

Given a Feature Collection and location this will calculate the nearest distance to each Feature, and return a sorted Feature Collection by the distance_to foreign member for each Feature.

Return

a sorted Feature Collection with the "distance_to" from the current location as a foreign member in meters for each Feature.

Parameters

currentLocation

Current location as LngLatAlt.

featureCollection