<?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 Get drawing info (symbology/renderer) of a WebMap layer and apply it to a hosted feature layer view layer in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/get-drawing-info-symbology-renderer-of-a-webmap/m-p/1410901#M9893</link>
    <description>&lt;P&gt;In ArcGIS Online:&lt;/P&gt;&lt;P&gt;I have a WebMap with layers, that consumes directly from a hosted feature layer. I also have a hosted feature layer&amp;nbsp;view&amp;nbsp;that consumes directly from the same hosted feature layer. There is a corresponding layer between the hosted feature layer view and the WebMap.&lt;/P&gt;&lt;P&gt;I would like to take the symbology from the layer in the WebMap and apply it to the layer in the hosted feature layer view. I need to do this about a thousand times.&lt;/P&gt;&lt;P&gt;My code looks pretty simple, it returns a success, the hosted feature layer view indicates that is has been updated. However, there is no visible change to the rendering of the layer in the hosted feature view.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;webmap_item = gis.content.get('UggaBuggaUggaBuggaUggaBugga') #  WebMap 
webmap = WebMap(webmap_item)
source_hfl_sublayer = webmap.layers[2].layers[39] # SOURCE webmap layer

target_hflv = gis.content.get('ChunkyMonkeyChunkyMonkey') #  Hosted Feature Layer View

target_hflv_sublayer = target_hflv.layers[2] # TARGET hosted feature layer view

the_layer_definition = source_hfl_sublayer.layerDefinition
source_drawingInfo = the_layer_definition['drawingInfo'] # dict instead of a PropertyMap get accepted by update_definition
result = target_hflv_sublayer.manager.update_definition({'drawingInfo':source_drawingInfo})&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For reference,&lt;A href="https://community.esri.com/t5/arcgis-api-for-python-questions/use-python-api-to-get-drawing-info-symbology/m-p/1070718" target="_self"&gt; this post&lt;/A&gt; is close, but does not use a webmap as a source.&lt;/P&gt;&lt;P&gt;My question is: how to I get there from here?&lt;/P&gt;&lt;P&gt;TIA as always.&lt;/P&gt;</description>
    <pubDate>Wed, 17 Apr 2024 13:44:02 GMT</pubDate>
    <dc:creator>Dirk_Vandervoort</dc:creator>
    <dc:date>2024-04-17T13:44:02Z</dc:date>
    <item>
      <title>Get drawing info (symbology/renderer) of a WebMap layer and apply it to a hosted feature layer view layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/get-drawing-info-symbology-renderer-of-a-webmap/m-p/1410901#M9893</link>
      <description>&lt;P&gt;In ArcGIS Online:&lt;/P&gt;&lt;P&gt;I have a WebMap with layers, that consumes directly from a hosted feature layer. I also have a hosted feature layer&amp;nbsp;view&amp;nbsp;that consumes directly from the same hosted feature layer. There is a corresponding layer between the hosted feature layer view and the WebMap.&lt;/P&gt;&lt;P&gt;I would like to take the symbology from the layer in the WebMap and apply it to the layer in the hosted feature layer view. I need to do this about a thousand times.&lt;/P&gt;&lt;P&gt;My code looks pretty simple, it returns a success, the hosted feature layer view indicates that is has been updated. However, there is no visible change to the rendering of the layer in the hosted feature view.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;webmap_item = gis.content.get('UggaBuggaUggaBuggaUggaBugga') #  WebMap 
webmap = WebMap(webmap_item)
source_hfl_sublayer = webmap.layers[2].layers[39] # SOURCE webmap layer

target_hflv = gis.content.get('ChunkyMonkeyChunkyMonkey') #  Hosted Feature Layer View

target_hflv_sublayer = target_hflv.layers[2] # TARGET hosted feature layer view

the_layer_definition = source_hfl_sublayer.layerDefinition
source_drawingInfo = the_layer_definition['drawingInfo'] # dict instead of a PropertyMap get accepted by update_definition
result = target_hflv_sublayer.manager.update_definition({'drawingInfo':source_drawingInfo})&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For reference,&lt;A href="https://community.esri.com/t5/arcgis-api-for-python-questions/use-python-api-to-get-drawing-info-symbology/m-p/1070718" target="_self"&gt; this post&lt;/A&gt; is close, but does not use a webmap as a source.&lt;/P&gt;&lt;P&gt;My question is: how to I get there from here?&lt;/P&gt;&lt;P&gt;TIA as always.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2024 13:44:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/get-drawing-info-symbology-renderer-of-a-webmap/m-p/1410901#M9893</guid>
      <dc:creator>Dirk_Vandervoort</dc:creator>
      <dc:date>2024-04-17T13:44:02Z</dc:date>
    </item>
    <item>
      <title>Re: Get drawing info (symbology/renderer) of a WebMap layer and apply it to a hosted feature layer view layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/get-drawing-info-symbology-renderer-of-a-webmap/m-p/1411002#M9894</link>
      <description>&lt;P&gt;Hello, I believe this could be fixed using a similar solution to this &lt;A href="https://community.esri.com/t5/arcgis-api-for-python-questions/popup-and-filter-information-not-showing-on-python/m-p/1408570#M9873" target="_self"&gt;question&lt;/A&gt;. Here is a pared down version of a&amp;nbsp; similar process that worked for me:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;layer_data=ucip_locs.get_data()
drawingInfo = layer_data["layers"][0]["layerDefinition"]["drawingInfo"]

view_search = my_agol.content.search(view_name)[0]
view_layer = view_search.get_data()
view_layer["layers"][0]["layerDefinition"]["drawingInfo"]=drawingInfo

update_dict = {}
update_dict = {"text":json.dumps(view_layer)}
view_search.update(update_dict)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2024 15:36:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/get-drawing-info-symbology-renderer-of-a-webmap/m-p/1411002#M9894</guid>
      <dc:creator>GIS_utahDEM</dc:creator>
      <dc:date>2024-04-17T15:36:12Z</dc:date>
    </item>
  </channel>
</rss>

