I am new to flex. Now I am trying to customize the SearchWidget from arcgis-samples-flex-3.6-src. What I want to do is:
(1) use the drawing tools provide in the sample on a layer from the layer list.
(2) get a specified field values of all the features in the drawing area (of the selected layer) in a arraylist.
Now I can access the layer, but I failed to get the expected arraylist (the fieldValues in the following code).
private function queryFeaturesGraphical(geom:Geometry):void
{
hideInfoWindow();
var searchLayer:Object = cboLayerGraphical.selectedItem;
queryLayer = searchLayer.layer;
retrieveFieldValue(searchLayer);
}
private function retrieveFieldValue(obj:Object):void
{
CursorManager.removeBusyCursor();
var fieldset:FeatureSet = obj as FeatureSet;
fieldValues = uniqueArray(fieldset.features);
}
private function uniqueArray(arr:Array) : Array
{
var unique : Array = new Array();
var contains : Boolean;
for( var i:Number = 0; i<arr.length; i++ )
{
contains = false;
unique.push(arr);
}
return unique;
}
}
What I use is arcgis flex api 3.6 and flash builder 4.6.
Would anybody please advice me what is wrong with my code? thanks.
Solved! Go to Solution.
Leaf,
Is there parts of your queryFeaturesGraphical function that you have omitted for some reason?
I don't search anywhere in that function that an actual query occurs on the queryLayer...
Leaf,
Is there parts of your queryFeaturesGraphical function that you have omitted for some reason?
I don't search anywhere in that function that an actual query occurs on the queryLayer...
Thanks Robert,
I didn't post part of the queryFeaturesGraphical because the program is stuck when performing onFieldValuesRereivalsuccess at the line of
mFldValues = uniqueArray(fset.features); |
I cannot figure out the reason.
I will check the code for the query part.
Best Regards
Hello Robert,
Currently I am trying to confirm whether I can get the features selected first, in this case I follow the SearchWidget (just modified the xml to catering to my map service).
Since it is a different question, I posted it as a new thread:
https://community.esri.com//thread/117907
Appreciate if you can have a look, thank you.
Hi Robert,
I have already got the issue fixed, thanks for the kind help.