feat: Add sphere.js getDistance

This commit is contained in:
2025-08-26 13:44:28 +02:00
parent f16320ad7b
commit bf4f0fb17c

View File

@@ -6,3 +6,14 @@ module Sphere =
[<Import("getLength", "ol/sphere")>]
let getLength geometry = jsNative
/// <summary>
/// Get the great circle distance (in meters) between two geographic coordinates.
/// @param {Array} c1 Starting coordinate.
/// @param {Array} c2 Ending coordinate.
/// @param {number} [radius] The sphere radius to use. Defaults to the Earth's mean radius using the WGS84 ellipsoid.
/// @return {number} The great circle distance between the points (in meters).
/// @api
/// </summary>
[<Import("getDistance", "ol/sphere")>]
let getDistance (c1: Coordinate) (c2: Coordinate) (radius: float option) : float = jsNative