Thank you for the information Dominique. I'm still using 2.3 at this time - we're just starting to install & test 10.1 but may move the API to v3.0 to get this working. In the meantime, it looks like I can hit www.arcgis.com/sharing/content/items/<Item ID>/data?f=json to grab what I need and update the legend control.Thanks again,Terryedit - here's the code to implement my idea above
webMap = new Document();
webMap.GetMapCompleted += (s, a) =>
{
if (a.Error == null)
{
MyMap.Extent = a.Map.Extent;
WebClient web = new WebClient();
web.OpenReadCompleted += (send, arg) =>
{
JsonObject jsObj = (JsonObject)JsonObject.Load(arg.Result);
if (jsObj.ContainsKey("error"))
{
return;
}
if (jsObj.ContainsKey("operationalLayers"))
{
JsonArray layers = (JsonArray)jsObj["operationalLayers"];
foreach (JsonObject jOb in layers)
{
if (jOb.ContainsKey("itemId"))
{
try
{
MyMap.Layers[jOb["itemId"]].ID = jOb["title"];
}
catch { }
}
else if (jOb.ContainsKey("id"))
{
try
{
MyMap.Layers[jOb["id"]].ID = jOb["title"];
}
catch { }
}
}
}
if (jsObj.ContainsKey("baseMap"))
{
JsonObject jOb = (JsonObject)jsObj["baseMap"];
if (jOb.ContainsKey("baseMapLayers"))
{
try
{
MyMap.Layers[jOb["baseMapLayers"][0]["id"]].ID = jOb["title"];
}
catch { }
}
}
};
web.OpenReadAsync(new Uri("http://www.arcgis.com/sharing/content/items/" + mapservice.MapServiceName + "/data?f=json"));
LayerCollection layerCollection = new LayerCollection();
foreach (Layer lyr in a.Map.Layers)
{
layerCollection.Add(lyr);
lyr.InitializationFailed += Layer_InitializationFailed;
}
a.Map.Layers.Clear();
MyMap.Layers = layerCollection;