Select to view content in your preferred language

How do not print hidden graphic?

862
2
07-26-2012 04:58 AM
MilanSchmidt
Emerging Contributor
Hi,

I would like to ask about printing. I am using
JavaScript API ver. 3.0, ArcGis server 10.1

I am trying to print just basemap with visible graphics. I have added point to graphic and I have made the point hidden. But, printed image contains this hidden graphic too.

I modified sample from ESRI web page,
just added one button with simple function to hide first added graphic.

<div data-dojo-type="dijit.form.Button" data-dojo-props="label:'Test3',  onClick:function(){test3();}">
</div>


function test3() {
app.map.graphics.graphics[0].hide();
}


Simulation of problem:
1. Run http://globus.sazp.sk/test02/print.htm
2. Add one point
3. Press button "Hide my graphic"
4. Pres button "Print"
Printed image contains point even though it is hidden.



Where I am wrong?

Thank you

Milan Schmidt
0 Kudos
2 Replies
JianHuang
Deactivated User
We will fix this. At this moment, please use graphicsLayer.remove(graphic) to remove the graphic so that it won't be printed out.
0 Kudos
MilanSchmidt
Emerging Contributor
Hi Jian,
thank you for your answer.

For this occasion I a little bit modified file
arcgis_js_api\\library\\3.0\\jsapi\\js\\esri\\tasks\\PrintTask.js.uncompressed.js
and I am using this one.

I just added one "if" code

if (gLayer.graphics[idx].visible) {
}

into method _createFeatureCollection

I will happily use original library file after fixing this problem.

Thank you
Milan Schmidt
0 Kudos