Turf playground
Turf.js sandbox for testing functions
by cs09g
HTML
<script src="https://cdn.jsdelivr.net/npm/[email protected]/turf.min.js"></script>
<div id="map"></div>
CSS
#map {
height: 500px;
}
JavaScript
let east = -159.221849416412;
let north = 77.029150592211;
let south = 18.089845918184;
let west = 131.310243463544;
let pt = turf.point([155.302734375, 19.29040563949799]);
let polygon = turf.polygon([[
[south, west],
[south, east],
[north, east],
[north, west],
[south, west],
]]);
console.log(turf.booleanPointInPolygon(pt, polygon));