---
title: "MapboxFullscreenControl"
description: "全屏控件，点击在全屏与常态间切换地图容器。"
seo_title: "MapboxFullscreenControl Component"
seo_description: "MapboxFullscreenControl toggles the map container between fullscreen and normal view, with a position prop and options forwarded to the underlying FullscreenControl."
canonical_url: "https://mapbox.mhaibaraai.cn/docs/controls/fullscreen"
---
# MapboxFullscreenControl

> 全屏控件，点击在全屏与常态间切换地图容器。

## 简介

`MapboxFullscreenControl` 提供全屏按钮，点击在全屏与常态间切换地图容器。`position` 指定停靠角，`options.container` 可指定进入全屏的目标元素（省略则用地图容器）。

## 用法

点击右上角按钮切换全屏：

```vue [FullscreenControlExample.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 }">
      <MapboxFullscreenControl position="top-right" />
    </MapboxMap>
  </div>
</template>
```

## API

### Props

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

## Changelog

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


## Sitemap

See the full [sitemap](/sitemap.md) for all pages.
