How to generate a polygon around a GeoJson point in web mercator projection

I am building a tool to display markers on a map at varying heights in Mapbox GL Js. Mapbox currently lacks the ability to give a marker a height, and the geoJson point is not rendered on its own.

How can I generate a hexagon around a GeoJson point that will follow the EPSG:3857 projection, for me to render on my map?


Solution 1:

You don't need to worry about the projection - Mapbox GL JS will project it for you.

You may be able to use Turf's hexGrid method to generate a single hexagon.