I'm working on a custom geoprocessing tool using the ArcGIS API for Python that I plan to use in an ArcGIS dashboard on ArcGIS Online - Enterprise version 11.1. My goal is for the user to select a point location from a drop-down list and generate a PDF report from a template I have stored online. The report will include various bits of data from the entry they've selected and a map image. I've managed to access the data and pull what I need from it, but I can't seem to capture an image of the map. Everything I see online points me to using the arcgis.mapping module, but it looks like that one and the .widget module were refactored into the .map module earlier this year according to this page. However, I can't figure out how to capture and export an image using the .map module or any other tools within the ArcGIS API. Does anyone know how this can be done?
Edit: This doesn't have to be done within dashboards, I can use experience builder as well.
When I run the following bit of code I end up with this error:
"ImportError: cannot import name 'WebMap' from 'arcgis.mapping'"
from arcgis.gis import GIS
from arcgis.mapping import WebMap
gis = GIS("https://www.arcgis.com/home/")
web_map_item = gis.content.get("webmap-id")
web_map = WebMap(web_map_item)
image = web_map.export_to_image("png", resolution=300)
It's deprecated in 2.4.