import ShadowCastViewModel from "@arcgis/core/widgets/ShadowCast/ShadowCastViewModel.js";
const ShadowCastViewModel = await $arcgis.import("@arcgis/core/widgets/ShadowCast/ShadowCastViewModel.js");
@arcgis/core/widgets/ShadowCast/ShadowCastViewModel
Provides the logic for the ShadowCast widget and component.
- See also
Constructors
-
Parameterproperties Objectoptional
See the properties for a list of all the properties that may be passed into the constructor.
Property Overview
Name | Type | Summary | Class |
---|---|---|---|
The calendar date used to calculate the shadow cast. | ShadowCastViewModel | ||
The name of the class. | Accessor | ||
The configuration used when the widget's visualizationType is set to "discrete". | ShadowCastViewModel | ||
The configuration used when the widget's visualizationType is set to "duration". | ShadowCastViewModel | ||
Time (in milliseconds from midnight of the date) when the shadow cast computation should stop. | ShadowCastViewModel | ||
Time (in milliseconds from midnight of the date) when the shadow cast computation should start. | ShadowCastViewModel | ||
The current state of the view model that can be used for rendering the UI of the widget. | ShadowCastViewModel | ||
The configuration used when the widget's visualizationType is set to "threshold". | ShadowCastViewModel | ||
The difference in hours between UTC time and the times displayed in the widget. | ShadowCastViewModel | ||
A reference to the View. | ShadowCastViewModel | ||
Type of visualization to use when showing the shadows. | ShadowCastViewModel |
Property Details
-
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.Examplewidget.viewModel.date = new Date('June 1, 2021');
-
discreteOptions
discreteOptions DiscreteOptionsautocast
-
The configuration used when the widget's visualizationType is set to "discrete".
-
durationOptions
durationOptions DurationOptionsautocast
-
The configuration used when the widget's visualizationType is set to "duration".
-
state
state Stringreadonly
-
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 Possible Values:"disabled" |"ready"
- Default Value:"disabled"
-
thresholdOptions
thresholdOptions ThresholdOptionsautocast
-
The configuration used when the widget's visualizationType is set to "threshold".
-
utcOffset
utcOffset Number
-
The difference in hours between UTC time and the times displayed in the widget.
-
visualizationType
visualizationType String
-
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
Possible Values:"threshold" |"duration" |"discrete"
- Default Value:"threshold"
Method Overview
Name | Return Type | Summary | Class |
---|---|---|---|
Adds one or more handles which are to be tied to the lifecycle of the object. | Accessor | ||
Promise<Number> | Returns the time (in milliseconds) spent in shadow for a certain point on the screen. | ShadowCastViewModel | |
Returns true if a named group of handles exist. | Accessor | ||
Removes a group of handles owned by the object. | Accessor | ||
Starts the widget. | ShadowCastViewModel | ||
Stops the widget. | ShadowCastViewModel |
Method Details
-
Inherited from Accessor
Since: ArcGIS Maps SDK for JavaScript 4.25Accessor since 4.0, addHandles added at 4.25. -
Adds one or more handles which are to be tied to the lifecycle of the object. The handles will be removed when the object is destroyed.
// Manually manage handles const handle = reactiveUtils.when( () => !view.updating, () => { wkidSelect.disabled = false; }, { once: true } ); this.addHandles(handle); // Destroy the object this.destroy();
ParametershandleOrHandles WatchHandle|WatchHandle[]Handles marked for removal once the object is destroyed.
groupKey *optionalKey identifying the group to which the handles should be added. All the handles in the group can later be removed with Accessor.removeHandles(). If no key is provided the handles are added to a default group.
-
getDuration
getDuration(point){Promise<Number>}
-
Returns the time (in milliseconds) spent in shadow for a certain point on the screen.
Parameterpoint ScreenPointThe point on the screen for which shadow cast is calculated.
ReturnsType Description Promise<Number> Resolves with the time in milliseconds spent in shadow for the given screenpoint.
-
hasHandles
InheritedMethodhasHandles(groupKey){Boolean}
Inherited from AccessorSince: ArcGIS Maps SDK for JavaScript 4.25Accessor since 4.0, hasHandles added at 4.25. -
Returns true if a named group of handles exist.
ParametergroupKey *optionalA group key.
ReturnsType Description Boolean Returns true
if a named group of handles exist.Example// Remove a named group of handles if they exist. if (obj.hasHandles("watch-view-updates")) { obj.removeHandles("watch-view-updates"); }
-
Inherited from Accessor
Since: ArcGIS Maps SDK for JavaScript 4.25Accessor since 4.0, removeHandles added at 4.25. -
Removes a group of handles owned by the object.
ParametergroupKey *optionalA group key or an array or collection of group keys to remove.
Exampleobj.removeHandles(); // removes handles from default group obj.removeHandles("handle-group"); obj.removeHandles("other-handle-group");
-
Starts the widget. While running it will automatically perform shadow accumulation.