---
title: "MapboxGlowCircle"
description: "炫光圆效果，实心内核加模糊光晕，可选呼吸脉冲。"
seo_title: "MapboxGlowCircle Component"
seo_description: "Glowing circle effect with a solid core and blurred halo, optionally pulsing, over point features."
canonical_url: "https://mapbox.mhaibaraai.cn/docs/effects/glow"
---
# MapboxGlowCircle

> 炫光圆效果，实心内核加模糊光晕，可选呼吸脉冲。

## 简介

`MapboxGlowCircle` 在点要素上渲染炫光圆：实心内核 + 模糊光晕，`pulse` 开启呼吸脉冲；`color` / `radius` / `glowScale` / `duration` 控制外观与节奏。

## 用法

切换主色查看带呼吸脉冲的炫光：

```vue [GlowExample.vue]
<script setup lang="ts">
import type { FeatureCollection } from 'geojson'

withDefaults(defineProps<{ color?: string }>(), {
  color: '#f59e0b'
})

const data: FeatureCollection = {
  type: 'FeatureCollection',
  features: [
    { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: [116.397, 39.908] } },
    { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: [116.46, 39.92] } }
  ]
}
</script>

<template>
  <div class="h-115 w-full overflow-hidden rounded-(--ui-radius) border border-default">
    <MapboxMap :options="{ style: 'mapbox://styles/mapbox/dark-v11', center: [116.43, 39.913], zoom: 11 }">
      <MapboxGlowCircle :data="data" :color="color" pulse />
    </MapboxMap>
  </div>
</template>
```

## API

### Props

```ts
/**
 * Props for the MapboxGlowCircle component
 */
interface MapboxGlowCircleProps {
  /**
   * 点要素数据（GeoJSON 或其 URL）
   */
  data: string | GeoJSON.GeoJSON<GeoJSON.Geometry, GeoJSON.GeoJsonProperties> | undefined;
  /**
   * 图层 id 前缀；省略时自动生成
   */
  layerId?: string | undefined;
  /**
   * 主色
   * @default "\"#f59e0b\""
   */
  color?: string | undefined;
  /**
   * 内核半径（像素）
   * @default "6"
   */
  radius?: number | undefined;
  /**
   * 光晕半径倍数
   * @default "3"
   */
  glowScale?: number | undefined;
  /**
   * 呼吸脉冲（光晕半径 ±25% 正弦摆动）
   * @default "false"
   */
  pulse?: boolean | undefined;
  /**
   * 脉冲周期（毫秒）
   * @default "2000"
   */
  duration?: number | undefined;
  /**
   * 插入到该图层之前
   */
  beforeId?: string | undefined;
}
```

## Changelog

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


## Sitemap

See the full [sitemap](/sitemap.md) for all pages.
