Hey did you get to the bottom of this one?
Anyone have an idea about the error #2124?
Jefferson, The error you are getting means "Loaded file is an unknown type". I have seen this in the past when a widget is using the old infoPopup and someone mistakenly omits that line from the config xml for the widget. So do you have this line towards the bottom of your SelectionWidget.xml? <zoomscale>5000</zoomscale> <info>widgets/InfoTemplates/InfoPopupWidget.swf</info> </configuration>And if so are you sure that the widgets/InfoTemplates/InfoPopupWidget.mxml is added to the modules list of your flex viewer project so that it is being compiled to a swf?
<zoomscale>5000</zoomscale> <info>widgets/InfoTemplates/InfoPopupWidget.swf</info> </configuration>
I do not get any errors. Just a few warnings about length not being bindable.R_
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_
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);
//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); } }
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.