Scale
-
class Scale(**properties: Any)
Superclasses: Widget
, InitiallyUnowned
, Object
Implemented Interfaces: Accessible
, Buildable
, ConstraintTarget
A widget displaying a scale.
CSS nodes
map-scale
├── label[.metric][.imperial]
ShumateScale
uses a single CSS node with name map-scale, it has up to two
childs different labels.
Methods
-
class Scale
-
get_max_width() → int
Gets the maximum scale width.
-
get_unit() → Unit
Gets the unit used by the scale.
-
get_viewport() → Viewport | None
Gets the viewport used by the scale.
-
set_max_width(value: int) → None
Sets the maximum width of the scale on the screen in pixels
- Parameters:
value – the number of pixels
-
set_unit(unit: Unit) → None
Sets the scale unit.
- Parameters:
unit – a Unit
-
set_viewport(viewport: Viewport | None = None) → None
Sets the scale viewport.
- Parameters:
viewport – a Viewport
Properties
-
class Scale
-
props.max_width: int
The type of the None singleton.
-
props.unit: Unit
The type of the None singleton.
-
props.viewport: Viewport
The type of the None singleton.