MapboxAttributionControl
版权信息控件,展示数据来源署名,支持折叠与自定义版权文本。
简介
MapboxAttributionControl 在地图角落展示数据来源署名。options.compact 折叠为可展开的图标按钮,options.customAttribution 追加自定义版权文本(字符串或字符串数组)。
样式或数据源自带的署名通常已自动显示;本控件用于自定义展示形态或补充版权。
用法
折叠模式并追加自定义版权:
<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.39, 39.91], zoom: 10 }"
>
<!-- compact 折叠为图标按钮,customAttribution 追加自定义版权 -->
<MapboxAttributionControl
position="bottom-right"
:options="{ compact: true, customAttribution: '© MOVK Mapbox' }"
/>
</MapboxMap>
</div>
</template>
API
Props
| Prop | Default | Type |
|---|---|---|
position | "top-left" | "top" | "top-right" | "right" | "bottom-right" | "bottom" | "bottom-left" | "left"控件停靠位置;省略用地图默认位置 | |
options | mapboxgl.AttributionControlOptionsAttributionControl 构造选项 |
Changelog
No recent changes