---
title: "MapboxAttributionControl"
description: "Attribution control that displays data source credits with compact-mode collapsing and support for custom attribution text."
canonical_url: "https://mapbox.mhaibaraai.cn/en/docs/controls/attribution"
---
# MapboxAttributionControl

> Attribution control that displays data source credits with compact-mode collapsing and support for custom attribution text.

## Introduction

`MapboxAttributionControl` displays data source attribution in a corner of the map. `options.compact` collapses it into an expandable icon button, and `options.customAttribution` appends custom attribution text (a string or array of strings).

> [!TIP]
> 
> Attribution from styles and data sources is usually displayed automatically. Use this control to customize the presentation or add supplementary credits.

## Usage

Compact mode with custom attribution appended:

```vue [AttributionControlExample.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.39, 39.91], zoom: 10 }">
      <!-- compact 折叠为图标按钮，customAttribution 追加自定义版权 -->
      <MapboxAttributionControl
        position="bottom-right"
        :options="{ compact: true, customAttribution: '© MOVK Mapbox' }"
      />
    </MapboxMap>
  </div>
</template>
```

## API

### Props

```ts
/**
 * Props for the MapboxAttributionControl component
 */
interface MapboxAttributionControlProps {
  /**
   * 控件停靠位置；省略用地图默认位置
   */
  position?: mapboxgl.ControlPosition | undefined;
  /**
   * AttributionControl 构造选项
   */
  options?: mapboxgl.AttributionControlOptions | undefined;
}
```

## Changelog

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


## Sitemap

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