Select to view content in your preferred language

ESRI TOC component and 3.1 visiblelayers no longer an arraycollection

675
2
03-05-2013 10:30 AM
eddiequinlan
Deactivated User
I have upgraded to the arcgis flex 3.1 version.  In doing so, ESRI TOC component no longer works as it use to.  Specifically in the TocMapLayerItem.as there are a couple of lines of code as such:

             layerInfos = ArcGISDynamicMapServiceLayer(layer).layerInfos;
             visibleLayers = ArcGISDynamicMapServiceLayer(layer).visibleLayers; 
}
             else if (layer is ArcIMSMapServiceLayer)
{
layerInfos = ArcIMSMapServiceLayer(layer).layerInfos;
             visibleLayers = ArcIMSMapServiceLayer(layer).visibleLayers

In the old version var visibleLayers is an arraycollection = the layer.visibleLayers (arraycollection).  In 3.1 layer.visibleLayers is now an ILIST and not an arraycollection.

Has anyone addressed this?  I'm not real sure on the best way to correct this, since the component interacts with other ESRI TOC components.

thanx,
Eddie
Tags (2)
0 Kudos
2 Replies
RobertScheitlin__GISP
MVP Emeritus
Eddie,

   The TOC component is not a maintained source (that I am aware of) outside of the ArcGIS Viewer for Flex.

As far as updating the code your self to handle the fact that it is a IList now, that is pretty straight forward.

ArcGISDynamicMapServiceLayer(layer).visibleLayers.toArray()
0 Kudos
eddiequinlan
Deactivated User
Thanx Robert,

I'll experiment with the code and see what happens.  I'll try your idea first, since it seems the simplest.  My other thought was to change:

var visibleLayers:ArrayCollection   to   var visibleLayers:IList;

I'll keep you posted........
Eddie
0 Kudos