Add warning message on print widget

274
2
02-28-2022 11:12 AM
Labels (1)
RaoSona
New Contributor II

Hi, I would like to only control the scale at which request is sent to the printing service via the print widget,

hence would like to add a message on the print widget if scale is say > 1000000. On map change (pan or zoom), I'd like to clear the message. 

Any ideas?

0 Kudos
2 Replies
XuanKuai
New Contributor III

Try first get the current map's scale with getScale() method when the widget is fired, and if it's beyond the limit display the warning text. To listen to map change you can try on("extent-change") then remove the text. To add or clear message I usually create a blank div with either an id or a data-dojo-attach-point and change the div's innerHTML in Widget.js. Hope this can help you!

0 Kudos
Ravravv
New Contributor

Thanks for the reply.

I have got the map scale. I think I need to change the div in print.js I have tried to do so in various functions within print.js, but doesn't seem to work.

 

0 Kudos