Following code snippets works perfectly until data in the layer is refreshed again after initial load. Once data is reloaded the following code doesn't list features from the layerview for a cluster.
Once map is zoomed In/Out, the query starts working again. I think the layerView needs refresh, but there is nothing I could find to do that.
const { results } = await view.hitTest(evt, { include: featureLayer });
if (results[0].graphic.isAggregate) {
const layerView = await view.whenLayerView(featureLayer);
const query = layerView.createQuery();
query.aggregateIds = [results[0].graphic.getObjectId()];
const { features } = await layerView.queryFeatures(query);
console.log(features.length + " features found");
}
Hi there,
I am not able to reproduce the behavior you are referring to. Can you please provide a simple codepen that shows the behavior in question? Which version of the API are you using?