//New function
private function removeGlow( fl:FeatureLayer ):void
{
var len:int = fl.numChildren;
var dObj:DisplayObject;
for ( var i:int = 0; i < len; i++ ) {
dObj = fl.getChildAt( i );
if ( dObj.filters ) {
dObj.filters = [];
}
}
}
//Updated function
protected function featureLayer_selectionHandler(event:FeatureLayerEvent):void
{
removeGlow(event.featureLayer);
dispatchEvent( new Event( 'featurelayer_selection', true ) );
var flEvent:SelectionFeatureLayerEvent = new SelectionFeatureLayerEvent(
SelectionFeatureLayerEvent.LAYER_RESULTS,event.featureLayer);
dispatchEvent(flEvent);
if (event.type == FeatureLayerEvent.SELECTION_CLEAR)
{
this.showInfoWindow(null);
}
}
for (var i:int = 0; i < lyrList.length(); i++)
{
var lyrURL:String = lyrList.url;
var lyrLabel:String = lyrList.name;
var featureLayer:FeatureLayer = new FeatureLayer(lyrURL);
featureLayer.name = lyrLabel;
var l1lst:XMLList = (lyrList.maxscale as XMLList)
var l2lst:XMLList = (lyrList.minscale as XMLList)
//Override the min and max zoom scale if they are in the config // not sure why couldn't test directly but had to create varable first???
if (l1lst.length() > 0 )
featureLayer.maxScale = lyrList.maxscale;
if (l2lst.length() > 0 )
featureLayer.minScale = lyrList.minscale;
featureLayer.addEventListener(LayerEvent.LOAD, featureLayer_loadHandler);
}
.........
........
........
//ViewerContainer.dispatchEvent(new AppEvent(AppEvent.DATA_CREATE_INFOWIDGET, data, infoReady));
AppEvent.dispatch(AppEvent.DATA_CREATE_INFOWIDGET, data, infoReady);
I have updated this part of the init() function and it seems to be working fine in 3.0: Keep in mind that I am no pro by any means, but this seems to work.for (var i:int = 0; i < lyrList.length(); i++) { var lyrURL:String = lyrList.url; var lyrLabel:String = lyrList.name; var featureLayer:FeatureLayer = new FeatureLayer(lyrURL); featureLayer.name = lyrLabel; var l1lst:XMLList = (lyrList.maxscale as XMLList) var l2lst:XMLList = (lyrList.minscale as XMLList) //Override the min and max zoom scale if they are in the config // not sure why couldn't test directly but had to create varable first??? if (l1lst.length() > 0 ) featureLayer.maxScale = lyrList.maxscale; if (l2lst.length() > 0 ) featureLayer.minScale = lyrList.minscale; featureLayer.addEventListener(LayerEvent.LOAD, featureLayer_loadHandler); } ......... ........ ........ //ViewerContainer.dispatchEvent(new AppEvent(AppEvent.DATA_CREATE_INFOWIDGET, data, infoReady)); AppEvent.dispatch(AppEvent.DATA_CREATE_INFOWIDGET, data, infoReady);
I still get a couple warnings about "Data binding will not be able to detect assignments to length" for the end of SelectByAttributes.mxml and SelectionResults.mxml but it is working.
R_