Class ScaleControl
java.lang.Object
org.vaadin.addons.componentfactory.leaflet.LeafletObject
org.vaadin.addons.componentfactory.leaflet.controls.LeafletControl
org.vaadin.addons.componentfactory.leaflet.controls.ScaleControl
- All Implemented Interfaces:
Serializable,Identifiable,ExecutableFunctions
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:
-
Nested Class Summary
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintGets the maximum width of the control in pixels.booleanGets whether the imperial scale line (mi/ft) is shown.booleanisMetric()Gets whether the metric scale line (m/km) is shown.booleanGets whether the control is updated on moveend only rather than continuously on move.voidsetImperial(boolean imperial) Whether to show the imperial scale line (mi/ft).voidsetMaxWidth(int maxWidth) Maximum width of the control in pixels.voidsetMetric(boolean metric) Whether to show the metric scale line (m/km).voidsetUpdateWhenIdle(boolean updateWhenIdle) If true, the control is updated on moveend, otherwise it's always up-to-date (updated on move).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
-
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:
trueif the metric scale line is shown,falseotherwise
-
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:
trueif the imperial scale line is shown,falseotherwise
-
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:
trueif the control is updated on moveend,falseif 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
-