Select to view content in your preferred language

Flexviewer 2.0 Thematic app help

696
1
07-21-2010 12:46 PM
LeeAllen
Frequent Contributor
I am trying to implement the Flexviewer 2.0 Thematic mapping viewer. Once activated, there is no way that I can find to turn off the thematic layers. Any idea on how to do this?
Tags (2)
0 Kudos
1 Reply
MehulChoksey
Esri Contributor
Yes for the compiled version, there is no way to turn off thematic layers once activated.
however, if you are working with source, try replacing widgetClosedHandler and widgetOpenedHandler with the code below
           
private function widgetClosedHandler(event:Event):void
            {
                clearSelectionAndHideInfoWindow();
                featureLayer.visible = false;
                sendLegendURL("");
                map.removeEventListener(MapMouseEvent.MAP_CLICK, onMapClick);
                map.removeEventListener(ExtentEvent.EXTENT_CHANGE, onExtentChange);
                var operationalLayerData:Object = ht.find(currentTheme.labelref);
                operationalLayerData = ht.find(currentTheme.labelref);
                if (operationalLayerData)
                {
                    operationalLayerData.visible = false
                    currentTheme.visible = false;
                    previousOperationalLayer = currentOperationalLayer = operationalLayerData.label;
                    /*currentQueryParameter = getCurrentQueryParameter(currentOperationalLayer);
                    if (currentQueryParameter)
                    {
                        sendLegendURL(currentQueryParameter.legendurl);
                    }
                    else
                    {
                        sendLegendURL("");
                    } */  
                }
                ViewerContainer.dispatchEvent(new AppEvent(AppEvent.MAP_LAYER_VISIBLE, operationalLayerData));
                    
                
            }

            private function widgetOpenedHandler(event:Event):void
            {
                if (featureLayer)
                {
                    featureLayer.visible = true;
                }
                
                
                var currentOperationLayerData:Object = ht.find(currentOperationalLayer);
                if (currentOperationLayerData)
                {
                    currentTheme.visible = true;
                    currentOperationLayerData.visible = true;
                    ViewerContainer.dispatchEvent(new AppEvent(AppEvent.MAP_LAYER_VISIBLE, currentOperationLayerData));
                }
                
                
                var currentQueryParameter:Object = getCurrentQueryParameter(currentOperationalLayer);
                if (currentQueryParameter)
                {
                    sendLegendURL(currentQueryParameter.legendurl);
                }
                else
                {
                    sendLegendURL("");
                }
                map.addEventListener(MapMouseEvent.MAP_CLICK, onMapClick);
                map.addEventListener(ExtentEvent.EXTENT_CHANGE, onExtentChange);
            }
0 Kudos