isWithinDistance
Whether a point lies within a radius of a center, the border included.
Available since v3.1.8
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
centerLat | number | Latitude of the center, in degrees |
centerLon | number | Longitude of the center, in degrees |
radius | number | The radius in kilometres |
pointLat | number | Latitude of the point, in degrees |
pointLon | number | Longitude of the point, in degrees |
Returns
Section titled “Returns”boolean — true when the point is at most radius kilometres from the center
Examples
Section titled “Examples”Is a place near me?
Section titled “Is a place near me?”Radius check in kilometres, border included.
Far away
Section titled “Far away”Paris is not within 5 km of London.
