AnsweredAssumed Answered

Remove graphics from legend but keep them in the printed map in ArcGIS JavaScript 4.x

Question asked by danwebb on Nov 20, 2018
Latest reply on Nov 20, 2018 by rscheitlin

I’m currently using ArcGIS JavaScript API 4.5 but hope to move to 4.9 soon.  Either way, the issue is the same even on my test 4.9 app.

 

I want graphics, such as draw, to show in the printed map but not in the legend.  The JS 3.x API would do this but 4.x makes a legend item which says “polygonLayer” and the graphic called “Override 1”. This makes the printed map look silly. (see attached image)

 

I followed advice found here and intercepted the Print request and removed my graphics layers from the operationalLayers in the Web_Map_as_JSON.  However, this also removes the graphics from the map.

 

 So in 4.x, is there a way to keep graphics in the map but remove them from the legend?

 

Thanks!

Attachments

Outcomes