Select to view content in your preferred language

Sublayer Popups in 2.5 with visiblelayers

936
3
Jump to solution
01-27-2012 03:51 AM
AngieCausey
Occasional Contributor
I have an issue with popups in the flex 2.5 viewer. When I have an operational layer that has the visiblelayer attribute set, the sublayer popups will not appear. If I remove the visiblelayer attribute from the layer tag, they work just fine. Bug?? Or am I doing something wrong?

<layer label="NGA Transportation" type="dynamic" visible="false" alpha="1"
    url="http://services.nationalmap.gov/ArcGIS/rest/services/transportation/MapServer"
    visiblelayers="8,9">
    <sublayer id="8" popupconfig="popups/PopUp_Airports.xml"/>
</layer>
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
DasaPaddock
Esri Regular Contributor
This is a bug that's being caused by TocMapLayerItem.as reversing the order of the layerInfos on the dynamic layer. This is a problem in this service since it has group layers.

You could use two "feature" layers instead, or you can fix the code by changing line 283 of TocMapLayerItem.as from:

var actualVisibleLayers:Array = getActualVisibleLayers(arcGISDynamicMapServiceLayer.visibleLayers.toArray(), arcGISDynamicMapServiceLayer.layerInfos);

to:
var actualVisibleLayers:Array = getActualVisibleLayers(arcGISDynamicMapServiceLayer.visibleLayers.toArray(), arcGISDynamicMapServiceLayer.layerInfos.slice());

View solution in original post

0 Kudos
3 Replies
RobertScheitlin__GISP
MVP Emeritus
Angie,

   You need to post Flex Viewer/Widget Question in the future to the Flex Viewer forum here:

http://forums.arcgis.com/forums/111-ArcGIS-Viewer-for-Flex

But I have tested and can confirm that the same behavior that you describe (popups not working when using the visiblelayers attribute) does not work for me either for that Map Service. But I am not leaning towards a bug as I can not duplicate this with other map services.
0 Kudos
DasaPaddock
Esri Regular Contributor
This is a bug that's being caused by TocMapLayerItem.as reversing the order of the layerInfos on the dynamic layer. This is a problem in this service since it has group layers.

You could use two "feature" layers instead, or you can fix the code by changing line 283 of TocMapLayerItem.as from:

var actualVisibleLayers:Array = getActualVisibleLayers(arcGISDynamicMapServiceLayer.visibleLayers.toArray(), arcGISDynamicMapServiceLayer.layerInfos);

to:
var actualVisibleLayers:Array = getActualVisibleLayers(arcGISDynamicMapServiceLayer.visibleLayers.toArray(), arcGISDynamicMapServiceLayer.layerInfos.slice());
0 Kudos
AngieCausey
Occasional Contributor
Thank you dpaddock!  Your fix worked beautifully!
0 Kudos