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

public abstract class LeafletControl extends LeafletObject
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:
  • Field Details

  • Constructor Details

    • LeafletControl

      public LeafletControl(String controlType)
      Creates a new control of the given Leaflet control type.
      Parameters:
      controlType - the Leaflet type identifier of the control
  • Method Details

    • getPosition

      public LeafletControl.ControlPosition getPosition()
      Gets the position of the control on the map.
      Returns:
      the position of the control
    • getLeafletType

      public String getLeafletType()
      Gets the Leaflet type identifier of this control.
      Overrides:
      getLeafletType in class LeafletObject
      Returns:
      the Leaflet control type
    • setPosition

      public void setPosition(LeafletControl.ControlPosition position)
      Sets the position of the control.
      Parameters:
      position - the position of the control
    • addTo

      public void addTo(LeafletMap leafletMap)
      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.