Appearance
KBE3D / KBCore / turf / circle
函数: circle()
circle<
P>(center:number[] |Point|Feature<Point,P>,radius:number,options?: {steps?:number;units?:Units;properties?:P; }):Feature<Polygon,P>
Function
Takes a Point and calculates the circle polygon given a radius in Units; and steps for precision.
类型参数
P
P extends GeoJsonProperties = GeoJsonProperties
参数
center
center point
number[] | Point | Feature<Point, P>
radius
number
radius of the circle
options?
Optional parameters
steps?
number
number of steps
units?
Supports all valid Turf Units
properties?
P
properties
返回
circle polygon
示例
ts
var center = [-75.343, 39.984];
var radius = 5;
var options = {steps: 10, units: 'kilometers', properties: {foo: 'bar'}};
var circle = turf.circle(center, radius, options);
//addToMap
var addToMap = [turf.point(center), circle]