import WeatherViewModel from "@arcgis/core/widgets/Weather/WeatherViewModel.js";const WeatherViewModel = await $arcgis.import("@arcgis/core/widgets/Weather/WeatherViewModel.js");- Inheritance:
- WeatherViewModel→
Accessor
- Since
- ArcGIS Maps SDK for JavaScript 4.23
Provides the logic for the Weather widget.
- See also
Weather widget - Deprecated since 4.33. Use the Weather 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.
| Property | Type | Class |
|---|---|---|
declaredClass readonly inherited | ||
state readonly | | |
| |
state
readonly Property
- Type
- WeatherState
The current state of the view model that can be used for rendering the UI of the widget.
| Value | Description |
|---|---|
| disabled | widget is being created or has no view |
| ready | widget is ready |
| error | widget is displaying an error |
- Default value
- "disabled"
Methods
| Method | Signature | Class |
|---|---|---|
setWeatherByType(type: WeatherType): void | |
setWeatherByType
Method
- Signature
-
setWeatherByType (type: WeatherType): void
Sets the weather to the specified type.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| type | {"sunny"|"cloudy"|"rainy"|"snowy"|"foggy"} The weather to be selected. | |
- Returns
- void