Class FullScreenControl
java.lang.Object
org.vaadin.addons.componentfactory.leaflet.LeafletObject
org.vaadin.addons.componentfactory.leaflet.controls.LeafletControl
org.vaadin.addons.componentfactory.leaflet.plugins.fullscreen.FullScreenControl
- All Implemented Interfaces:
Serializable,Identifiable,ExecutableFunctions
@NpmPackage(value="leaflet.fullscreen",
version="3.0.0")
@JsModule("leaflet.fullscreen/Control.FullScreen.js")
@CssImport(value="leaflet.fullscreen/Control.FullScreen.css",
themeFor="leaflet-map")
public class FullScreenControl
extends LeafletControl
Leaflet.Control.FullScreen
Web component: https://www.npmjs.com/package/leaflet.fullscreenSimple plugin for Leaflet that adds fullscreen button to your maps.
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).
If you want to use the plugin on a map embedded in an iframe, don't forget to set allowfullscreen attribute on your iframe.
FullScreen options
- position - change the position of the button can be topleft, topright, bottomright or bottomleft, defaut topleft
- title - change the title of the button, default Full Screen
- titleCancel - change the title of the button when fullscreen is on, default Exit Full Screen
- content - change the content of the button, can be HTML, default null
- forceSeparateButton - force seperate button to detach from zoom buttons, default false
- forcePseudoFullscreen - force use of pseudo full screen even if full screen API is available, default false
- fullscreenElement - Dom element to render in full screen, false by default, fallback to map._container
FullScreen events
- enterFullscreen - event is fired when entering fullscreen
- exitFullscreen - events is fired when exiting fullscreen
Basic Usage
FullScreenControl fullScreenControl = new FullScreenControl(); fullScreenControl.addTo(leafletMap);
- Since:
- 2020-05-26
- Version:
- 1.0
- Author:
- Gabor Kokeny Email: kokeny19@gmail.com
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe event types fired by the fullscreen control when the map enters or exits fullscreen mode.Nested classes/interfaces inherited from class org.vaadin.addons.componentfactory.leaflet.controls.LeafletControl
LeafletControl.ControlPosition -
Field Summary
Fields inherited from class org.vaadin.addons.componentfactory.leaflet.controls.LeafletControl
leafletMap -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new fullscreen control positioned in the top-left corner of the map. -
Method Summary
Modifier and TypeMethodDescriptionGets the content of the button, which may be HTML.getTitle()Gets the title (tooltip) of the button shown while not in fullscreen.Gets the title (tooltip) of the button shown while in fullscreen.booleanGets whether pseudo fullscreen is used even when the browser fullscreen API is available.booleanGets whether the fullscreen button is forced to detach from the zoom buttons.booleanGets whether a specific DOM element is rendered in fullscreen instead of the map container.voidsetContent(String content) Sets the content of the button, which may be HTML.voidsetForcePseudoFullscreen(boolean forcePseudoFullscreen) Sets whether pseudo fullscreen is used even when the browser fullscreen API is available.voidsetForceSeparateButton(boolean forceSeparateButton) Sets whether the fullscreen button is forced to detach from the zoom buttons.voidsetFullscreenElement(boolean fullscreenElement) Sets whether a specific DOM element is rendered in fullscreen instead of the map container.voidSets the title (tooltip) of the button shown while not in fullscreen.voidsetTitleCancel(String titleCancel) Sets the title (tooltip) of the button shown while in fullscreen.static WithFullScreenControlwrap(LeafletMap leafletMap) Wraps the given map in an adapter exposing the fullscreen control API.Methods inherited from class org.vaadin.addons.componentfactory.leaflet.controls.LeafletControl
addTo, getLeafletType, getPosition, remove, setPositionMethods inherited from class org.vaadin.addons.componentfactory.leaflet.LeafletObject
call, configureObjectMapper, executeJs, getConstructorArgumentNames, getJson, getParent, getUuid, setParentMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.vaadin.addons.componentfactory.leaflet.layer.map.functions.ExecutableFunctions
call, executeJs
-
Constructor Details
-
FullScreenControl
public FullScreenControl()Creates a new fullscreen control positioned in the top-left corner of the map.
-
-
Method Details
-
getTitle
Gets the title (tooltip) of the button shown while not in fullscreen.- Returns:
- the title
-
setTitle
Sets the title (tooltip) of the button shown while not in fullscreen.- Parameters:
title- the title to set
-
getTitleCancel
Gets the title (tooltip) of the button shown while in fullscreen.- Returns:
- the titleCancel
-
setTitleCancel
Sets the title (tooltip) of the button shown while in fullscreen.- Parameters:
titleCancel- the titleCancel to set
-
getContent
Gets the content of the button, which may be HTML.- Returns:
- the content
-
setContent
Sets the content of the button, which may be HTML.- Parameters:
content- the content to set
-
isForceSeparateButton
public boolean isForceSeparateButton()Gets whether the fullscreen button is forced to detach from the zoom buttons.- Returns:
- the forceSeparateButton
-
setForceSeparateButton
public void setForceSeparateButton(boolean forceSeparateButton) Sets whether the fullscreen button is forced to detach from the zoom buttons.- Parameters:
forceSeparateButton- the forceSeparateButton to set
-
isForcePseudoFullscreen
public boolean isForcePseudoFullscreen()Gets whether pseudo fullscreen is used even when the browser fullscreen API is available.- Returns:
- the forcePseudoFullscreen
-
setForcePseudoFullscreen
public void setForcePseudoFullscreen(boolean forcePseudoFullscreen) Sets whether pseudo fullscreen is used even when the browser fullscreen API is available.- Parameters:
forcePseudoFullscreen- the forcePseudoFullscreen to set
-
isFullscreenElement
public boolean isFullscreenElement()Gets whether a specific DOM element is rendered in fullscreen instead of the map container.- Returns:
- the fullscreenElement
-
setFullscreenElement
public void setFullscreenElement(boolean fullscreenElement) Sets whether a specific DOM element is rendered in fullscreen instead of the map container.- Parameters:
fullscreenElement- the fullscreenElement to set
-
wrap
Wraps the given map in an adapter exposing the fullscreen control API.- Parameters:
leafletMap- the map to wrap, notnull- Returns:
- a
WithFullScreenControladapter for the given map
-