index.d.ts 822 B

12345678910111213141516171819202122232425
  1. import { Feature, Point } from 'geojson';
  2. import { Coord } from '@turf/helpers';
  3. /**
  4. * Takes two points and returns a point midway between them. The midpoint is
  5. * calculated geodesically, meaning the curvature of the earth is taken into
  6. * account.
  7. *
  8. * @function
  9. * @param {Coord} point1 first point
  10. * @param {Coord} point2 second point
  11. * @returns {Feature<Point>} a point midway between `pt1` and `pt2`
  12. * @example
  13. * const point1 = turf.point([144.834823, -37.771257]);
  14. * const point2 = turf.point([145.14244, -37.830937]);
  15. *
  16. * const midpoint = turf.midpoint(point1, point2);
  17. *
  18. * //addToMap
  19. * const addToMap = [point1, point2, midpoint];
  20. * midpoint.properties['marker-color'] = '#f00';
  21. */
  22. declare function midpoint(point1: Coord, point2: Coord): Feature<Point>;
  23. export { midpoint as default, midpoint };