Skip to content

KBE3D / KBCore / turf / sector

函数: sector()

sector(center: Coord, radius: number, bearing1: number, bearing2: number, options?: { steps?: number; units?: Units; properties?: GeoJsonProperties; }): Feature<Polygon>

Function

Creates a circular sector of a circle of given radius and center Point, between (clockwise) bearing1 and bearing2; 0 bearing is North of center point, positive clockwise.

参数

center

Coord

center point

radius

number

radius of the circle

bearing1

number

angle, in decimal degrees, of the first radius of the sector

bearing2

number

angle, in decimal degrees, of the second radius of the sector

options?

Optional parameters

steps?

number

number of steps

units?

Units

Supports all valid Turf Units

properties?

GeoJsonProperties

Translate properties to Feature Polygon

返回

Feature<Polygon>

sector polygon

示例

ts
var center = turf.point([-75, 40]);
var radius = 5;
var bearing1 = 25;
var bearing2 = 45;

var sector = turf.sector(center, radius, bearing1, bearing2);

//addToMap
var addToMap = [center, sector];

KBE3D @3.0.0 Copyright © 2024-present KBE3D