Skip to content

Instantly share code, notes, and snippets.

@jomel
Created July 11, 2025 15:58
Show Gist options
  • Select an option

  • Save jomel/64acbee330058ac4e392355808d7ae86 to your computer and use it in GitHub Desktop.

Select an option

Save jomel/64acbee330058ac4e392355808d7ae86 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
const p = turf.point(
[-122.3093, 47.6638],
{'marker-symbol': 'rocket', 'marker-color': '#F00', 'marker-size': 'large'}
);
const l = turf.lineString(
[[-122.3116, 47.6623], [-122.3052, 47.6650]],
{'stroke-width': 3, stroke: '#00F'}
);
const poly = turf.polygon([[
[-122.3104, 47.6627],
[-122.3071, 47.6627],
[-122.3071, 47.6644],
[-122.3104, 47.6644],
[-122.3104, 47.6627]
]],
{stroke: '#0FF', fill: '#0FF', 'fill-opacity': 0.3, 'stroke-width': 6}
);
return turf.featureCollection([poly, l, p]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment