<?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 Re: Map Screenshot with ArcGIS API for Python in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/map-screenshot-with-arcgis-api-for-python/m-p/1031156#M5612</link>
    <description>&lt;P&gt;Hi Yulia,&lt;/P&gt;&lt;P&gt;What happens if you take the same web_map_as_JSON parameter and pass it into the default ArcGIS Online print service operation?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task" target="_blank" rel="noopener"&gt;https://utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Do all the layers appear as expected?&lt;/P&gt;&lt;P&gt;-Calvin&lt;/P&gt;</description>
    <pubDate>Fri, 26 Feb 2021 21:25:01 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2021-02-26T21:25:01Z</dc:date>
    <item>
      <title>Map Screenshot with ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/map-screenshot-with-arcgis-api-for-python/m-p/1030986#M5610</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I am trying to create a script that would take a screenshot of the specific map area which would include the basemap and all the layers on the map.&lt;/P&gt;&lt;P&gt;The code below zooms in to the targeted area of the map and generates a screenshot. The problem is the screenshot only displays imagery layers, while vector layers are not showing up on the map. Any ideas why it's happening?&lt;/P&gt;&lt;P&gt;My code so far:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;from arcgis.gis import GIS&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;from arcgis.mapping import export_map&lt;/STRONG&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;STRONG&gt;gis = GIS('https://######.maps.arcgis.com/',&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;username='####',&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;password='####',&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;verify_cert=False)&lt;/STRONG&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;STRONG&gt;webmap_item = gis.content.get('######')&lt;/STRONG&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;STRONG&gt;webmap_json = webmap_item.get_data()&lt;/STRONG&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;# Get coordinates of the targeted feature on the map&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;id_target = gis.content.get('######')&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;id_layer = id_target.layers[1]&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;id_features = id_featureset.features&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;test_feature = id_features[0]&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;coordinates = test_feature.geometry['rings'][0]&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;xmin, xmax = coordinates[1][0], coordinates[2][0]&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;ymin, ymax = coordinates[1][1], coordinates[2][1]&lt;/STRONG&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV&gt;# Modify json with map options and export options&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;webmap_json['mapOptions'] = {&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;"extent" : {&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;"xmin": xmin,&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;"ymin": ymin,&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;"xmax": xmax,&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;"ymax": ymax,&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;"spatialReference": {&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;"wkid": 4326&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;},&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;"spatialReference" : {&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;"wkid" : 4326&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;webmap_json['exportOptions'] = { "dpi" : 96,&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;"outputSize" : [1000, 1000]&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;STRONG&gt;out = export_map(web_map_as_json=webmap_json, format='PNG8', layout_template='MAP_ONLY', gis=gis)&lt;/STRONG&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;STRONG&gt;print(out)&lt;/STRONG&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 26 Feb 2021 14:47:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/map-screenshot-with-arcgis-api-for-python/m-p/1030986#M5610</guid>
      <dc:creator>YuliaMamonova</dc:creator>
      <dc:date>2021-02-26T14:47:44Z</dc:date>
    </item>
    <item>
      <title>Re: Map Screenshot with ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/map-screenshot-with-arcgis-api-for-python/m-p/1031156#M5612</link>
      <description>&lt;P&gt;Hi Yulia,&lt;/P&gt;&lt;P&gt;What happens if you take the same web_map_as_JSON parameter and pass it into the default ArcGIS Online print service operation?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task" target="_blank" rel="noopener"&gt;https://utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Do all the layers appear as expected?&lt;/P&gt;&lt;P&gt;-Calvin&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2021 21:25:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/map-screenshot-with-arcgis-api-for-python/m-p/1031156#M5612</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-02-26T21:25:01Z</dc:date>
    </item>
  </channel>
</rss>

