index.d.ts 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. import { GeoJsonProperties, Feature, Point } from 'geojson';
  2. import { Coord, Units } from '@turf/helpers';
  3. /**
  4. * Returns the destination {@link Point} having travelled the given distance along a Rhumb line from the
  5. * origin Point with the (varant) given bearing.
  6. *
  7. * @function
  8. * @param {Coord} origin starting point
  9. * @param {number} distance distance from the starting point
  10. * @param {number} bearing varant bearing angle ranging from -180 to 180 degrees from north
  11. * @param {Object} [options={}] Optional parameters
  12. * @param {string} [options.units='kilometers'] can be degrees, radians, miles, or kilometers
  13. * @param {Object} [options.properties={}] translate properties to destination point
  14. * @returns {Feature<Point>} Destination point.
  15. * @example
  16. * var pt = turf.point([-75.343, 39.984], {"marker-color": "F00"});
  17. * var distance = 50;
  18. * var bearing = 90;
  19. * var options = {units: 'miles'};
  20. *
  21. * var destination = turf.rhumbDestination(pt, distance, bearing, options);
  22. *
  23. * //addToMap
  24. * var addToMap = [pt, destination]
  25. * destination.properties['marker-color'] = '#00F';
  26. */
  27. declare function rhumbDestination<P extends GeoJsonProperties = GeoJsonProperties>(origin: Coord, distance: number, bearing: number, options?: {
  28. units?: Units;
  29. properties?: P;
  30. }): Feature<Point, P>;
  31. export { rhumbDestination as default, rhumbDestination };