index.cjs 875 B

12345678910111213141516171819202122232425262728
  1. "use strict";Object.defineProperty(exports, "__esModule", {value: true});// index.ts
  2. var _helpers = require('@turf/helpers');
  3. function bboxPolygon(bbox, options = {}) {
  4. const west = Number(bbox[0]);
  5. const south = Number(bbox[1]);
  6. const east = Number(bbox[2]);
  7. const north = Number(bbox[3]);
  8. if (bbox.length === 6) {
  9. throw new Error(
  10. "@turf/bbox-polygon does not support BBox with 6 positions"
  11. );
  12. }
  13. const lowLeft = [west, south];
  14. const topLeft = [west, north];
  15. const topRight = [east, north];
  16. const lowRight = [east, south];
  17. return _helpers.polygon.call(void 0,
  18. [[lowLeft, lowRight, topRight, topLeft, lowLeft]],
  19. options.properties,
  20. { bbox, id: options.id }
  21. );
  22. }
  23. var turf_bbox_polygon_default = bboxPolygon;
  24. exports.bboxPolygon = bboxPolygon; exports.default = turf_bbox_polygon_default;
  25. //# sourceMappingURL=index.cjs.map