index.d.ts 766 B

12345678910111213141516171819202122
  1. import { BBox, Feature, Id, Polygon, Properties } from "@turf/helpers";
  2. /**
  3. * Takes a bbox and returns an equivalent {@link Polygon|polygon}.
  4. *
  5. * @name bboxPolygon
  6. * @param {BBox} bbox extent in [minX, minY, maxX, maxY] order
  7. * @param {Object} [options={}] Optional parameters
  8. * @param {Properties} [options.properties={}] Translate properties to Polygon
  9. * @param {string|number} [options.id={}] Translate Id to Polygon
  10. * @returns {Feature<Polygon>} a Polygon representation of the bounding box
  11. * @example
  12. * var bbox = [0, 0, 10, 10];
  13. *
  14. * var poly = turf.bboxPolygon(bbox);
  15. *
  16. * //addToMap
  17. * var addToMap = [poly]
  18. */
  19. export default function bboxPolygon<P = Properties>(bbox: BBox, options?: {
  20. properties?: P;
  21. id?: Id;
  22. }): Feature<Polygon, P>;