MapboxBufferEllipse
椭圆缓冲区,按米半轴与方位角生成填充与描边图层。
简介
MapboxBufferEllipse 以中心、x/y 半轴(米)与长轴方位角 angle 生成椭圆,渲染为填充 + 描边两层。
用法
长轴 3000m、短轴 1500m、旋转 30°:
<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 }">
<!-- x/y 半轴单位米,angle 为长轴方位角 -->
<MapboxBufferEllipse
:center="center"
:x-semi-axis="3000"
:y-semi-axis="1500"
:angle="30"
color="#f59e0b"
/>
</MapboxMap>
</div>
</template>
API
Props
| Prop | Default | Type |
|---|---|---|
center | [number, number]中心经纬度 | |
xSemiAxis | numberx 半轴(米) | |
ySemiAxis | numbery 半轴(米) | |
angle | 0 | 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