---
title: "MapboxFlowBuilding"
description: "流动建筑，渐变着色加高亮带沿建筑高度循环流动。"
seo_title: "MapboxFlowBuilding Component"
seo_description: "Flowing 3D buildings with gradient shading and a highlight band cycling along building height."
canonical_url: "https://mapbox.mhaibaraai.cn/docs/effects/flow-building"
---
# MapboxFlowBuilding

> 流动建筑，渐变着色加高亮带沿建筑高度循环流动。

## 简介

`MapboxFlowBuilding` 基于官方样式的 `composite/building` 渲染 3D 建筑：渐变着色 + 高亮带沿建筑高度循环流动；`color` / `flowColor` / `duration` / `bandHeight` / `maxHeight` 控制外观与节奏。需倾斜视角且缩放 ≥ `minzoom`（默认 15）。

## 用法

倾斜视角下查看高亮带在楼体上流动：

```vue [FlowBuildingExample.vue]
<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.461, 39.909], zoom: 15.5, pitch: 60, bearing: -20 }"
    >
      <MapboxFlowBuilding color="#1e3a8a" flow-color="#67e8f9" />
    </MapboxMap>
  </div>
</template>
```

## API

### Props

```ts
/**
 * Props for the MapboxFlowBuilding component
 */
interface MapboxFlowBuildingProps {
  /**
   * 图层 id；省略时自动生成
   */
  layerId?: string | undefined;
  /**
   * 基色
   * @default "\"#1e3a8a\""
   */
  color?: string | undefined;
  /**
   * 流动高亮色
   * @default "\"#67e8f9\""
   */
  flowColor?: string | undefined;
  /**
   * 流动周期（毫秒）
   * @default "3000"
   */
  duration?: number | undefined;
  /**
   * 高亮带覆盖的高度范围（米）
   * @default "60"
   */
  bandHeight?: number | undefined;
  /**
   * 建筑最大参考高度（米）
   * @default "300"
   */
  maxHeight?: number | undefined;
  /**
   * 整体透明度
   */
  opacity?: number | undefined;
  /**
   * 最小缩放级别
   * @default "15"
   */
  minzoom?: number | undefined;
  /**
   * 插入到该图层之前
   */
  beforeId?: string | undefined;
}
```

## Changelog

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


## Sitemap

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