Hi,
I am trying to add FeatureLayer, ArcGISDynamicMapServiceLayer, and ArcGISTiledMapServiceLayer programmatically through code.
However although the services get added, I am unable to see their IDs.
Attached is a screenshot (IDs not displaying1.jpg).
Is this a bug with ArcGIS API for Sharepoint 2.1.1?
The code I am using used to work perfectly fine with ArcGIS API for Sharepoint 2.0, that is the ID for each service would appear.
Code I am using is below (Note: I am setting the ID property everywhere):-
if (((SecuredServiceList)(lstBox.Items[index])).Tick == true && ((SecuredServiceList)(lstBox.Items[index])).LayerType == "FeatureLayer")
{
FeatureLayer layer = new FeatureLayer()
{
Url = ((SecuredServiceList)(lstBox.Items[index])).Name,
ID = ((SecuredServiceList)(lstBox.Items[index])).ID,
ProxyUrl = proxyurl
};
layer.Where = "1=1";
layer.OutFields.Add("*");
layer.InitializationFailed += layer_InitializationFailed;
MapApplication.Current.Map.Layers.Add(layer);
}
if (((SecuredServiceList)(lstBox.Items[index])).Tick == true && ((SecuredServiceList)(lstBox.Items[index])).LayerType == "RasterLayer" && ((SecuredServiceList)(lstBox.Items[index])).ContainsTileInfo == true)
{
ArcGISTiledMapServiceLayer layer = new ArcGISTiledMapServiceLayer()
{
Url = ((SecuredServiceList)(lstBox.Items[index])).Name,
ID = ((SecuredServiceList)(lstBox.Items[index])).ID,
ProxyURL = proxyurl
};
layer.InitializationFailed += layer_InitializationFailed;
MapApplication.Current.Map.Layers.Add(layer);
}
if (((SecuredServiceList)(lstBox.Items[index])).Tick == true && ((SecuredServiceList)(lstBox.Items[index])).LayerType == "RasterLayer" && ((SecuredServiceList)(lstBox.Items[index])).ContainsTileInfo == false)
{
ArcGISDynamicMapServiceLayer layer = new ArcGISDynamicMapServiceLayer()
{
Url = ((SecuredServiceList)(lstBox.Items[index])).Name,
ID = ((SecuredServiceList)(lstBox.Items[index])).ID,
ProxyURL = proxyurl
};
layer.InitializationFailed += layer_InitializationFailed;
MapApplication.Current.Map.Layers.Add(layer);
}
Has anyone faced a similar problem and come up with a resolution?
Thanks.
-- Samit