import ShadowCastViewModel from "@arcgis/core/widgets/ShadowCast/ShadowCastViewModel.js";const ShadowCastViewModel = await $arcgis.import("@arcgis/core/widgets/ShadowCast/ShadowCastViewModel.js");- Inheritance:
- ShadowCastViewModel→
Accessor
- Since
- ArcGIS Maps SDK for JavaScript 4.21
Provides the logic for the ShadowCast widget and component.
- See also
ShadowCast widget - Deprecated since 5.0. Use the Shadow Cast component instead.
Constructors
Constructor
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| properties | | |
Properties
| Property | Type | Class |
|---|---|---|
| | ||
declaredClass readonly inherited | ||
| | ||
| | ||
| | ||
| | ||
state readonly | | |
| | ||
| | ||
| | ||
| |
date
- Type
- Date
The calendar date used to calculate the shadow cast. This date excludes
the time. If a date with a time is set, the time value will be set to midnight (00:00:00) of that date in local system time.
If no date is set, then it defaults to the current date in local system time.
Example
widget.viewModel.date = new Date('June 1, 2021'); discreteOptions
- Type
- DiscreteOptions
The configuration used when the widget's visualizationType is set to "discrete".
durationOptions
- Type
- DurationOptions
The configuration used when the widget's visualizationType is set to "duration".
state
- Type
- ShadowCastState
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 |
| ready | widget is ready |
- Default value
- "disabled"
thresholdOptions
- Type
- ThresholdOptions
The configuration used when the widget's visualizationType is set to "threshold".
utcOffset
- Type
- number
The difference in hours between UTC time and the times displayed in the widget.
visualizationType
Type of visualization to use when showing the shadows. There are 3 types of visualization:
- "threshold" only displays areas that receive shadows for a period longer than a given threshold value
- "duration" displays all areas that receive shadows either in a continuous mode or in 1 hour time intervals
- "discrete" mode displays individual shadows cast at a given time interval
- Default value
- "threshold"
Methods
| Method | Signature | Class |
|---|---|---|
getDuration(point: ScreenPoint): Promise<number> | | |
start(): void | | |
stop(): void | |
start
- Signature
-
start (): void
Starts the widget. While running it will automatically perform shadow accumulation.
- Returns
- void