Skip to content

KBE3D / KBCore / turf / rhumbDestination

函数: rhumbDestination()

rhumbDestination<P>(origin: Coord, distance: number, bearing: number, options?: { units?: Units; properties?: P; }): Feature<Point, P>

Function

Returns the destination Point having travelled the given distance along a Rhumb line from the origin Point with the (varant) given bearing.

类型参数

P

P extends GeoJsonProperties = GeoJsonProperties

参数

origin

Coord

starting point

distance

number

distance from the starting point

bearing

number

varant bearing angle ranging from -180 to 180 degrees from north

options?

Optional parameters

units?

Units

Supports all valid Turf Units

properties?

P

translate properties to destination point

返回

Feature<Point, P>

Destination point.

示例

ts
var pt = turf.point([-75.343, 39.984], {"marker-color": "F00"});
var distance = 50;
var bearing = 90;
var options = {units: 'miles'};

var destination = turf.rhumbDestination(pt, distance, bearing, options);

//addToMap
var addToMap = [pt, destination]
destination.properties['marker-color'] = '#00F';

KBE3D @3.0.0 Copyright © 2024-present KBE3D