[updated 2020-09-06: added some CodePen examples with what I've tried]
I have a use case for an app where I would like to enable users to filter pixels based on value from an
ImageryTileLayer (formerly TileImageryLayer) in a map by adjusting a UI widget. Looking through the API however I cannot see any way to do this. Is there a recommended approach for a situation like this?
If I switched to a regular ImageryLayer I believe I could accomplish this via a
PixelFilter (although I haven't implemented yet).
Update:
Here is a
CodePen example showing how I've created a dynamically rendered raster layer clientside with a
RasterStretchRenderer. Unfortunately, from what I've read the RasterStretchRenderer does not seem to support filtering of values (this is consistent with other platforms like Desktop). Not sure why this is.
Here is a s
econd CodePen example showing an approach where I tried using a ClassBreaksRenderer, creating my own breaks to mimic a stretchRenderer and then enabling filtering by setting specific breaks to be transparent. It accomplishes what I am after although the performance when a user adjusts the color scheme is much worse. It could be something with my code-- note that I run functions to dynamically recalculate colors and stops-- but looking at tests these seem to be running under 2-3ms.
@ESRIIs there a better way of doing this? An ESRI support person indicated that perhaps the RasterStretchRenderer has some optimization for dynamic display but the API documentation only says,
The RasterStretchRenderer works well when you have a large range of values to display, such as in imagery, aerial photographs, or elevation models.
I'm wondering why dynamically adjusting a ClassBreaksRenderer would be so much worse.
Any advice, guidance, is welcome.