import ScaleBarViewModel from "@arcgis/core/widgets/ScaleBar/ScaleBarViewModel.js";const ScaleBarViewModel = await $arcgis.import("@arcgis/core/widgets/ScaleBar/ScaleBarViewModel.js");- Inheritance:
- ScaleBarViewModel→
Accessor
- Since
- ArcGIS Maps SDK for JavaScript 4.3
Provides the logic for the Scale Bar component and ScaleBar widget.
- See also
Scale Bar component
ScaleBar widget - Deprecated since 4.32. Use the Scale Bar component instead.
Constructors
Constructor
Constructor
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| properties | | |
See the properties table for a list of all the
properties that may be passed into the constructor.
Properties
Any properties can be set, retrieved or listened to. See the
Watch for changes
topic.
Methods
| Method | Signature | Class |
|---|---|---|
getScaleBarProperties(length: number, measurementSystem: MeasurementSystem): any | null | undefined | |
getScaleBarProperties
Method
- Signature
-
getScaleBarProperties (length: number, measurementSystem: MeasurementSystem): any | null | undefined
- Since
- ArcGIS Maps SDK for JavaScript 4.31
Computes the size and units of the scale bar widget given a base length in pixels.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| length | The base width of the scale bar widget in pixels. | | |
| measurementSystem | The measurement system to use. | |