MapboxBufferSector
扇形缓冲区,按起止方位角与米半径生成扇面。
简介
MapboxBufferSector 以圆心、米半径与起止方位角(bearing1 → bearing2,正北顺时针)生成扇面,渲染为填充 + 描边两层。常用于视域、信号覆盖扇区等。
用法
30° → 120° 的扇形,半径 3000m:
<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
| Prop | Default | Type |
|---|---|---|
center | [number, number]圆心经纬度 | |
radius | number半径(米) | |
bearing1 | number起始方位角(度) | |
bearing2 | number结束方位角(度) | |
steps | 64 | number弧线采样段数 |
layerId | string图层 id 前缀;省略时自动生成 | |
color | string主色(快捷样式) | |
fillPaint | Record<string, unknown>整体覆盖填充 paint | |
linePaint | Record<string, unknown>整体覆盖描边 paint | |
beforeId | string插入到该图层之前 |
Changelog
No recent changes