Skip to content

Time Zone Label

ESM:
Use dark colors for code blocksCopy
1
import "@arcgis/map-components/components/arcgis-time-zone-label";
CDN:
No specific import is needed for this component.
Since:ArcGIS Maps SDK for JavaScript 4.33

Time Zone Label is a component for displaying the current time zone of a Map. The component has two states, collapsed as a small button and expanded displaying the internationalized name of the Map's time zone. Users can toggle between these states by clicking the component's expand/collapse button. By default the component is collapsed.

When expanding, the component will lengthen inwards when positioned within a Map. This behavior can be overridden by setting the expandDirection property to either "start" or "end".

Demo

Properties

PropertyAttributeType
disabled
reflected
disabledboolean
expand-direction"end" | "start"
expanded
reflected
expandedboolean
icon
reflected
iconstring
labellabelstring
messageOverridesRecord<string, unknown>
position
reflected
position"bottom-leading" | "bottom-left" | "bottom-right" | "bottom-trailing" | "manual" | "top-leading" | "top-left" | "top-right" | "top-trailing"
referenceElementreference-elementHTMLArcgisLinkChartElement | HTMLArcgisMapElement | HTMLArcgisSceneElement | string
state
readonlyreflected
state"disabled" | "ready"
viewMapView

disabled

reflected
Property
disabled: boolean

When true, sets the component to a disabled state so the user cannot interact with it.

Attribute
disabled
Default value
false

expandDirection

reflected
Property
expandDirection: "end" | "start"

The direction the component will expand.

By default, the component will expand inward if assigned to a View UI corner. If the component is positioned manually, the component will expand towards the "end" which is equivalent to right in a LTR application.

Attribute
expand-direction

expanded

reflected
Property
expanded: boolean

The expanded state of the component.

Attribute
expanded
Default value
false

icon

reflected
Property
icon: string
Since:ArcGIS Maps SDK for JavaScript 4.34Time Zone Label since 4.33, icon added at 4.34.

Icon which represents the component. Typically used when the component is controlled by another component (e.g. by the Expand component).

See also
Attribute
icon
Default value
"time-zone"

label

Property
label: string

The component's default label.

Attribute
label

messageOverrides

Property
messageOverrides: Record<string, unknown>

Replace localized message strings with your own strings.

Note: Individual message keys may change between releases.

position

reflected
Property
position: "bottom-leading" | "bottom-left" | "bottom-right" | "bottom-trailing" | "manual" | "top-leading" | "top-left" | "top-right" | "top-trailing"
Attribute
position
Default value
"top-left"

referenceElement

Property
Attribute
reference-element

state

readonlyreflected
Property
state: "disabled" | "ready"

The state of the component.

Attribute
state

view

Property
view: MapView

Methods

MethodSignature
componentOnReadycomponentOnReady(): Promise<void>

componentOnReady

Method
componentOnReady(): Promise<void>

Create a promise that resolves once component is fully loaded.

Example
Use dark colors for code blocksCopy
1
2
3
4
const arcgisTimeZoneLabel = document.querySelector("arcgis-time-zone-label");
document.body.append(arcgisTimeZoneLabel);
await arcgisTimeZoneLabel.componentOnReady();
console.log("arcgis-time-zone-label is ready to go!");
Returns
Promise<void>

Events

arcgisPropertyChange

Event
arcgisPropertyChange: CustomEvent<{ name: "state"; }>

Emitted when the value of a property is changed. Use this to listen to changes to properties.

bubbles
composed
cancelable

arcgisReady

Event
arcgisReady: CustomEvent<void>

Emitted when the component associated with a map or scene view is ready to be interacted with.

bubbles
composed
cancelable

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.