Need help with leaflet.fullscreen?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

239 Stars 89 Forks MIT License 141 Commits 5 Opened issues


Leaflet.Control.FullScreen for Leaflet

Services available


Need anything else?

Contributors list


What ?

Simple plugin for Leaflet that adds fullscreen button to your maps.

Inspired by

Use the native javascript fullscreen API with help of

Released under the MIT License

How ?

Include Control.FullScreen.js and Control.FullScreen.css in your page:


Add the fullscreen control to the map:

var map = new L.Map('map', {
  fullscreenControl: true,
  fullscreenControlOptions: {
    position: 'topleft'

If your map has a zoomControl the fullscreen button will be added at the bottom of this one.

If your map doesn't have a zoomControl the fullscreen button will be added to topleft corner of the map (same as the zoomControl).

If you want to use the plugin on a map embedded in an iframe, don't forget to set

attribute on your iframe.

Events and options:

// create a fullscreen button and add it to the map
  position: 'topleft', // change the position of the button can be topleft, topright, bottomright or bottomleft, default topleft
  title: 'Show me the fullscreen !', // change the title of the button, default Full Screen
  titleCancel: 'Exit fullscreen mode', // change the title of the button when fullscreen is on, default Exit Full Screen
  content: null, // change the content of the button, can be HTML, default null
  forceSeparateButton: true, // force separate button to detach from zoom buttons, default false
  forcePseudoFullscreen: true, // force use of pseudo full screen even if full screen API is available, default false
  fullscreenElement: false // Dom element to render in full screen, false by default, fallback to map._container

// events are fired when entering or exiting fullscreen. map.on('enterFullscreen', function(){ console.log('entered fullscreen'); });

map.on('exitFullscreen', function(){ console.log('exited fullscreen'); });

// you can also toggle fullscreen from map object map.toggleFullScreen();

Where ?

Source code :

Downloads :

Demo :

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.