Class LeafletControl
java.lang.Object
org.vaadin.addons.componentfactory.leaflet.LeafletObject
org.vaadin.addons.componentfactory.leaflet.controls.LeafletControl
- All Implemented Interfaces:
Serializable,Identifiable,ExecutableFunctions
- Direct Known Subclasses:
AttributionControl,FullScreenControl,LayersControl,ScaleControl,ZoomControl
Base class for all Leaflet map controls. A control is a small UI element
placed on the map (for example zoom buttons, scale line or attribution box)
at one of the four map corners.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe corner of the map on which a control is positioned. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLeafletControl(String controlType) Creates a new control of the given Leaflet control type. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTo(LeafletMap leafletMap) Adds the control to the given map.Gets the Leaflet type identifier of this control.Gets the position of the control on the map.voidremove()Removes the control from the map it is currently active on.voidsetPosition(LeafletControl.ControlPosition position) Sets the position of the control.Methods 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
-
Field Details
-
leafletMap
-
-
Constructor Details
-
LeafletControl
Creates a new control of the given Leaflet control type.- Parameters:
controlType- the Leaflet type identifier of the control
-
-
Method Details
-
getPosition
Gets the position of the control on the map.- Returns:
- the position of the control
-
getLeafletType
Gets the Leaflet type identifier of this control.- Overrides:
getLeafletTypein classLeafletObject- Returns:
- the Leaflet control type
-
setPosition
Sets the position of the control.- Parameters:
position- the position of the control
-
addTo
Adds the control to the given map.- Parameters:
leafletMap- add this control to the given leaflet map
-
remove
public void remove()Removes the control from the map it is currently active on.
-