<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Capturing a Map Image in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/capturing-a-map-image/m-p/1564191#M10921</link>
    <description>&lt;P&gt;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 &lt;A href="https://www.esri.com/arcgis-blog/products/api-python/announcements/whats-new-in-arcgis-api-for-python-2-4-0-blog/" target="_self"&gt;this&lt;/A&gt; 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?&lt;/P&gt;&lt;P&gt;Edit: This doesn't have to be done within dashboards, I can use experience builder as well.&lt;/P&gt;&lt;P&gt;When I run the following bit of code I end up with this error:&lt;/P&gt;&lt;P&gt;"&lt;STRONG&gt;ImportError: cannot import name 'WebMap' from 'arcgis.mapping'&lt;/STRONG&gt;"&lt;/P&gt;&lt;LI-CODE lang="python"&gt;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) &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 03 Dec 2024 18:19:34 GMT</pubDate>
    <dc:creator>jchadwich1</dc:creator>
    <dc:date>2024-12-03T18:19:34Z</dc:date>
    <item>
      <title>Capturing a Map Image</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/capturing-a-map-image/m-p/1564191#M10921</link>
      <description>&lt;P&gt;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 &lt;A href="https://www.esri.com/arcgis-blog/products/api-python/announcements/whats-new-in-arcgis-api-for-python-2-4-0-blog/" target="_self"&gt;this&lt;/A&gt; 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?&lt;/P&gt;&lt;P&gt;Edit: This doesn't have to be done within dashboards, I can use experience builder as well.&lt;/P&gt;&lt;P&gt;When I run the following bit of code I end up with this error:&lt;/P&gt;&lt;P&gt;"&lt;STRONG&gt;ImportError: cannot import name 'WebMap' from 'arcgis.mapping'&lt;/STRONG&gt;"&lt;/P&gt;&lt;LI-CODE lang="python"&gt;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) &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2024 18:19:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/capturing-a-map-image/m-p/1564191#M10921</guid>
      <dc:creator>jchadwich1</dc:creator>
      <dc:date>2024-12-03T18:19:34Z</dc:date>
    </item>
    <item>
      <title>Re: Capturing a Map Image</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/capturing-a-map-image/m-p/1571905#M10993</link>
      <description>&lt;P&gt;It's deprecated in 2.4.&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;WebMap&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;- removed in&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;2.4.0&lt;/STRONG&gt;. Use&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;arcgis.map.Map&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;instead.&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/arcgis-python-api/blob/master/guide/02-api-overview/deprecation-notices.ipynb" target="_blank"&gt;https://github.com/Esri/arcgis-python-api/blob/master/guide/02-api-overview/deprecation-notices.ipynb&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Dec 2024 18:55:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/capturing-a-map-image/m-p/1571905#M10993</guid>
      <dc:creator>Jen_Zumbado-Hannibal</dc:creator>
      <dc:date>2024-12-31T18:55:14Z</dc:date>
    </item>
  </channel>
</rss>

