UNPKG

@arcgis/map-components

Version:
225 lines (223 loc) • 11.8 kB
/// <reference types="@arcgis/core/interfaces.d.ts" /> /// <reference types="../../index.d.ts" /> import { Use } from '@arcgis/lumina/controllers'; import { default as ShadowCast } from '@arcgis/core/widgets/ShadowCast.js'; import { PublicLitElement as LitElement, TargetedEvent } from '@arcgis/lumina'; import { ArcgisReferenceElement } from '../../utils/component-utils'; declare const useShadowCastWidget: (component: LitElement & Pick<ShadowCast, "icon" | "label" | "viewModel" | "headingLevel"> & { state?: unknown; viewModel?: __esri.ShadowCastViewModel | undefined; closed?: boolean; icon: import('@arcgis/components-utils').Nil | string; label: import('@arcgis/components-utils').Nil | string; referenceElement?: ArcgisReferenceElement | string; position: __esri.UIPosition; arcgisReady: import('@arcgis/lumina').EventEmitter; arcgisPropertyChange: import('@arcgis/lumina').EventEmitter<{ name: string; }> | undefined; el: HTMLElement & { childElem?: HTMLElement & { ownedBy?: HTMLElement; }; view?: __esri.LinkChartView | __esri.MapView | __esri.SceneView; }; autoDestroyDisabled: boolean; destroy: () => Promise<void>; }) => ShadowCast; /** * The Shadow Cast component displays the cumulative shadows of 3D features in a [Scene](https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-scene/). * This type of analysis is helpful in urban development, where new projects have to satisfy certain shadow duration constraints. * * The component calculates the cumulative shadows for a time range during a single day. The user can * configure the time range and select a calendar date. This time range and calendar date are only used * for the shadow analysis and are not connected to the lighting in the scene. * To control the lighting in the scene, the [Daylight](https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-daylight/) component can be used. * Changing the timezone in the component updates the visualization by interpreting the time range as being * in that timezone. This behavior is different from the [Daylight](https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-daylight/) component, * where selecting a timezone updates the [environment lighting's](https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-scene/#environment) date and time according to the camera position. * * The component provides three [visualization modes](#visualizationType): threshold, duration, and discrete mode. * * In the **threshold** mode, only the areas that receive * shadows for more than a certain amount of time are displayed. In the image below, on May 1, 2021 the red areas receive * shadow for more than 4 hours within the time interval of 10AM to 4PM. * * [![threshold mode](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/shadow-cast/shadow-cast-threshold.png)](https://developers.arcgis.com/javascript/latest/sample-code/shadow-cast/) * * **Total shadow duration** mode displays the duration of the cumulative shadow using opacity: areas that don't * receive any shadow are fully transparent and areas that receive a maximum amount of shadow have a default opacity * of 0.7. The values in between are interpolated. Hovering over the Scene will display a tooltip showing the * amount of time that location is in shadow, rounded to 15-minute intervals. In this mode, the visualization * can display shadow cast in a continuous way or in 1-hour intervals. * * [![duration mode](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/shadow-cast/shadow-cast-duration.png)](https://developers.arcgis.com/javascript/latest/sample-code/shadow-cast/) * * **Discrete shadows** is a third visualization mode which displays individual shadows at a given time interval. * For example, setting the time range to 10AM-11AM and the visualization time interval to 30 minutes will display * shadows for 10AM, 10:30AM and 11:00AM. * * [![discrete mode](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/shadow-cast/shadow-cast-discrete.png)](https://developers.arcgis.com/javascript/latest/sample-code/shadow-cast/) * * The defaults for the time range and visualization settings can be changed using the [startTimeOfDay](#startTimeOfDay), [endTimeOfDay](#endTimeOfDay), and [visualizationType](#visualizationType) properties. * * **Known limitations** * * * Shadow Cast is only supported in a 3D [Scene](https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-scene/) component. * * Terrain does not cast shadows and it is therefore not taken into account in this analysis. * * The component does not take into account the daylight savings. * Use the timezone dropdown to adjust the offset from the Coordinated Universal Time (UTC) and account for the daylight saving time. * * The timezone is automatically detected by the component based on the camera location. In some situations, this might not be accurate. * In case of an inaccurate timezone, users can set it manually using the timezone dropdown. * * **See also** * * - [Sample - Shadow cast component](https://developers.arcgis.com/javascript/latest/sample-code/shadow-cast/) * * [Read more...](https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-shadow-cast/) */ export declare class ArcgisShadowCast extends LitElement { /** * If true, the component will not be destroyed automatically when it is * disconnected from the document. This is useful when you want to move the * component to a different place on the page, or temporarily hide it. If this * is set, make sure to call the [destroy](https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-shadow-cast/#destroy) method when you are done to * prevent memory leaks. * * @default false */ autoDestroyDisabled: boolean; /** * 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. * * _See also_ * * * [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date) */ get date(): Date; set date(value: Date | number | string); /** * The configuration used when the component's [visualizationType](#visualizationType) * is set to "discrete". * * [Read more](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ShadowCast-DiscreteOptions.html) */ discreteOptions: __esri.DiscreteOptions; /** * The configuration used when the component's [visualizationType](#visualizationType) * is set to "duration". * * [Read more](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ShadowCast-DurationOptions.html) */ durationOptions: __esri.DurationOptions; /** * Time (in milliseconds from midnight of the [date](#date)) when the shadow cast computation should stop. * * [Read more](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ShadowCast-ShadowCastViewModel.html#endTimeOfDay) * * @default 16 * 3600 * 1000 */ endTimeOfDay: number; /** * Indicates the heading level to use for the titles "Time range" and "Visualization". * * @default 4 */ headingLevel: number; /** @default false */ hideColorPicker: boolean; /** @default false */ hideDatePicker: boolean; /** @default false */ hideTimeRangeSlider: boolean; /** @default false */ hideTimezone: boolean; /** @default false */ hideTooltip: boolean; /** @default false */ hideVisualizationOptions: boolean; /** @default false */ hideThresholdContext: boolean; /** @default false */ hideThresholdContextColor: boolean; /** @default false */ hideThresholdContextTimeInterval: boolean; /** @default false */ hideThresholdContextToggle: boolean; /** * Icon which represents the component. Typically used when the component is controlled by another component (e.g. by the Expand component). * * See also: [Calcite Icons](https://developers.arcgis.com/calcite-design-system/icons/) * * @default "measure-building-height-shadow" */ icon: string; /** The component's default label. */ label: string; /** @default "bottom-left" */ position: __esri.UIPosition; /** * By assigning the `id` attribute of the Map or Scene component to this property, you can position a child component anywhere in the DOM while still maintaining a connection to the Map or Scene. * * @see [Associate components with a Map or Scene component](https://developers.arcgis.com/javascript/latest/programming-patterns/#associate-components-with-a-map-or-scene-component) */ referenceElement?: ArcgisReferenceElement | string; /** * Time (in milliseconds from midnight of the [date](#date)) when the shadow cast computation should start. * * [Read more](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ShadowCast-ShadowCastViewModel.html#startTimeOfDay) * * @default 10 * 3600 * 1000 */ startTimeOfDay: number; /** * The component's state. The values mean the following: * * * `disabled` - component is being created * * `ready` - component is ready * * @default "disabled" */ readonly state: "ready" | "disabled"; /** * The configuration used when the component's [visualizationType](#visualizationType) * is set to "threshold". * * [Read more](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ShadowCast-ThresholdOptions.html) */ thresholdOptions: __esri.ThresholdOptions; /** The difference in hours between UTC time and the times displayed in the component. */ utcOffset: number; /** * 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` - displays individual shadows cast at a given time interval * * @default "threshold" */ visualizationType: "duration" | "threshold" | "discrete"; /** Permanently destroy the component. */ destroy(): Promise<void>; /** * Returns the time (in milliseconds) spent in shadow for a certain point on the screen. * * [Read more](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ShadowCast-ShadowCastViewModel.html#getDuration) */ getDuration(point: __esri.Point): Promise<number>; /** Starts the component. While running, it will automatically perform shadow accumulation. */ start(): Promise<void>; /** Stops the component. */ stop(): Promise<void>; /** Emitted when the value of a property is changed. Use this to listen to changes to properties. */ readonly arcgisPropertyChange: TargetedEvent<this, { name: "state"; }>; /** Emitted when the component associated with a map or scene view is is ready to be interacted with. */ readonly arcgisReady: TargetedEvent<this, void>; readonly _setterTypes: { date?: Date | number | string; }; } export {};