All Implemented Interfaces:
Serializable, Identifiable, ExecutableFunctions

public class ScaleControl extends LeafletControl
A simple scale control that shows the scale of the current center of screen in metric (m/km) and imperial (mi/ft) systems. Extends Control.
Since:
2020-03-07
Version:
1.0
Author:
Gabor Kokeny Email: kokeny19@gmail.com
See Also:
  • Constructor Details

    • ScaleControl

      public ScaleControl()
      Creates a new scale control.
  • Method Details

    • getMaxWidth

      public int getMaxWidth()
      Gets the maximum width of the control in pixels.
      Returns:
      the maximum width of the control in pixels
    • setMaxWidth

      public void setMaxWidth(int maxWidth)
      Maximum width of the control in pixels. The width is set dynamically to show round values (e.g. 100, 200, 500).
      Parameters:
      maxWidth - the maximum width of the control in pixels
    • isMetric

      public boolean isMetric()
      Gets whether the metric scale line (m/km) is shown.
      Returns:
      true if the metric scale line is shown, false otherwise
    • setMetric

      public void setMetric(boolean metric)
      Whether to show the metric scale line (m/km).
      Parameters:
      metric - whether to show the metric scale line
    • isImperial

      public boolean isImperial()
      Gets whether the imperial scale line (mi/ft) is shown.
      Returns:
      true if the imperial scale line is shown, false otherwise
    • setImperial

      public void setImperial(boolean imperial)
      Whether to show the imperial scale line (mi/ft).
      Parameters:
      imperial - whether to show the imperial scale line
    • isUpdateWhenIdle

      public boolean isUpdateWhenIdle()
      Gets whether the control is updated on moveend only rather than continuously on move.
      Returns:
      true if the control is updated on moveend, false if it is updated on move
    • setUpdateWhenIdle

      public void setUpdateWhenIdle(boolean updateWhenIdle)
      If true, the control is updated on moveend, otherwise it's always up-to-date (updated on move).
      Parameters:
      updateWhenIdle - If true, the control is updated on moveend