block by maptastik 4e0470efe97e3f51b537d5f09530f6b8

This function takes an input GeoJSON dataset and creates a generates a hex grid from the bounding box of that layer.

This function takes an input GeoJSON dataset and creates a generates a hex grid from the bounding box of that layer. Because of the way hex grids are created using turfjs, using the bounding box doesn’t necessarily result in every area of the input GeoJSON being covered by a hex grid. As such you can also set buffer parameters, radius and bufferUnits, to expand the area for which the bounding box is created. You can define the size of the hexagons with the cellSide and hexUnits parameters.

hexGridFromLayerBBox.js