//PopUp Window on DataGrid var obj:Object = featureSet.attributes; var myfloatdg:MyFloatDG; myfloatdg = MyFloatDG(PopUpManager.createPopUp(myMap,MyFloatDG,false)); PopUpManager.centerPopUp(myfloatdg);
//PopUp Window on DataGrid var obj:Object = featureSet.attributes; // var myfloatdg:MyFloatDG; if (myfloatdg == null) { myfloatdg = MyFloatDG(PopUpManager.createPopUp(myMap,MyFloatDG,false)); } myfloatdg.visible = true; PopUpManager.centerPopUp(myfloatdg);
<?xml version="1.0" encoding="utf-8"?> <mx:TitleWindow xmlns:mx= "http://www.adobe.com/2006/mxml" xmlns:esri= "http://www.esri.com/2008/ags" layout= "absolute" width= "622" height= "300" showCloseButton= "true" title= "Results" close= "closeMe()"> <mx:Script> <![CDATA[ import mx.events.ListEvent; import com.esri.ags.geometry.Extent; import com.esri.ags.layers.GraphicsLayer; import com.esri.ags.Map; import mx.managers.PopUpManager; import com.esri.ags.Graphic; [Bindable] public var myMap:Map; [Bindable] public var myGraphicsLayer:GraphicsLayer; private var _data:Object; public function set graphicslayer(value:GraphicsLayer):void { myGraphicsLayer = value; } public function set dProvider(value:Object):void { _data = value; resultsGrid.dataProvider = _data; } public function closeMe():void { this.visible = false; myGraphicsLayer.clear(); } private function onItemRollOver(event:ListEvent):void { findGraphicByAttribute(event.itemRenderer.data).symbol = highlightSymbol; } private function onItemRollOut(event:ListEvent): void { findGraphicByAttribute(event.itemRenderer.data).symbol = resultsSymbol; } private function findGraphicByAttribute( attributes : Object ) : Graphic { for each (var graphic:Graphic in myGraphicsLayer.graphicProvider) { if (graphic.attributes == attributes) { return graphic; } } return null; } ]]> </mx:Script> <esri:SimpleFillSymbol id="resultsSymbol" color="0x999999" alpha="0.01" style="solid"> <esri:SimpleLineSymbol color="0x00FFFF" width="2" alpha="1" style="solid" /> </esri:SimpleFillSymbol> <esri:SimpleFillSymbol id="highlightSymbol" color="0xFF0000" alpha="1" style="cross"> <esri:SimpleLineSymbol color="0x00FFFF" width="2" alpha="1" style="solid" /> </esri:SimpleFillSymbol> <mx:DataGrid id="resultsGrid" itemRollOver="onItemRollOver(event);" itemRollOut="onItemRollOut(event);" scroll="true" width="100%" height="40%"> <mx:columns> <mx:DataGridColumn id="dcg" dataField="STATE_NAME"/> <mx:DataGridColumn id="dcg1" dataField="POP2007"/> </mx:columns> </mx:DataGrid> </mx:TitleWindow>
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.