Skip to content

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?

Units

Supports all valid Turf Units

properties?

P

properties

返回

Feature<Polygon, P>

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]

KBE3D @3.0.0 Copyright © 2024-present KBE3D