---
title: "MapboxFullscreenControl"
description: "Fullscreen control that toggles the map container between fullscreen and normal view on click."
canonical_url: "https://mapbox.mhaibaraai.cn/en/docs/controls/fullscreen"
---
# MapboxFullscreenControl

> Fullscreen control that toggles the map container between fullscreen and normal view on click.

## Introduction

`MapboxFullscreenControl` provides a fullscreen button that toggles the map container between fullscreen and normal view. `position` sets the dock corner, and `options.container` can specify the element to make fullscreen (omit to use the map container).

## Usage

Click the button in the top-right corner to toggle fullscreen:

```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](https://mapbox.mhaibaraai.cn/sitemap.md) for all pages.
