I am creating a number of kml layers and adding them async to my map. The problem is, is that I can't figure out how to create their legend info so that they can be displayed on my legend to the map. I want to do something like this, but can't figure out how to get anything to work at all. i know I need to add to the legendinfos of the layer or the map itself, but hit a roadblock.
This append below doesn't work at all, but shows what I am trying to do.
<SPAN class="keyword token">var</SPAN> newKMLLayer <SPAN class="operator token">=</SPAN> ArcGISRuntimeEnvironment<SPAN class="punctuation token">.</SPAN><SPAN class="token function">createObject</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"KmlLayer"</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="punctuation token">{</SPAN>
dataset<SPAN class="punctuation token">:</SPAN> newKMLDataset<SPAN class="punctuation token">,</SPAN>
id<SPAN class="punctuation token">:</SPAN> kmlLayer<SPAN class="punctuation token">,</SPAN>
description<SPAN class="punctuation token">:</SPAN> inName<SPAN class="punctuation token">,</SPAN>
layerId<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"LayerID"</SPAN><SPAN class="punctuation token">,</SPAN>
name<SPAN class="punctuation token">:</SPAN> inName<SPAN class="punctuation token">,</SPAN>
maxScale<SPAN class="punctuation token">:</SPAN> <SPAN class="number token">0</SPAN><SPAN class="punctuation token">,</SPAN>
minScale<SPAN class="punctuation token">:</SPAN> <SPAN class="number token">0</SPAN><SPAN class="punctuation token">,</SPAN>
visible<SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">false</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
newKMLLayer<SPAN class="punctuation token">.</SPAN>legendInfos<SPAN class="punctuation token">.</SPAN><SPAN class="token function">append</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">{</SPAN>
<SPAN class="string token">"layerName"</SPAN><SPAN class="punctuation token">:</SPAN> inName<SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">"symbolURL"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"URL"</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN>
mapViewFieldSelected<SPAN class="punctuation token">.</SPAN>map<SPAN class="punctuation token">.</SPAN>operationalLayers<SPAN class="punctuation token">.</SPAN><SPAN class="token function">append</SPAN><SPAN class="punctuation token">(</SPAN>newKMLLayer<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></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>