PROBLEM
Your Recordset is empty when you perform both of the following:You call the 'displayFeatures()' method of the Map object; you then use the 'setFilterObject()' method for a FeatureLayers.
For each displayFeatures() method called, a 'Highlight Layer' is added to the map.
Setting a filter will not work if there is at least one existing HighlightLayer in the Layers collection.
Use the code below to loop through the Layers and remove HighlightLayer in the list, as given below:
Code:
map.displayFeatures(fl, firstWhere, false, mySymbol);
map.displayFeatures(fl, secWhere, false, mySymbol);
map.refresh();
int index = 0;
while(true){
String layerName = map.getLayers().item(index).getName();
if (layerName.equals("HighlightLayer"))
map.getLayers().remove(index);
else index++;
if (map.getLayers().getCount()==index) break ;
}
Article ID:000005659
Get help from ArcGIS experts
Download the Esri Support App