So I know you can update the properties of a FeatureLayerCollection by using a dictionary...My question is: how can you update the layer properties? The layers are a list in the properties dictionary, and I can't figure out how to update the name of a layer, for example...
<SPAN class="punctuation token">{</SPAN>
<SPAN class="string token">"layers"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">[</SPAN>
<SPAN class="punctuation token">{</SPAN>
<SPAN class="string token">"id"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">0</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">"name"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"gggg"</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">"parentLayerId"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="operator token">-</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">"defaultVisibility"</SPAN><SPAN class="punctuation token">:</SPAN> true<SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">"subLayerIds"</SPAN><SPAN class="punctuation token">:</SPAN> null<SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">"minScale"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">0</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">"maxScale"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">0</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">"geometryType"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"esriGeometryPoint"</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">]</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>I'm using a dictionary to try and update, but can't figure out the proper syntax to access the layer name and update it...
update_dict <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="string token">"serviceDescription"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'newname'</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">"layers"</SPAN><SPAN class="punctuation token">:</SPAN><SPAN class="punctuation token">[</SPAN>
<SPAN class="punctuation token">{</SPAN>
<SPAN class="string token">"name"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'newname'</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">]</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>