Quantcast
Channel: Forums - ArcGIS Viewer for Flex
Viewing all articles
Browse latest Browse all 2097

Question about etime widget

$
0
0
Greetings, I modified the etime widget code a little for one behavior-- if the widget is opened and closed, and the user changed layer visibility, the widget open event can not acknowledge this change. So I added the following code in widgetOpenedHandler
var l:int;
oLayerVisArr = [];
for (l = 0; l < configTimeLayers.length; l++){
if(map.getLayer(configTimeLayers[l].layer)){
const vis:Boolean = map.getLayer(configTimeLayers[l].layer).visible;
oLayerVisArr.push(vis);
}
}
changeLayer(selectedIndex);
ddlTimeLayers.selectedIndex = selectedIndex;

The ChangeLayer basically is same as ddlTimeLayers_changeHandler. SelectedIndex is remembered in widget close handler. However, when I opened the widget for the second time, the temporal play can not be fired. If I change the layer, then everything works fine, though my changehandler uses the same code.
protected function ddlTimeLayers_changeHandler(event:IndexChangeEvent):void
{
var i:int = ddlTimeLayers.selectedIndex;
changeLayer(i);
}


Can anyone give me some hint?

Thanks

Xiaowen

Viewing all articles
Browse latest Browse all 2097

Trending Articles