Fullscreen

The fullscreen control adds a link to the map that assigns a fullscreen class to the map, which makes it fill the page.

You’ll see that this control adds a fullscreen link to the map, and that it’s a bit ugly right now. Until Wax’s theming improves, keep in mind that its styling, which is contained in theme/controls.css, is completely optional and you can replace it with your own.

Example

wax.tilejson(
'https://api.tiles.mapbox.com/v3/mapbox.natural-earth-2.jsonp',
  function(tilejson) {
    var m = new MM.Map('map-div', new wax.mm.connector(tilejson));

    wax.mm.fullscreen(m, tilejson).appendTo(m.parent);
    m.setCenterZoom({ lat: 39, lon: -98 }), 2);
});

API

fullscreen = wax.mm.fullscreen(map, tilejson)
Create a new fullscreen object attached to a map. This doesn't add any UI to the map - see appendTo()
fullscreen.appendTo(element)
Add the fullscreen control - a single element of the form
<a class='wax-fullscreen'>fullscreen</a>
to an element given by 'element'.
fullscreen.full()
Turn fullscreen mode on
fullscreen.original()
Turn off fullscreen mode and return to the original size of the map