At 4.18, we are no longer able to successfully render our ImageryLayers with a UniqueValueRenderer. Here is the gist of what we used to do successfully at 4.17 and earlier:
// Raster functions
var extractRF = new RasterFunction({
functionName: "ExtractBand",
functionArguments: {
bandIds: [0] // lets say we want 1st band
},
variableName: "Raster"
});
var remapRF = new RasterFunction({
functionName: "Remap",
functionArguments: {
inputRanges: [0, 255], // get all vals
outputValues: [1], //set them all to 1
raster: extractRF,
AllowUnmatched: true
}
});
const newRaster = new ImageryLayer({
url: [my raster url here],
renderingRule: remapRF,
renderer: new UniqueValueRenderer({
type: "unique-value",
uniqueValueInfos: [{
value: 1, // take values of 1 and symbolize them
label: " ",
symbol: {
type: "simple-fill",
color: "black"
}
}]
})
});
But this no longer works at 4.18 and 4.19. Here is a codepen showing the problem.
A warning in the console says:
[esri.layers.mixins.ArcGISImageService] ArcGISImageService Switching to the default renderer. Renderer applied is not valid for this Imagery Layer
But I don't see anything in 4.18 indicating any breaking changes and docs still say UniqueValuesRenderer works fine on ImageryLayers. Anyone know what the fix might be?