<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<title>Intro to WCSLayer | Sample | ArcGIS Maps SDK for JavaScript</title>
<!-- Load the ArcGIS Maps SDK for JavaScript from CDN -->
<script type="module" src="https://js.arcgis.com/5.0/"></script>
<arcgis-map center="-120, 10" zoom="1">
<calcite-loader label="Awaiting the layer to load" type="determinate-value"></calcite-loader>
<arcgis-zoom slot="top-left"></arcgis-zoom>
<arcgis-expand expand-tooltip="Legend" slot="bottom-left">
<arcgis-legend></arcgis-legend>
const [Extent, Map, WCSLayer] = await $arcgis.import([
"@arcgis/core/geometry/Extent.js",
"@arcgis/core/layers/WCSLayer.js",
const viewElement = document.querySelector("arcgis-map");
const loader = document.querySelector("calcite-loader");
// Create, apply, and constrain the map extent.
const initialExtent = new Extent({
spatialReference: { wkid: 3857 },
viewElement.extent = initialExtent;
viewElement.constraints = { geometry: initialExtent, minScale: 50000000 };
// Create raster-stretch renderer using three standard deviations and multipart color ramps.
stretchType: "standard-deviation",
customStatistics: [{ min: -3, max: 37, avg: 1, stddev: 1 }],
numberOfStandardDeviations: 3,
{ fromColor: [0, 0, 255], toColor: [0, 255, 255] },
{ fromColor: [0, 255, 255], toColor: [255, 255, 0] },
{ fromColor: [255, 255, 0], toColor: [255, 0, 0] },
// Create the WCS layer with a renderer and custom parameters.
const layer = new WCSLayer({
url: "https://edcintl.cr.usgs.gov/geoserver/landfire_wcs/conus_2024/wcs",
title: "Fires in the Contiguous United States",
// Define the coordinate reference system for subsetting requests and returned imagery.
SUBSETTINGCRS: "http://www.opengis.net/def/crs/EPSG/0/3857",
OUTPUTCRS: "http://www.opengis.net/def/crs/EPSG/0/3857",
// Create the map and add the WCS layer to it.
const map = new Map({ basemap: "gray-vector", layers: [layer] });
// Update the loader value periodically until the LayerView is ready.
const intervalID = setInterval(
() => (loader.value < 100 ? (loader.value += 10) : clearInterval(intervalID)),
await viewElement.whenLayerView(layer);
loader.value = 100; // Mark the loader as complete when the layer has loaded.