MapboxWindowBuilding
窗户建筑,程序生成窗户点阵贴图作 fill-extrusion-pattern。
简介
MapboxWindowBuilding 基于官方样式的 composite/building 渲染 3D 建筑,并用程序生成的窗户点阵贴图作 fill-extrusion-pattern;rows / cols / litColor / darkColor / litRatio / seed 控制窗格外观。需倾斜视角且缩放 ≥ minzoom(默认 15)。
用法
夜色样式下点亮随机窗格:
<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
}"
>
<MapboxWindowBuilding
:rows="10"
:cols="6"
lit-color="#fde68a"
dark-color="#1f2937"
:lit-ratio="0.45"
/>
</MapboxMap>
</div>
</template>
API
Props
| Prop | Default | Type |
|---|---|---|
minzoom | 15 | number最小缩放级别 |
layerId | string图层 id;省略时自动生成 | |
rows | 8 | number窗户行数 |
cols | 6 | number窗户列数 |
litColor | '#fde68a' | string亮窗颜色 |
darkColor | '#1f2937' | string暗窗/墙体颜色 |
litRatio | 0.45 | number亮窗比例 |
seed | 1 | number随机种子 |
opacity | 1 | number整体透明度 |
beforeId | string插入到该图层之前 |
Changelog
No recent changes