A button that expands the map to fill the screen.
<HoloMap.Control.Fullscreen position="top-left" />Props
| Prop | Type | Notes |
|---|---|---|
position | string | Corner to place the control in. Default "top-right" |
container | string | The id of the element to make fullscreen in place of the map's container |
pseudo | boolean | Fill the browser's window with CSS rather than through the browser's fullscreen API. Default false |
The button expands the map's own container, so anything rendered outside it,
such as a sidebar or a legend in your own markup, is not part of the
fullscreen view.
Put controls that should survive fullscreen inside the map as HoloMap.Control
components, or name an element that holds both the map and that markup in
container:
<div id="dashboard">
<aside>...</aside>
<HoloMap.Map cid="fleet" style={@style}>
<HoloMap.Control.Fullscreen container="dashboard" />
</HoloMap.Map>
</div>A prop cannot carry an element, so container names one by its id, which
the browser runtime looks up when it adds the control. The element must be
on the page by then: an id no element has is warned about once in the
browser console, and the control makes the map's own container fullscreen.
A change to either prop builds the control again, as for any control.
pseudo fills the window through MapLibre's CSS class rather than the
browser's fullscreen API, which is quicker to enter and leave, and lets two
maps in two windows each fill their own. MapLibre uses it on its own on a
browser without the fullscreen API.
Events
on_enter fires when the map goes fullscreen (MapLibre's
fullscreenstart), and on_exit when it leaves (fullscreenend), by the
button or by the browser, as with the Escape key. Neither carries a
payload:
<HoloMap.Control.Fullscreen on_enter={:went_fullscreen} on_exit={:left_fullscreen} />
def action(:went_fullscreen, _params, component) do
put_state(component, :fullscreen, true)
end
Summary
Functions
Returns true to indicate that the callee module is a component module (has "use Hologram.Component" directive).
Returns the list of property definitions for the compiled component.
Functions
@spec __is_hologram_component__() :: boolean()
Returns true to indicate that the callee module is a component module (has "use Hologram.Component" directive).
Examples
iex> __is_hologram_component__()
true
Returns the list of property definitions for the compiled component.