Created
October 16, 2023 00:11
-
-
Save onderaltintas/1c9c0023aece9e53b8fe57aa175d11fd to your computer and use it in GitHub Desktop.
turf-sandbox snippet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// simply return a valid GeoJSON and it will be rendered on the map | |
const p = turf.point( | |
[0, 90], | |
{'marker-symbol': 'rocket', 'marker-color': '#F00', 'marker-size': 'large'} | |
); | |
const poly = turf.polygon([[ | |
[ | |
15, | |
88 | |
], | |
[ | |
-15, | |
88 | |
], | |
[ | |
-195, | |
80 | |
], | |
[ | |
195, | |
80 | |
], | |
[ | |
15, | |
88 | |
] | |
]], | |
{stroke: '#0FF', fill: '#0FF', 'fill-opacity': 0.3, 'stroke-width': 6} | |
); | |
var inside = turf.inside(p,poly); | |
console.log(inside) | |
return turf.featureCollection([poly, p]); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment