Select to view content in your preferred language

When I programatically select from a FeatureLayer anytime ofter selecting on the map, The application freezes.

165
1
Tuesday
EugeneStaten
Occasional Contributor

I have a class that wraps a FeatueLayer.  This is to make sure I can make MCT calls organically from other code.

public class FeatureLayerWrapper {
     FeatureLayerWrapper(FeatureLayer featLayer){
      RawfeatureLayer = featLayer;
    }

    public FeatureLayer RawfeatureLayer { get; private set;}

    public async Task<Selection> Select(
    QueryFilter queryFilter = null,
    SelectionCombinationMethod method = SelectionCombinationMethod.New,
    TimeRange time = null,
    RangeExtent range = null,
    CIMFloorFilterSettings floor = null)
    {
        return await QueuedTask.Run(() => FeatureLayer.Select(queryFilter,  method, time, range, floor));
    }    
}

 

The Select method works, until I first select a few features via map selection, and then try to AND to the selection via a QueryFilter:

string filter = SelectFilter(featureLayer.Prefix);
if (!string.IsNullOrEmpty(filter))
{
    if (featureLayer.Prefix.ToUpper().Equals("SIM"))
    {
        await featureLayer.Select(new QueryFilter(){WhereClause = "\"State\" <> 'Merged'", SelectionCombinationMethod.And);
    }
    else {
        await featureLayer.Select(new QueryFilter(){WhereClause = filter}, SelectionCombinationMethod.And);
    }
    MapView.Active.RedrawAsync(true);
    filterSelected = true;
}

 

The application freezes at this point.  Its not just AND, its any other programatic Selection. post map selection, that  sinks into a black hole, never to return.

So... Is there a map selection lock, I must disengage or is this a bug, or is it something else?

 

 

0 Kudos
1 Reply
EugeneStaten
Occasional Contributor

So...  I tried to ClearSelection using await QueuedTask.Run(() => MapView.Active.Map.ClearSelection());

This, too, froze the application.

0 Kudos