🧩 LControlFullscreen
A control that toggles fullscreen mode for the map.
🧪 Demo
vue
<script setup lang="ts">
import { LControlFullscreen, LMap, LTileLayer } from '@maxel01/vue-leaflet'
</script>
<template>
<LMap ref="map" :zoom="2" :center="[47.41322, -1.219482]">
<LTileLayer
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
layer-type="base"
name="OpenStreetMap"
/>
<LControlFullscreen position="topleft" />
</LMap>
</template>⚙️ Props
| Prop name | Description | Type | Reactive | Default | Required |
|---|---|---|---|---|---|
| enterText | The text set on the button while the map is not fullscreen. | string | initOnly | - | false |
| enterTitle | The title set on the button while the map is not fullscreen. | string | initOnly | - | false |
| exitText | The text set on the button while the map is fullscreen. | string | initOnly | - | false |
| exitTitle | The title set on the button while the map is fullscreen. | string | initOnly | - | false |
| container | The element to make fullscreen, e.g. a parent that also holds a sidebar. Defaults to the map container. | HTMLElement | initOnly | - | false |
| pseudo | Whether to always fill the window with CSS instead of using the Fullscreen API. The control falls back to this where the API isn't available, e.g. on iPhone or in an iframe without allow="fullscreen". | boolean | initOnly | - | false |
🔗 Inherited props
from ControlAbstractProps
| Prop name | Description | Type | Reactive | Default | Required |
|---|---|---|---|---|---|
| position | The position of the control (one of the map corners). Possible values are topleft, topright, bottomleft or bottomright. | ControlPosition | true | - | false |
from ComponentProps
| Prop name | Description | Type | Reactive | Default | Required |
|---|---|---|---|---|---|
| options | Leaflet options to pass to the component constructor. | T | initOnly | - | false |
📡 Emits
| Event | Arguments | Description |
|---|---|---|
ready | T | Triggers when the component is ready |
🧭 Exposes
| Name | Type | Description |
|---|---|---|
leafletObject | Ref<FullscreenControl | undefined> | The underlying Leaflet instance. Can be used to directly interact with the Leaflet API (e.g. calling methods or accessing internal state). |