Is there a way to retrieve a JSON representation of a WebMap object from a JavaScript Map object in the ArcGIS JavaScript API without relying on ArcGIS.com? It would be ideal if there was a method similar to:
webMapAsJSON = map.toWebMap();
The "Export Web Map Task" documentation in the REST API suggests that it should be possible, as it states:
"The ArcGIS web APIs (for JavaScript, Flex, Silverlight, etc.) allow developers to easily get this JSON string from the map."
Despite this statement, I haven't been able to find any built-in functionality within the Map object or elsewhere in the API that facilitates this task.