Skip to content
import WeatherViewModel from "@arcgis/core/widgets/Weather/WeatherViewModel.js";
Inheritance:
WeatherViewModelAccessor
Since
ArcGIS Maps SDK for JavaScript 4.23

Provides the logic for the Weather widget.

See also

Constructors

Constructor

Constructor
Parameters
ParameterTypeDescriptionRequired
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.
PropertyTypeClass
declaredClass
readonly inherited
state
readonly

declaredClass

readonlyinherited Property
Type
string
Inherited from: Accessor

The name of the class. The declared class name is formatted as esri.folder.className.

state

readonly Property
Type
WeatherState

The current state of the view model that can be used for rendering the UI of the widget.

ValueDescription
disabledwidget is being created or has no view
readywidget is ready
errorwidget is displaying an error
Default value
"disabled"

view

Property
Type
SceneView | null | undefined

A reference to the View. This widget is only supported in a SceneView.

Methods

MethodSignatureClass
setWeatherByType(type: WeatherType): void

setWeatherByType

Method
Signature
setWeatherByType (type: WeatherType): void

Sets the weather to the specified type.

Parameters
ParameterTypeDescriptionRequired
type

{"sunny"|"cloudy"|"rainy"|"snowy"|"foggy"} The weather to be selected.

Returns
void