I am a developer of GIS Web components, and I would greatly appreciate it if the logic that converts a MapView into a WebMap_as_JSON could be exposed in a public method. We run a custom printing service that uses the Export Web Map Task geoprocessor with extra parameters to enable the printing use cases of my Organisation.
Both the PrintViewModel.print() and the print.execute() combine building the payload and sending the request. Exposing the logic that generates the WebMap_as_JSON as a seperate method would benefit our workflow for two reasons.
You can call .toJSON() on the map.
<body>
<arcgis-map item-id="05e015c5f0314db9a487a9b46cb37eca">
<arcgis-zoom slot="top-left"></arcgis-zoom>
<arcgis-legend slot="bottom-right"></arcgis-legend>
</arcgis-map>
<script>
document.querySelector('arcgis-map').addEventListener('arcgisViewReadyChange', (event) => {
const webmapJson = event.target.map.toJSON();
console.log(webmapJson)
})
</script>
</body>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.