Leaflet.Control.FullScreen

Simple plugin for Leaflet that adds a fullscreen button to your maps. Supports true fullscreen mode using the Fullscreen API with a pseudo-fullscreen fallback for browsers without support.

Interactive Demos

Features

🖥️ True Fullscreen

Uses the native Fullscreen API for immersive map viewing. Automatically falls back to pseudo-fullscreen mode when the API is unavailable.

📦 ES6 Modules

Pure ES6 module exports with named imports. UMD version auto-generated from ESM source. Works with modern bundlers and Import Maps.

🎨 Customizable

Configure position, button titles, icons, and behavior. Use fullscreenElement to make custom wrapper elements go fullscreen with your map.

🔧 Programmatic API

Control fullscreen mode with map.toggleFullscreen() method. Listen to enterFullscreen and exitFullscreen events.

⚡ Lightweight

No dependencies beyond Leaflet. Minimal footprint with clean, modern code. Just import and use.

🌍 Wide Support

Compatible with Leaflet 1.7+ and 2.x. Works in all modern browsers with graceful fallback for older ones.