UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

232 lines (230 loc) • 14.8 kB
import type PopupTemplate from "../PopupTemplate.js"; import type Layer from "./Layer.js"; import type Field from "./support/Field.js"; import type PortalItem from "../portal/PortalItem.js"; import type { ClonableMixin } from "../core/Clonable.js"; import type { MultiOriginJSONSupportMixin } from "../core/MultiOriginJSONSupport.js"; import type { LayerSaveOptions, LayerSaveAsOptions } from "./types.js"; import type { BlendLayer, BlendLayerProperties } from "./mixins/BlendLayer.js"; import type { CustomParametersMixin, CustomParameters, CustomParametersMixinProperties } from "./mixins/CustomParametersMixin.js"; import type { OperationalLayer, OperationalLayerProperties } from "./mixins/OperationalLayer.js"; import type { PortalLayer, PortalLayerProperties } from "./mixins/PortalLayer.js"; import type { RefreshableLayer, RefreshableLayerProperties } from "./mixins/RefreshableLayer.js"; import type { ScaleRangeLayer, ScaleRangeLayerProperties } from "./mixins/ScaleRangeLayer.js"; import type { TemporalLayer, TemporalLayerProperties } from "./mixins/TemporalLayer.js"; import type { TiledImagery, TiledImageryProperties } from "./mixins/TiledImagery.js"; import type { WCSVersion, WCSCoverageInfo } from "./ogc/wcsUtils.js"; import type { PortalItemProperties } from "../portal/PortalItem.js"; import type { ClassBreaksRendererProperties } from "../renderers/ClassBreaksRenderer.js"; import type { FlowRendererProperties } from "../renderers/FlowRenderer.js"; import type { RasterColormapRendererProperties } from "../renderers/RasterColormapRenderer.js"; import type { RasterShadedReliefRendererProperties } from "../renderers/RasterShadedReliefRenderer.js"; import type { RasterStretchRendererProperties } from "../renderers/RasterStretchRenderer.js"; import type { UniqueValueRendererProperties } from "../renderers/UniqueValueRenderer.js"; import type { VectorFieldRendererProperties } from "../renderers/VectorFieldRenderer.js"; import type { RasterRendererUnion } from "../renderers/support/raster/types.js"; import type { CreatePopupTemplateOptions } from "../support/popupUtils.js"; import type { PopupTemplateProperties } from "../PopupTemplate.js"; import type { LayerProperties } from "./Layer.js"; export interface WCSLayerProperties extends LayerProperties, RefreshableLayerProperties, TemporalLayerProperties, TiledImageryProperties, CustomParametersMixinProperties, PortalLayerProperties, OperationalLayerProperties, ScaleRangeLayerProperties, BlendLayerProperties, Partial<Pick<WCSLayer, "coverageId" | "noData" | "popupEnabled" | "url" | "version">> { /** * Use this property to append custom parameters to all WCS requests. * The custom parameters are applied to `GetCapabilities`, `DescribeCoverage`, `GetCoverage` * [operations](https://enterprise.arcgis.com/en/server/latest/publish-services/linux/communicating-with-a-wcs-service-in-a-web-browser.htm) of * WCS services. * * @example * // request for particular images in a mosaic dataset * // Numbers are the object IDs of the image service catalog table * layer.customParameters = {images: "1,2,3"}; * @since 4.18 * @example * // send a custom parameter to your special service * let layer = new MapImageLayer({ * url: serviceUrl, * customParameters: { * "key": "my-special-key" * } * }); */ customParameters?: CustomParameters | null; /** * Indicates whether the layer will be included in the legend. When `false`, the layer will be excluded from the legend. * * @default true */ legendEnabled?: boolean; /** * The popup template for the layer. When set on the layer, the popupTemplate * allows users to access attributes and display their values using text and/or charts * in the view's popup when a pixel is clicked. * See [this sample](https://developers.arcgis.com/javascript/latest/sample-code/layers-imagery-popup/) * for an example of how [PopupTemplate](https://developers.arcgis.com/javascript/latest/references/core/PopupTemplate/) interacts with an * [WCSLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/WCSLayer/). * * A default popup template is automatically used if no `popupTemplate` has been defined when * [Popup.defaultPopupTemplateEnabled](https://developers.arcgis.com/javascript/latest/references/core/widgets/Popup/#defaultPopupTemplateEnabled) * is set to `true`. * * @see [createPopupTemplate()](https://developers.arcgis.com/javascript/latest/references/core/layers/WCSLayer/#createPopupTemplate) * @see [SceneView.popup](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#popup) * @see [View2D.popup](https://developers.arcgis.com/javascript/latest/references/core/views/View2D/#popup) */ popupTemplate?: PopupTemplateProperties | null; /** * The renderer assigned to the layer. The renderer defines how to visualize pixels in the WCSLayer. * Depending on the renderer type, the pixels may be [stretched](https://developers.arcgis.com/javascript/latest/references/core/renderers/RasterStretchRenderer/) * across the color ramp or [classified](https://developers.arcgis.com/javascript/latest/references/core/renderers/ClassBreaksRenderer/). * * @see [Sample - Intro to WCSLayer](https://developers.arcgis.com/javascript/latest/sample-code/layers-wcslayer/) * @see [Sample - Intro to ImageryTileLayer](https://developers.arcgis.com/javascript/latest/sample-code/layers-imagerytilelayer/) * @see [Sample - Intro to ImageryTileLayer](https://developers.arcgis.com/javascript/latest/sample-code/layers-imagerytilelayer/) * @see [Sample - ImageryTileLayer - shaded relief renderer](https://developers.arcgis.com/javascript/latest/sample-code/layers-imagery-renderer/) * @see [Sample - Transposed multidimensional ImageryTileLayer](https://developers.arcgis.com/javascript/latest/sample-code/layers-hosted-imagerytilelayer/) */ renderer?: (ClassBreaksRendererProperties & { type: "class-breaks"; }) | (UniqueValueRendererProperties & { type: "unique-value"; }) | (RasterStretchRendererProperties & { type: "raster-stretch"; }) | (RasterShadedReliefRendererProperties & { type: "raster-shaded-relief"; }) | (RasterColormapRendererProperties & { type: "raster-colormap"; }) | (VectorFieldRendererProperties & { type: "vector-field"; }) | (FlowRendererProperties & { type: "flow"; }) | null; } /** * WCS presents raster data from a [OGC Web Coverage Service](https://www.ogc.org/standards/wcs). Raster data are projected and rendered on the client-side. * It supports versions 1.0.0, 1.1.0, 1.1.1, 1.1.2 and 2.0.1. For version 2.0.1, it supports servers that support GEOTIFF coverage and implements the following extensions: * Scaling, Interpolation, Range Subsetting, CRS, and KVP/Get. * * * To avoid cross-origin issues when using WCSLayer, you may set up a [CORS enabled server](https://developers.arcgis.com/javascript/latest/cors/) or a [proxy](https://developers.arcgis.com/javascript/latest/proxies/). * ArcGIS Server (10.3.1+) image service based WCSLayers have CORS enabled by default. * * @since 4.17 * @see [Sample - Intro to WCSLayer](https://developers.arcgis.com/javascript/latest/sample-code/layers-wcslayer/) */ export default class WCSLayer extends WCSLayerSuperclass { /** * @example * // Typical usage * let layer = new WCSLayer({ * url: "https://sampleserver6.arcgisonline.com/arcgis/services/ScientificData/SeaTemperature/ImageServer/WCSServer" * }); */ constructor(properties?: WCSLayerProperties); /** The coverage identifier for the layer. It defaults to the first coverage. */ accessor coverageId: string; /** * Coverage information retrieved from the WCS Server. * * @since 4.26 */ get coverageInfo(): WCSCoverageInfo; /** * Use this property to append custom parameters to all WCS requests. * The custom parameters are applied to `GetCapabilities`, `DescribeCoverage`, `GetCoverage` * [operations](https://enterprise.arcgis.com/en/server/latest/publish-services/linux/communicating-with-a-wcs-service-in-a-web-browser.htm) of * WCS services. * * @example * // request for particular images in a mosaic dataset * // Numbers are the object IDs of the image service catalog table * layer.customParameters = {images: "1,2,3"}; * @since 4.18 * @example * // send a custom parameter to your special service * let layer = new MapImageLayer({ * url: serviceUrl, * customParameters: { * "key": "my-special-key" * } * }); */ accessor customParameters: CustomParameters | null | undefined; /** * Indicates whether the layer will be included in the legend. When `false`, the layer will be excluded from the legend. * * @default true */ accessor legendEnabled: boolean; /** * The specified noData value applies when neither the service metadata nor the coverage contains noData information. * * @default 0 * @since 4.32 */ accessor noData: number | null | undefined; /** * Indicates whether to display popups when features in the layer are clicked. * * @default true */ accessor popupEnabled: boolean; /** * The popup template for the layer. When set on the layer, the popupTemplate * allows users to access attributes and display their values using text and/or charts * in the view's popup when a pixel is clicked. * See [this sample](https://developers.arcgis.com/javascript/latest/sample-code/layers-imagery-popup/) * for an example of how [PopupTemplate](https://developers.arcgis.com/javascript/latest/references/core/PopupTemplate/) interacts with an * [WCSLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/WCSLayer/). * * A default popup template is automatically used if no `popupTemplate` has been defined when * [Popup.defaultPopupTemplateEnabled](https://developers.arcgis.com/javascript/latest/references/core/widgets/Popup/#defaultPopupTemplateEnabled) * is set to `true`. * * @see [createPopupTemplate()](https://developers.arcgis.com/javascript/latest/references/core/layers/WCSLayer/#createPopupTemplate) * @see [SceneView.popup](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#popup) * @see [View2D.popup](https://developers.arcgis.com/javascript/latest/references/core/views/View2D/#popup) */ get popupTemplate(): PopupTemplate | null | undefined; set popupTemplate(value: PopupTemplateProperties | null | undefined); /** An array of raster fields in the layer that consists of service pixel value. */ get rasterFields(): Field[]; /** * The renderer assigned to the layer. The renderer defines how to visualize pixels in the WCSLayer. * Depending on the renderer type, the pixels may be [stretched](https://developers.arcgis.com/javascript/latest/references/core/renderers/RasterStretchRenderer/) * across the color ramp or [classified](https://developers.arcgis.com/javascript/latest/references/core/renderers/ClassBreaksRenderer/). * * @see [Sample - Intro to WCSLayer](https://developers.arcgis.com/javascript/latest/sample-code/layers-wcslayer/) * @see [Sample - Intro to ImageryTileLayer](https://developers.arcgis.com/javascript/latest/sample-code/layers-imagerytilelayer/) * @see [Sample - Intro to ImageryTileLayer](https://developers.arcgis.com/javascript/latest/sample-code/layers-imagerytilelayer/) * @see [Sample - ImageryTileLayer - shaded relief renderer](https://developers.arcgis.com/javascript/latest/sample-code/layers-imagery-renderer/) * @see [Sample - Transposed multidimensional ImageryTileLayer](https://developers.arcgis.com/javascript/latest/sample-code/layers-hosted-imagerytilelayer/) */ get renderer(): RasterRendererUnion | null | undefined; set renderer(value: (ClassBreaksRendererProperties & { type: "class-breaks"; }) | (UniqueValueRendererProperties & { type: "unique-value"; }) | (RasterStretchRendererProperties & { type: "raster-stretch"; }) | (RasterShadedReliefRendererProperties & { type: "raster-shaded-relief"; }) | (RasterColormapRendererProperties & { type: "raster-colormap"; }) | (VectorFieldRendererProperties & { type: "vector-field"; }) | (FlowRendererProperties & { type: "flow"; }) | null | undefined); /** The layer type provides a convenient way to check the type of the layer without the need to import specific layer modules. */ get type(): "wcs"; /** The URL of the WCS service endpoint of the layer. */ url: string; /** * The version of [Web Coverage Service](https://www.ogc.org/standards/wcs) used. * The supported versions are: 1.0.0, 1.1.0, 1.1.1, 1.1.2 and 2.0.1 */ accessor version: WCSVersion; /** * Creates a default popup template for the layer, populated with all the fields of the layer. * * @param options - Options for creating the popup template. * @returns The popup template, or `null` if the layer does not * have any fields. */ createPopupTemplate(options?: CreatePopupTemplateOptions): PopupTemplate | null | undefined; /** * Saves the layer to its existing portal item in the [Portal](https://developers.arcgis.com/javascript/latest/references/core/portal/Portal/) * authenticated within the user's current session. If the layer is not saved to a * [PortalItem](https://developers.arcgis.com/javascript/latest/references/core/portal/PortalItem/), then you should use [saveAs()](https://developers.arcgis.com/javascript/latest/references/core/layers/WCSLayer/#saveAs). * * @param options - Various options for saving the layer. * @returns When resolved, returns the portal item to which the layer is saved. * @since 4.32 * @example const portalItem = await layer.save(); */ save(options?: LayerSaveOptions): Promise<PortalItem>; /** * Saves the layer to a new portal item in the [Portal](https://developers.arcgis.com/javascript/latest/references/core/portal/Portal/) authenticated within the user's current session. * * @param portalItem - The portal item to which the layer will be saved. * @param options - Various options for saving the layer. * @returns When resolved, returns the portal item to which the layer is saved. * @since 4.32 * @example * const portalItem = new PortalItem(); * await layer.saveAs(portalItem); */ saveAs(portalItem: PortalItemProperties, options?: LayerSaveAsOptions): Promise<PortalItem>; } declare const WCSLayerSuperclass: typeof Layer & typeof ClonableMixin & typeof MultiOriginJSONSupportMixin & typeof RefreshableLayer & typeof TemporalLayer & typeof TiledImagery & typeof CustomParametersMixin & typeof PortalLayer & typeof OperationalLayer & typeof ScaleRangeLayer & typeof BlendLayer