---
title: "MapboxTextureBuilding"
description: "Textured 3D buildings using a user image as fill-extrusion-pattern over the composite/building source."
canonical_url: "https://mapbox.mhaibaraai.cn/en/docs/effects/texture-building"
---
# MapboxTextureBuilding

> Textured 3D buildings using a user image as fill-extrusion-pattern over the composite/building source.

## Introduction

`MapboxTextureBuilding` renders 3D buildings based on the official `composite/building` source, applying a `url` image as `fill-extrusion-pattern`; `opacity` / `minzoom` control transparency and the starting zoom level. Requires a tilted view and zoom ≥ `minzoom` (default 15).

## Usage

Cover building surfaces with a tileable brick-wall texture:

```vue [TextureBuildingExample.vue]
<template>
  <div class="h-115 w-full overflow-hidden rounded-(--ui-radius) border border-default">
    <MapboxMap
      :options="{ style: 'mapbox://styles/mapbox/light-v11', center: [116.461, 39.909], zoom: 15.5, pitch: 60, bearing: -20 }"
    >
      <!-- three.js 公开的可平铺砖墙贴图 -->
      <MapboxTextureBuilding url="https://threejs.org/examples/textures/brick_diffuse.jpg" />
    </MapboxMap>
  </div>
</template>
```

## API

### Props

```ts
/**
 * Props for the MapboxTextureBuilding component
 */
interface MapboxTextureBuildingProps {
  /**
   * 贴图地址
   */
  url: string;
  /**
   * 图层 id；省略时自动生成
   */
  layerId?: string | undefined;
  /**
   * 整体透明度
   */
  opacity?: number | undefined;
  /**
   * 最小缩放级别
   * @default "15"
   */
  minzoom?: number | undefined;
  /**
   * 插入到该图层之前
   */
  beforeId?: string | undefined;
}
```

## Changelog

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


## Sitemap

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