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);
}