Closed mikewilburn closed 7 years ago
This still appears to be occurring. Usually tapping to identify features 10 or so times will reveal it.
@doneill Can you confirm that I'm correctly implementing logic for clearing selected features in the MapFragment?
final LayerList layers = mMapView.getMap().getOperationalLayers();
for (final Layer layer : layers){
if (layer instanceof FeatureLayer){
((FeatureLayer) layer).clearSelection();
}
}
@doneill I think this works:
final LayerList layers = mMapView.getMap().getOperationalLayers();
for (final Layer layer : layers){
if (layer instanceof FeatureLayer){
final FeatureLayer featureLayer = (FeatureLayer)layer;
final ListenableFuture<FeatureQueryResult> resultListenableFuture = featureLayer.getSelectedFeaturesAsync();
resultListenableFuture.addDoneListener(new Runnable() {
@Override public void run() {
try {
FeatureQueryResult result = resultListenableFuture.get();
Iterator<Feature> iter = result.iterator();
while (iter.hasNext()){
featureLayer.unselectFeature(iter.next());
}
featureLayer.clearSelection();
} catch (InterruptedException | ExecutionException e) {
Log.i(TAG, e.getClass().getSimpleName() + " " + e.getMessage());
}
}
});
Log.i(TAG, "Clearing layer " + featureLayer.getName());
}
}
@mikewilburn I've posted a fix for this in the latest apk file. Can you retest?
Whereas I would have usually seen this within the first 20 or so seconds of tapping features, two minutes spent doing so with the latest version didn't show this behavior. Confirmed that this no longer occurs with the latest .apk.
It seems there are occasions on which I can tap the map to identify a new feature, but the previously identified feature’s selection isn’t removed.
Unfortunately, I haven't been able to come up with steps to reproduce this yet. See the example below.