Static
addGiven a point (lng, lat)
, add (dx, dy)
meters to its location. Negative
values are subtracted.
Returns new point.
Source point.
Longitude meters to add.
Latitude meters to add.
Static
distanceCalculates the distance between two points in meters using the Haversine formula.
Distance between point 1 and point 2 in meters.
const dist = Polygon.distance({ lng: 0, lat: 0 }, { lng: 1, lat: 0 });
Static
isStatic
isIs the polygon specified by the list of points valid, i.e it does not self-intersect?
true
if the polygon is valid (does not self-intersect),
false
if the polygon is invalid (has self-intersections).
Polygon points. Do not duplicate the last point.
Static
toGenerated using TypeDoc
The Polygon class provides some simple geometric analysis tools: