---
title: "MapboxBufferSector"
description: "Sector buffer that generates a wedge from a center point, meter radius, and start/end bearings, rendered as fill and line layers."
canonical_url: "https://mapbox.mhaibaraai.cn/en/docs/layers/buffer-sector"
---
# MapboxBufferSector

> Sector buffer that generates a wedge from a center point, meter radius, and start/end bearings, rendered as fill and line layers.

## Introduction

`MapboxBufferSector` generates a sector wedge from a center point, meter radius, and start/end bearings (`bearing1` → `bearing2`, clockwise from north), rendered as fill and stroke layers. Common uses include viewsheds and signal coverage sectors.

## Usage

A sector from 30° to 120° with a 3000m radius:

```vue [BufferSectorExample.vue]
<script setup lang="ts">
const center: [number, number] = [116.397, 39.908]
</script>

<template>
  <div class="h-115 w-full overflow-hidden rounded-(--ui-radius) border border-default">
    <MapboxMap :options="{ style: 'mapbox://styles/mapbox/light-v11', center, zoom: 11 }">
      <!-- bearing1 → bearing2（度，正北顺时针）扇面，半径单位米 -->
      <MapboxBufferSector
        :center="center"
        :radius="3000"
        :bearing1="30"
        :bearing2="120"
        color="#f43f5e"
      />
    </MapboxMap>
  </div>
</template>
```

## API

### Props

```ts
/**
 * Props for the MapboxBufferSector component
 */
interface MapboxBufferSectorProps {
  /**
   * 圆心经纬度
   */
  center: [number, number];
  /**
   * 半径（米）
   */
  radius: number;
  /**
   * 起始方位角（度）
   */
  bearing1: number;
  /**
   * 结束方位角（度）
   */
  bearing2: number;
  /**
   * 弧线采样段数
   * @default "64"
   */
  steps?: number | undefined;
  /**
   * 图层 id 前缀；省略时自动生成
   */
  layerId?: string | undefined;
  /**
   * 主色（快捷样式）
   */
  color?: string | undefined;
  /**
   * 整体覆盖填充 paint
   */
  fillPaint?: Record<string, unknown> | undefined;
  /**
   * 整体覆盖描边 paint
   */
  linePaint?: Record<string, unknown> | undefined;
  /**
   * 插入到该图层之前
   */
  beforeId?: string | undefined;
}
```

## Changelog

See commit history for [src/runtime/components/buffers/BufferSector.vue](https://github.com/mhaibaraai/movk-mapbox/commits/main/src/runtime/components/buffers/BufferSector.vue).


## Sitemap

See the full [sitemap](https://mapbox.mhaibaraai.cn/sitemap.md) for all pages.
