brunob/leaflet.fullscreen — pull request #12 by igorlima (2013-03-24 15:20:39+00:00)
Title: Add a constructor hook (additional initialization code)

Add a constructor hook (an additional initialization code).
Leaflet comes with a way to do it easily using
the _addInitHook_ method ([Construtor Hooks](http://leafletjs.com/reference.html#class)):

```
MyClass.addInitHook(function () {
// ... do something in constructor additionally
// e.g. add event listeners, set custom properties etc.
});
```

So... we can initialize a map with the fullscreen button:

```
Leaflet.map('map', {
fullscreen: true
});
```

Also we can do that:

```
L.control.fullscreen({
position: 'topleft', //Control Positions
}).addTo(map);
```