Just curious if there is an "out of the box" way to get the web map as JSON from the current AGOL webmap from within a custom widget? Unfortunately, due to client specifications I cannot conform to the Export Web Map Task parameters for the GP Service I'll be using.
var printTask = new PrintTask()
var Web_Map_as_JSON = printTask._getPrintDefinition(this.map))
However, when I try that from a custom widget passing in the AGOL web map, I get the following error:
Another thing I found that will give me the web map is to use the ArcGIS Utils:
That does give me the web map as JSON, but obviously it is not the current state (i.e. doesn't show which layers are on/off in the current map). Is there an "easy" way or do I have to manually build it?