How to print raster layer with client-side pixel filtering? v3.x

199
0
05-25-2022 04:21 AM
MattiasEkström
Occasional Contributor III

I have a custom widget in WAB that lets the user display filtered elevation data from an image service. It uses client-side pixel filtering as this sample does.
https://developers.arcgis.com/javascript/3/jssamples/layers_raster.html

My users complains that they can't print the filtered elevation data, we're using our own print service with custom layouts. So the client-side pixel filtering info is not sent to the print service and the print includes the entire rasterdata displayed as how the image service was published.

If I add the image service to the map viewer in portal I can change the "symbology" of the raster to use some classification. And then print (with the same printservice as in WAB) and the classified raster displays correctly in the print.

So I'm thinking I should be able to "convert" the pixel-filtering to a classification with just two classes where one is transparent/invisible. But I haven't been able to set a renderer to my raster layer in my code.

There seems to be a .setRenderer()-function on the layer, but in the API reference it's only documented for featureLayers and not for RasterLayers. Any ideas how I can solve this?

0 Kudos
0 Replies