Skip to content

Commit

Permalink
_dynamicServiceLayerInfos is populated before setting visible layers
Browse files Browse the repository at this point in the history
  • Loading branch information
Sarthak Datt committed Feb 26, 2013
1 parent a47e2fe commit fa5eda2
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -423,15 +423,14 @@ public class TocMapLayerItem extends TocItem
else if (layer is ArcGISDynamicMapServiceLayer)
{
var arcGISDynamicMapServiceLayer:ArcGISDynamicMapServiceLayer = ArcGISDynamicMapServiceLayer(layer);
_dynamicMapServiceLayerInfos = arcGISDynamicMapServiceLayer.dynamicLayerInfos ? arcGISDynamicMapServiceLayer.dynamicLayerInfos : arcGISDynamicMapServiceLayer.layerInfos;
if (!arcGISDynamicMapServiceLayer.visibleLayers)
{
var visLayers:Array = getActualVisibleLayers(MapServiceUtil.getVisibleSubLayers(_dynamicMapServiceLayerInfos), _dynamicMapServiceLayerInfos);
arcGISDynamicMapServiceLayer.visibleLayers = new ArrayCollection(visLayers);
}
arcGISDynamicMapServiceLayer.visibleLayers.addEventListener(CollectionEvent.COLLECTION_CHANGE, visibleLayersChangeHandler);

_visibleLayersChangeWatcher = ChangeWatcher.watch(arcGISDynamicMapServiceLayer, "visibleLayers", visibleLayersChange);
_dynamicMapServiceLayerInfos = arcGISDynamicMapServiceLayer.dynamicLayerInfos ? arcGISDynamicMapServiceLayer.dynamicLayerInfos : arcGISDynamicMapServiceLayer.layerInfos;
arcGISDynamicMapServiceLayer.visibleLayers.addEventListener(CollectionEvent.COLLECTION_CHANGE, visibleLayersChangeHandler);
_visibleLayersChangeWatcher = ChangeWatcher.watch(arcGISDynamicMapServiceLayer, "visibleLayers", visibleLayersChange);
if (_isVisibleLayersSet)
{
layerInfos = [];
Expand Down

0 comments on commit fa5eda2

Please sign in to comment.