Scalebar Module
This module can be configured using Manager. For instructions, see Map Widgets.
The Scale Bar Module implements the Scale Bar map widget and Scale Input map widget.
Dual-unit line scale bar (left) and metric ruler scale bar (right)
Scale Input Box
The Scale Input map widget allows users to enter a new scale to zoom the map to. This feature always represents scale as a ratio, for example, 1:1128, 1:300890, or 1:11024035. The Scale Input map widget is enabled by default.
Scale Input map widget, collapsed
The user clicks the map widget to expand it.
Scale Input map widget, expanded
If the map includes a tiled basemap, the user can use the drop-down menu to pick from a preset list of scales. To zoom to the new scale value, the user presses Enter or clicks Go.
Drop-down list of preset scales
If the map uses a tiled basemap and the user enters a scale that is between available scales, the viewer automatically adjusts the user input to the nearest available scale.
In Chrome for desktop, use the up or down arrow to adjust the scale by increments of one.
Configuration Properties
Module
No configuration
properties
Views
-
ScaleInputBoxButtonView
: To hide the Scale Input map widget toggle button, set this view'svisible
property tofalse
. -
ScaleInputBoxView
: To allow theopenByDefault
property to work properly, leave this view'svisible
property set totrue
. -
ScalebarView
: To show the scale bar, set the view'svisible
property totrue
. The default value isfalse
.-
scalebarStyle
: The style of the scale bar. The possible values are:ruler
orline
. The default isruler
. -
scalebarUnit
: The type of units of the scale bar. The possible values are:metric
,english
(US customary units), ordual
(both metric and US customary units). The default ismetric
.The
dual
option can only be used with theline
scale bar style. -
showBackground
: To display a background for the scale bar, set totrue
. The default istrue
.
-
View Models
-
ScalebarViewModel
:-
scaleInputBox
: Configure the Scale Input map widget and its visibility.-
isEnabled
: Enables the Scale Input map widget. The default value isfalse
. -
openByDefault
: Sets whether the Scale Input map widget is expanded by default. The default value istrue
.If the
isEnabled
property is set tofalse
, theopenByDefault
property is ignored and the Scale Input map widget does not appear.If the
ScaleInputBoxView
'svisible
property is set tofalse
, theopenByDefault
property is ignored and the Scale Input map widget does not expand by default.
-
-