@arcgis/map-components
Version:
ArcGIS Map Components
192 lines (190 loc) • 8.38 kB
TypeScript
/// <reference types="@arcgis/core/interfaces.d.ts" />
/// <reference types="../../index.d.ts" />
import { Use } from '@arcgis/lumina/controllers';
import { JsxNode, PublicLitElement as LitElement, TargetedEvent } from '@arcgis/lumina';
import { HeadingLevel } from '../../support/heading.jsx';
import { ArcgisReferenceElement } from '../../utils/component-utils';
import { WeatherViewModel } from './WeatherViewModel.js';
declare const useViewModel: (component: LitElement & Pick<WeatherViewModel, never> & import('../../controllers/useViewModel').ViewModelControllerUses<WeatherViewModel>) => WeatherViewModel;
/**
* The Weather component allows easy selection and configuration of weather effects in a
* [Scene](https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-scene/) component.
* The available weather types are:
* [sunny](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-environment-SunnyWeather.html),
* [cloudy](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-environment-CloudyWeather.html),
* [rainy](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-environment-RainyWeather.html),
* [snowy](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-environment-SnowyWeather.html), and
* [foggy](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-environment-FoggyWeather.html).
*
* To set the weather programmatically, apply the desired weather type to the
* [environment](https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-scene/#environment) property of the Scene component.
*
* ```js
* // Access the Scene component.
* const viewElement = document.querySelector("arcgis-scene");
* await viewElement.viewOnReady();
* // Specify the weather settings.
* viewElement.environment.weather = {
* type: "rainy", // autocasts as new RainyWeather({ cloudCover: 0.7, precipitation: 0.3 })
* cloudCover: 0.7,
* precipitation: 0.3
* };
* ```
*
* To determine if the weather visualization is available, check the boolean value of `viewElement.environment.weatherAvailable`. The weather is only available:
* * in `global` [viewing mode](https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-scene/#viewingMode),
* * when `atmosphereEnabled` property on [environment](https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-scene/#environment) is `true`,
* * at lower altitudes, near the ground.
*
* **Known limitations**
*
* Weather is only supported in a 3D [Scene](https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-scene/) component.
*
* **See also**
*
* - [SunnyWeather](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-environment-SunnyWeather.html)
* - [CloudyWeather](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-environment-CloudyWeather.html)
* - [RainyWeather](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-environment-RainyWeather.html)
* - [SnowyWeather](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-environment-SnowyWeather.html)
* - [FoggyWeather](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-environment-FoggyWeather.html)
* - [Sample - Weather component](https://developers.arcgis.com/javascript/latest/sample-code/weather/)
*
* [Read more...](https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-weather/)
*/
export declare class ArcgisWeather 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-weather/#destroy) method when you are done to
* prevent memory leaks.
*
* @default false
*/
autoDestroyDisabled: boolean;
/**
* Indicates the heading level to use for the title of the component. By default, this message is rendered as a level 4
* heading (e.g. `<h4>Time range</h4>`). Depending on the component's placement in your app, you may need to adjust
* this heading for proper semantics. This is important for meeting accessibility standards.
*
* @instance
* @type {number}
* @see [Heading Elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements)
* @default 4
*/
headingLevel: HeadingLevel;
/**
* Whether to hide the component's header.
*
* @default false
*/
hideHeader: boolean;
/**
* Icon which represents the component.
* Typically used when the component is controlled by another component (e.g. by the Expand component).
*
* @see [Calcite Icons](https://developers.arcgis.com/calcite-design-system/icons/)
* @default "partly-cloudy"
*/
icon: string;
/**
* The component's default label.
*
* @default "Weather"
*/
label: string | undefined;
/**
* Replace localized message strings with your own strings.
*
* _**Note**: Individual message keys may change between releases._
*/
messageOverrides?: typeof this.messages._overrides;
/** @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;
/** The current state of the component. */
readonly state: "ready" | "disabled" | "error";
/** Permanently destroy the component. */
destroy(): 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>;
private messages: Partial<{
componentLabel: string;
componentLabelAccessible: string;
weatherType: string;
error: {
unsupported: string;
localScene: string;
notVisible: string;
noAtmosphere: string;
};
sunny: {
label: string;
cloudCover: string;
};
cloudy: {
label: string;
cloudCover: string;
};
rainy: {
label: string;
cloudCover: string;
precipitation: string;
};
snowy: {
label: string;
cloudCover: string;
precipitation: string;
snowCover: string;
snowCoverTooltip: string;
};
foggy: {
label: string;
fogStrength: string;
};
}> & import('@arcgis/lumina/controllers').T9nMeta<{
componentLabel: string;
componentLabelAccessible: string;
weatherType: string;
error: {
unsupported: string;
localScene: string;
notVisible: string;
noAtmosphere: string;
};
sunny: {
label: string;
cloudCover: string;
};
cloudy: {
label: string;
cloudCover: string;
};
rainy: {
label: string;
cloudCover: string;
precipitation: string;
};
snowy: {
label: string;
cloudCover: string;
precipitation: string;
snowCover: string;
snowCoverTooltip: string;
};
foggy: {
label: string;
fogStrength: string;
};
}>;
}
export {};