---
title: "MaplibreFlowBuilding"
description: "Flowing 3D buildings with gradient shading and a highlight band cycling along building height."
canonical_url: "https://maplibre.mhaibaraai.cn/en/docs/effects/flow-building"
---
# MaplibreFlowBuilding

> Flowing 3D buildings with gradient shading and a highlight band cycling along building height.

## Introduction

`MaplibreFlowBuilding` renders 3D buildings from the building data given by `source` / `sourceLayer`: gradient shading with a highlight band that cycles along building height; `color` / `flowColor` / `duration` / `bandHeight` / `maxHeight` control the appearance and timing. Requires a tilted view and zoom ≥ `minzoom` (default 15).

## Usage

View the highlight band flowing up the buildings in a tilted view:

```vue [FlowBuildingExample.vue]
<template>
  <div class="h-115 w-full overflow-hidden rounded-(--ui-radius) border border-default">
    <MaplibreMap
      :options="{ style: 'https://tiles.openfreemap.org/styles/dark', center: [116.461, 39.909], zoom: 15.5, pitch: 60, bearing: -20 }"
    >
      <MaplibreFlowBuilding source="openmaptiles" source-layer="building" color="#1e3a8a" flow-color="#67e8f9" />
    </MaplibreMap>
  </div>
</template>
```

## API

### Props

```ts
/**
 * Props for the MaplibreFlowBuilding component
 */
interface MaplibreFlowBuildingProps {
  /**
   * 数据源 id（需已由 MaplibreSource 或样式声明）
   */
  source: string;
  /**
   * 矢量瓦片中的图层名（如 OpenMapTiles 的 'building'）；GeoJSON 源省略
   */
  sourceLayer?: string | undefined;
  /**
   * 建筑高度属性名
   * @default 'render_height'
   */
  heightProperty?: string | undefined;
  /**
   * 建筑底面高度属性名
   * @default 'render_min_height'
   */
  baseProperty?: string | undefined;
  /**
   * 图层 id；省略时自动生成，变更需配合 `:key` 重建
   */
  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;
  /**
   * 整体透明度
   * @default 0.85
   */
  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-maplibre/commits/main/src/runtime/components/effects/FlowBuilding.vue).


## Sitemap

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