export function bboxFeature()

in src/lib/components/molecules/svg-map/helpers/bboxFeature.js [5:29]


export function bboxFeature(bounds) {
  const minLon = bounds[0][0]
  const minLat = bounds[0][1]
  const maxLon = bounds[1][0]
  const maxLat = bounds[1][1]

  const feature = {
    type: "Feature",
    properties: {},
    geometry: {
      coordinates: [
        [
          [minLon, maxLat],
          [maxLon, maxLat],
          [maxLon, minLat],
          [minLon, minLat],
          [minLon, maxLat],
        ],
      ],
      type: "Polygon",
    },
  }

  return feature
}