<?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 Problem with printing map with template in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/problem-with-printing-map-with-template/m-p/756745#M58380</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to print a map but the legend doesn't get filled.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The JSON is as follows and the layers come from a service that's deployed on AGS on an internal machine:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;Web_Map_as_JSON = &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-family: Consolas; font-size: small;"&gt;u'{"mapOptions":{"showAttribution":true,"extent":{"xmin":-1001750.3648022738,"ymin":4665102.550281047,"xmax":-972398.5459408056,"ymax":4671274.840315067,"spatialReference":{"wkid":102100}},"spatialReference":{"wkid":102100},"scale":72223.819286},"operationalLayers":[{"id":"defaultBasemap_0","title":"World_Topo_Map","opacity":1,"minScale":0,"maxScale":0,"url":"https://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"},{"id":"PDMPalmela_7277","title":"PDMPalmela","opacity":1,"minScale":0,"maxScale":0,"url":"https://t105vm01.esri-portugal.pt/arcgis/rest/services/PDMPalmela/MapServer","layers":[{"id":2,"layerDefinition":{"source":{"type":"mapLayer","mapLayerId":2}}},{"id":3,"layerDefinition":{"source":{"type":"mapLayer","mapLayerId":3}}},{"id":4,"layerDefinition":{"source":{"type":"mapLayer","mapLayerId":4}}},{"id":5,"layerDefinition":{"source":{"type":"mapLayer","mapLayerId":5}}},{"id":6,"layerDefinition":{"source":{"type":"mapLayer","mapLayerId":6}}},{"id":7,"layerDefinition":{"source":{"type":"mapLayer","mapLayerId":7}}},{"id":8,"layerDefinition":{"source":{"type":"mapLayer","mapLayerId":8}}}]},{"id":"desenhos","opacity":1,"minScale":0,"maxScale":0,"featureCollection":{"layers":[{"layerDefinition":{"name":"pointLayer","geometryType":"esriGeometryPoint"},"featureSet":{"geometryType":"esriGeometryPoint","features":[{"geometry":{"x":-992367.7195802811,"y":4668270.865088885,"spatialReference":{"wkid":102100}},"symbol":{"color":[255,0,0,64],"size":3.75,"angle":0,"xoffset":0,"yoffset":0,"type":"esriSMS","style":"esriSMSCircle","outline":{"color":[255,0,0,255],"width":1.5,"type":"esriSLS","style":"esriSLSSolid"}}}]}}]}}],"exportOptions":{"outputSize":[null,null],"dpi":"300"}}'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm running the Python in ArcGis Pro and the layout (pagx) already has some data from AGSOnline and this is what I get &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;IMG alt="Legendless" class="image-1 jive-image" height="689" src="https://community.esri.com/legacyfs/online/447762_Legendless.png" width="561" /&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;when I export to PDF&lt;/SPAN&gt;. The legend doesn't reflect the symbology present on the exported map. It should be :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;IMG alt="Legend" class="image-2 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/447763_legend.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Now I only achieved this through adding the layer to the map (which doesn't make any sense since it was already on the map):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: small;"&gt;for&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; lyr &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: small;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; m.listLayers():&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas; "&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas; "&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas; "&gt; lyr.isWebLayer:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas; "&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas; "&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas; "&gt; lyr.supports(&lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: small; font-family: Consolas; "&gt;"LONGNAME"&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas; "&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas; "&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas; "&gt; lyr.supports(&lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: small; font-family: Consolas; "&gt;"NAME"&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas; "&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas; "&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas; "&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas; "&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas; "&gt;not&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas; "&gt; lyr.isFeatureLayer:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas; "&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas; "&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas; "&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas; "&gt;not&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas; "&gt; lyr.isBasemapLayer:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;m.addLayer(lyr)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;That code produces the 2nd PDF but obviously when I save it as an &lt;/SPAN&gt;aprx I have duplicated layers. What's weird is inside ArcGis Pro if I drag the layer to the legend it adds it just fine so I reckon it can't be because of faulty data or lack of legend.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;My question is , can this be a bug? Or am I approaching this the wrong way? Is it because it's a Web Layer?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I appreciate all the help I can get.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks in advance&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 May 2019 09:31:07 GMT</pubDate>
    <dc:creator>RicardoRodrigues1</dc:creator>
    <dc:date>2019-05-16T09:31:07Z</dc:date>
    <item>
      <title>Problem with printing map with template</title>
      <link>https://community.esri.com/t5/python-questions/problem-with-printing-map-with-template/m-p/756745#M58380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to print a map but the legend doesn't get filled.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The JSON is as follows and the layers come from a service that's deployed on AGS on an internal machine:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;Web_Map_as_JSON = &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-family: Consolas; font-size: small;"&gt;u'{"mapOptions":{"showAttribution":true,"extent":{"xmin":-1001750.3648022738,"ymin":4665102.550281047,"xmax":-972398.5459408056,"ymax":4671274.840315067,"spatialReference":{"wkid":102100}},"spatialReference":{"wkid":102100},"scale":72223.819286},"operationalLayers":[{"id":"defaultBasemap_0","title":"World_Topo_Map","opacity":1,"minScale":0,"maxScale":0,"url":"https://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"},{"id":"PDMPalmela_7277","title":"PDMPalmela","opacity":1,"minScale":0,"maxScale":0,"url":"https://t105vm01.esri-portugal.pt/arcgis/rest/services/PDMPalmela/MapServer","layers":[{"id":2,"layerDefinition":{"source":{"type":"mapLayer","mapLayerId":2}}},{"id":3,"layerDefinition":{"source":{"type":"mapLayer","mapLayerId":3}}},{"id":4,"layerDefinition":{"source":{"type":"mapLayer","mapLayerId":4}}},{"id":5,"layerDefinition":{"source":{"type":"mapLayer","mapLayerId":5}}},{"id":6,"layerDefinition":{"source":{"type":"mapLayer","mapLayerId":6}}},{"id":7,"layerDefinition":{"source":{"type":"mapLayer","mapLayerId":7}}},{"id":8,"layerDefinition":{"source":{"type":"mapLayer","mapLayerId":8}}}]},{"id":"desenhos","opacity":1,"minScale":0,"maxScale":0,"featureCollection":{"layers":[{"layerDefinition":{"name":"pointLayer","geometryType":"esriGeometryPoint"},"featureSet":{"geometryType":"esriGeometryPoint","features":[{"geometry":{"x":-992367.7195802811,"y":4668270.865088885,"spatialReference":{"wkid":102100}},"symbol":{"color":[255,0,0,64],"size":3.75,"angle":0,"xoffset":0,"yoffset":0,"type":"esriSMS","style":"esriSMSCircle","outline":{"color":[255,0,0,255],"width":1.5,"type":"esriSLS","style":"esriSLSSolid"}}}]}}]}}],"exportOptions":{"outputSize":[null,null],"dpi":"300"}}'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm running the Python in ArcGis Pro and the layout (pagx) already has some data from AGSOnline and this is what I get &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;IMG alt="Legendless" class="image-1 jive-image" height="689" src="https://community.esri.com/legacyfs/online/447762_Legendless.png" width="561" /&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;when I export to PDF&lt;/SPAN&gt;. The legend doesn't reflect the symbology present on the exported map. It should be :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;IMG alt="Legend" class="image-2 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/447763_legend.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Now I only achieved this through adding the layer to the map (which doesn't make any sense since it was already on the map):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: small;"&gt;for&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; lyr &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: small;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; m.listLayers():&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas; "&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas; "&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas; "&gt; lyr.isWebLayer:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas; "&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas; "&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas; "&gt; lyr.supports(&lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: small; font-family: Consolas; "&gt;"LONGNAME"&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas; "&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas; "&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas; "&gt; lyr.supports(&lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: small; font-family: Consolas; "&gt;"NAME"&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas; "&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas; "&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas; "&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas; "&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas; "&gt;not&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas; "&gt; lyr.isFeatureLayer:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas; "&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas; "&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas; "&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas; "&gt;not&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas; "&gt; lyr.isBasemapLayer:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;m.addLayer(lyr)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;That code produces the 2nd PDF but obviously when I save it as an &lt;/SPAN&gt;aprx I have duplicated layers. What's weird is inside ArcGis Pro if I drag the layer to the legend it adds it just fine so I reckon it can't be because of faulty data or lack of legend.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;My question is , can this be a bug? Or am I approaching this the wrong way? Is it because it's a Web Layer?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I appreciate all the help I can get.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks in advance&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 May 2019 09:31:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-with-printing-map-with-template/m-p/756745#M58380</guid>
      <dc:creator>RicardoRodrigues1</dc:creator>
      <dc:date>2019-05-16T09:31:07Z</dc:date>
    </item>
  </channel>
</rss>

