Skip to content

Instantly share code, notes, and snippets.

@jarodium
Created December 1, 2022 13:56
Show Gist options
  • Save jarodium/f9b3b55f047dd9dfb4b903bc10b8b68f to your computer and use it in GitHub Desktop.
Save jarodium/f9b3b55f047dd9dfb4b903bc10b8b68f 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 a = turf.point(
[ -7.935754126611641, 37.015448047817706 ] ,
{'marker-symbol': 'rocket', 'marker-color': '#F00', 'marker-size': 'large'}
);
const b = turf.point(
[ -7.935753143724182, 37.01589770731469 ] ,
{'marker-symbol': 'rocket', 'marker-color': '#F0F', 'marker-size': 'large'}
);
const c = turf.point(
[ -7.9354725501762315, 37.01583746462567 ] ,
{'marker-symbol': 'rocket', 'marker-color': '#FF0', 'marker-size': 'large'}
);
const d = turf.point(
[ -7.9354725501762315, 37.01583746462567 ] ,
{'marker-symbol': 'rocket', 'marker-color': '#FF0', 'marker-size': 'large'}
);
/*console.log(a.geometry.coordinates.reverse());
console.log(b.geometry.coordinates.reverse());
console.log(c.geometry.coordinates.reverse());*/
const l = turf.lineString(
[[-122.3116, 47.6623], [-122.3052, 47.6650]],
{'stroke-width': 3, stroke: '#00F'}
);
return turf.featureCollection([a, b, c]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment