---
title: "MapboxBufferEllipse"
description: "Ellipse buffer that generates an ellipse from a center, meter semi-axes, and orientation angle, rendered as fill and line layers."
canonical_url: "https://mapbox.mhaibaraai.cn/en/docs/layers/buffer-ellipse"
---
# MapboxBufferEllipse

> Ellipse buffer that generates an ellipse from a center, meter semi-axes, and orientation angle, rendered as fill and line layers.

## Introduction

`MapboxBufferEllipse` generates an ellipse from a center point, x/y semi-axes (in meters), and a major-axis orientation `angle`, rendered as fill and stroke layers.

## Usage

Major axis 3000m, minor axis 1500m, rotated 30°:

```vue [BufferEllipseExample.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 }">
      <!-- x/y 半轴单位米，angle 为长轴方位角 -->
      <MapboxBufferEllipse
        :center="center"
        :x-semi-axis="3000"
        :y-semi-axis="1500"
        :angle="30"
        color="#f59e0b"
      />
    </MapboxMap>
  </div>
</template>
```

## API

### Props

```ts
/**
 * Props for the MapboxBufferEllipse component
 */
interface MapboxBufferEllipseProps {
  /**
   * 中心经纬度
   */
  center: [number, number];
  /**
   * x 半轴（米）
   */
  xSemiAxis: number;
  /**
   * y 半轴（米）
   */
  ySemiAxis: number;
  /**
   * 旋转角（度，正北顺时针）
   * @default "0"
   */
  angle?: number | undefined;
  /**
   * 周长采样段数
   * @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/BufferEllipse.vue](https://github.com/mhaibaraai/movk-mapbox/commits/main/src/runtime/components/buffers/BufferEllipse.vue).


## Sitemap

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