distanceBetweenTwoGeoPoints method

num distanceBetweenTwoGeoPoints(
  1. LatLng l1,
  2. LatLng l2, [
  3. num? radius
])

Calculate the distance in meters between two geographic points.

Given two geographic points l1 and l2, and an optional radius in meters radius, this function calculates and returns the distance between these two points on the Earth's surface. The radius parameter allows you to specify a different radius than the Earth's default radius of approximately 6,371,000 meters.

Implementation

num distanceBetweenTwoGeoPoints(LatLng l1, LatLng l2, [num? radius]) {
  return GeoPoints.distanceBetweenTwoGeoPoints(l1, l2, radius);
}