Skip to content

Commit

Permalink
Merge branch 'Esri#28/fix-issues-on-startup-caused-by-popups' into de…
Browse files Browse the repository at this point in the history
…velop
  • Loading branch information
Sarthak Datt committed Feb 22, 2013
2 parents 013b81a + a818653 commit 01f141c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/com/esri/viewer/components/toc/tocClasses/TocMapLayerItem.as
Original file line number Diff line number Diff line change
Expand Up @@ -423,9 +423,18 @@ public class TocMapLayerItem extends TocItem
else if (layer is ArcGISDynamicMapServiceLayer)
{
var arcGISDynamicMapServiceLayer:ArcGISDynamicMapServiceLayer = ArcGISDynamicMapServiceLayer(layer);
arcGISDynamicMapServiceLayer.visibleLayers.addEventListener(CollectionEvent.COLLECTION_CHANGE, visibleLayersChangeHandler);
if (arcGISDynamicMapServiceLayer.visibleLayers)
{
arcGISDynamicMapServiceLayer.visibleLayers.addEventListener(CollectionEvent.COLLECTION_CHANGE, visibleLayersChangeHandler);
}
else
{
var visLayers:Array = getActualVisibleLayers(MapServiceUtil.getVisibleSubLayers(_dynamicMapServiceLayerInfos), _dynamicMapServiceLayerInfos);
ArcGISDynamicMapServiceLayer(layer).visibleLayers = new ArrayCollection(visLayers);
ArcGISDynamicMapServiceLayer(layer).visibleLayers.addEventListener(CollectionEvent.COLLECTION_CHANGE, visibleLayersChangeHandler);
}

_visibleLayersChangeWatcher = ChangeWatcher.watch(arcGISDynamicMapServiceLayer, "visibleLayers", visibleLayersChange);

_dynamicMapServiceLayerInfos = arcGISDynamicMapServiceLayer.dynamicLayerInfos ? arcGISDynamicMapServiceLayer.dynamicLayerInfos : arcGISDynamicMapServiceLayer.layerInfos;
if (_isVisibleLayersSet)
{
Expand Down

0 comments on commit 01f141c

Please sign in to comment.