Skip to content

Instantly share code, notes, and snippets.

@thejuan
Created May 9, 2022 01:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thejuan/73d4977d3599eede4e3c4daba68336b7 to your computer and use it in GitHub Desktop.
Save thejuan/73d4977d3599eede4e3c4daba68336b7 to your computer and use it in GitHub Desktop.
turf-sandbox snippet
// simply return a valid GeoJSON and it will be rendered on the map
/**
* [bounds.west, bounds.north],
[bounds.east, bounds.north],
[bounds.east, bounds.south],
[bounds.west, bounds.south],
*/
const sydney = turf.polygon([[
[150.5209286, -33.5781409],
[151.3430209, -33.5781409],
[151.3430209, -34.118347],
[150.5209286,-34.118347],
//Close loop with start again
[150.5209286, -33.5781409],
]],
{stroke: '#0FF', fill: '#0FF', 'fill-opacity': 0.3, 'stroke-width': 6}
);
return turf.featureCollection([sydney]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment