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

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

## Introduction

`MaplibreFullscreenControl` 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">
    <MaplibreMap :options="{ style: 'https://tiles.openfreemap.org/styles/positron', center: [116.39, 39.91], zoom: 10 }">
      <MaplibreFullscreenControl position="top-right" />
    </MaplibreMap>
  </div>
</template>
```

## API

### Props

```ts
/**
 * Props for the MaplibreFullscreenControl component
 */
interface MaplibreFullscreenControlProps {
  /**
   * 控件停靠位置；省略用地图默认位置
   */
  position?: "top-left" | "top-right" | "bottom-left" | "bottom-right" | undefined;
  /**
   * FullscreenControl 构造选项
   */
  options?: FullscreenControlOptions | undefined;
}
```

## Changelog

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


## Sitemap

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