public function dataDownload():void { var featureSet:FeatureSet = new FeatureSet(ArrayCollection(myFeatureLayer.graphicProvider).toArray()); var record:Array = featureSet.attributes; var exportSet:Array = new Array(); for (var i:int=0; i<record.length; i++){ if (myMap.extent.intersects(record.geometry)){ exportSet.addItemAt(record,i) } } ssoDataGrid.dataProvider = new ArrayCollection(exportSet); }
public function dataDownload():void { var featureSet:FeatureSet = new FeatureSet(ArrayCollection(myFeatureLayer.graphicProvider).toArray()); var record:Array = featureSet.attributes; var exportSet:Array = new Array(); for each(record in featureSet){ if (myMap.extent.intersects(featureSet.features.geometry)){ exportSet.push(record) } } ssoDataGrid.dataProvider = new ArrayList(exportSet.attributes); }
//Code for Data Download button public function dataDownload():void { var featureSet:FeatureSet = new FeatureSet(ArrayCollection(myFeatureLayer.graphicProvider).toArray()); ssoDataGrid.dataProvider = featureSet.attributes; }
var featureSet:FeatureSet = new FeatureSet(ArrayCollection(firePerimeter.graphicProvider).toArray()); fireDataGrid.dataProvider = featureSet.attributes;
var attributes:Array = new FeatureSet(ArrayCollection(featureLayer.graphicProvider).toArray()).attributes;
AsyncToken(fLayer.selectFeatures(query, "new", new AsyncResponder(response, onFault)));
[Bindable] featuresColl:ArrayCollection; // bind this to a DataGrid dataprovider private function response(features:Array, token:Object = null):void { var f:Array = extractAttributesFromFeatures(features); // for loop in previous post featuresColl = new ArrayCollection(f); }
I'm still not 100% clear on FeatureLayers purpose. It would seem looking at examples it's usefulness is really for editing and time-aware data. I'm sure they've covered it in more detail somewhere, but I may have missed it.
So far the method I have been using to extract attributes from a FeatureLayer is manually....Then you can set that result to a Datagrid dataprovider.
<mx:DataGrid id="attributeTable" dataProvider="{data}"> <mx:columns> <mx:DataGridColumn headerText="Key" dataField="{?}"/> <mx:DataGridColumn headerText="Value" dataField="{?}"/> </mx:columns> </mx:DataGrid>
QBData.dataProvider = fset.attributes;
<mx:VBox width="100%" height="95%" minHeight="0" minWidth="0"> <mx:DataGrid id="QBData" width="100%" height="100%" itemClick="itemClick(event);" minColumnWidth="100" resizableColumns="true"> </mx:DataGrid> </mx:VBox>
protected function extractAttributesFromFeatures(features:Array):Array { var f:Array = []; var g:Graphic; for each (g in features) { f.push(g.attributes); } return f; }
Los miembros registrados pueden publicar, seguir actualizaciones y más. ¿Nuevo aquí? Regístrate gratis.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.