index.js 403 B

123456789101112131415
  1. // index.ts
  2. import { bbox } from "@turf/bbox";
  3. import { point } from "@turf/helpers";
  4. function center(geojson, options = {}) {
  5. const ext = bbox(geojson);
  6. const x = (ext[0] + ext[2]) / 2;
  7. const y = (ext[1] + ext[3]) / 2;
  8. return point([x, y], options.properties, options);
  9. }
  10. var turf_center_default = center;
  11. export {
  12. center,
  13. turf_center_default as default
  14. };
  15. //# sourceMappingURL=index.js.map