This sample shows how to add an instance of WCSLayer to a Map in a MapView. The WCSLayer contains global sea temperature data.
The RasterStretchRenderer is applied to the layer to change the data visualization. The multidimensionalDefinition property is also set on the layer to request a specific slice.
// raster stretch renderer with 3 standard-deviations
// and with a multipart color ramps
const renderer = {
type: "raster-stretch",
stretchType: "standard-deviation",
statistics: [[-3, 37, 1, 1]],
numberOfStandardDeviations: 3,
colorRamp: {
type: "multipart",
colorRamps: [
{
fromColor: [0, 0, 255],
toColor: [0, 255, 255]
},
{
fromColor: [0, 255, 255],
toColor: [255, 255, 0]
},
{
fromColor: [255, 255, 0],
toColor: [255, 0, 0]
}
]
}
// multi dimension definition for the layer
const multidimensionalDefinition = [
{
variableName: "water_temp",
dimensionName: "StdTime",
values: [1396828800000] // Monday, April 7, 2014 12:00:00 AM GTM
},
{
variableName: "water_temp", // water temp at sea level
dimensionName: "StdZ",
values: [0]
}
];
// WCSLayer from ArcGIS Server
layer = new WCSLayer({
url:
"https://sampleserver6.arcgisonline.com/arcgis/services/ScientificData/SeaTemperature/ImageServer/WCSServer",
renderer: renderer,
multidimensionalDefinition: multidimensionalDefinition,
version: "2.0.1",
opacity: 0.5,
});