BlueSpice MediaWiki REL1_27
 All Classes Namespaces Files Functions Variables Groups Pages

What ?

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

Inspired by

Use the native javascript fullscreen API

Released under the MIT License

How ?

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

``` html <link rel="stylesheet" href="Control.FullScreen.css"> <script src="Control.FullScreen.js"></script> ```

Add the fullscreen control to the map:

``` js var map = new L.Map('map', { fullscreenControl: true, fullscreenControlOptions: { position: 'topleft' } }); ```

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

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

Events and options:

``` js // create a fullscreen button and add it to the map L.control.fullscreen({ position: 'topleft', // change the position of the button can be topleft, topright, bottomright or bottomleft, defaut topleft title: 'Show me the fullscreen !', // change the title of the button, default Full Screen forceSeparateButton: true, // force seperate 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 }).addTo(map);

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

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

Where ?

Source code :

Downloads :

Demo :