exclude a map layer from the print task

3767
5
Jump to solution
08-28-2015 12:55 PM
SebastianRoberts
Occasional Contributor III

Does anyone know how I can exclude a map layer from a print task?  I have an operational layer on my map, but don't want to include it in the resulting print.    I am passing a PrintParameters object to the print task.  I am assigning the Map object to the printparameters.map property.  I can remove a layer id from Map object, print the map, then add the layer id back to the Map object, but what I would really like to do is just remove the layer from the print.  I don't see how I can do this without cloning the entire Map object, removing the layer, and then assigning the cloned object to printparameters.map.  There must be a better way!

1 Solution

Accepted Solutions
thejuskambi
Occasional Contributor III

You could simply set the visiblity of the layer to false, before passing the map to the print task and on print task complete you can turn the layer back on again. Thats what we do in our application.

View solution in original post

5 Replies
MichaelVolz
Esteemed Contributor

Do you not want the layer to show up on the map or the legend in the print-out?

0 Kudos
SebastianRoberts
Occasional Contributor III

I don't' want the layer to show on the map (and the legend in that case).

0 Kudos
MichaelVolz
Esteemed Contributor

Isn't that confusing to the enduser to see a layer on the electronic map, but not the print-out?

0 Kudos
SebastianRoberts
Occasional Contributor III

No, not in this case.

0 Kudos
thejuskambi
Occasional Contributor III

You could simply set the visiblity of the layer to false, before passing the map to the print task and on print task complete you can turn the layer back on again. Thats what we do in our application.