A couple of questions, one specific and one more general. Specific first:- I'm attempting to modify the selectedFeatures of one of my map FeatureLayers. I set up my query and then have the following code:
var fLayer:FeatureLayer;
for each (var lyr:Layer in map.layers)
{
if ((lyr is FeatureLayer) && (lyr.url == queryUrl))
{
fLayer = FeatureLayer(lyr);
break;
}
}
var selectionMethod:String = FeatureLayer.SELECTION_NEW;
fLayer.selectFeatures(facsQuery, selectionMethod, new AsyncResponder(onSelectResult, onSelectFault, fLayer));
I'm hoping this will highlight the selected features in a map layer that already exists, rather than create a 'new FeatureLayer()', which adds another (unwanted) layer to my map (and layer picker -- I'm using the v2.2 Flex Viewer).At compile time, I'm getting the error '1119: Access of possibly undefined property url through a reference with static type com.esri.ags.layers.Layer'.Is there a better way to do what I'm trying to do?Now the more general question:- Ultimately I want to highlight multiple features in multiple layers. I have to use a query since my where clause is 'ID in (123,456,789)'. While a Find task will query multiple fields in multiple layers, it only allows a simple search string, i.e. I can't define a query w/ a where clause, etc. So I have to use a query. Also, if I want to take advantage of the selectedFeatures highlighting, then I have to define a query and run FeatureLayer.selectFeatures() as in my code above. I could do something like:- loop through each layer to be searched and increment a counter- decrement the counter each time I get a result- zoom to my features when counter = 0Should I do something else instead like use a hidden layer that has all features of my multiple layers, query that one layer, and hide it from the layer selector (if possible)? The multiple layers that I'm searching are views of a single feature class, so this may be the way to go if there's a way to query that layer and render the features on the map even though I don't want the layer itself on the map or in the layer picker.