Good Day
I'm using "@arcgis/core": "4.27.6"
I think I found a bug in the querying logic when setting a definition expression (DE). Assume I have a layer and I set the DE to 'a = 1 OR a =2', and two of the X features are now shown.
If I run another query on the map: 'a = 3', and get back a feature / geometry, why is the visible flag still true when the feature isn't visible? Should I be able to use a DE as a first pass filter that's constant, and then on top of that apply more filters using queries?
This is a code sample of what I'm doing:
Definition Expression Stage, assume query: 'a = 1 OR a = 2':
this._view?.map?.layers?.forEach((layer) => {
if (layer?.type === 'feature' && !layer?.id.includes('meta-')) {
layer.definitionExpression = query;
}
}
Running the second query, assume mapQuery is: 'a = 3':
const query = {
where: mapQuery,
outFields: ['*'],
returnGeometry: true
}
const visibleFeatures: Graphic[] = [];
this._view.when(() => {
this._view.map.layers.forEach((layer) => {
if (layer.type === 'feature') {
layer.queryFeatures(query).then((queryRes) => {
queryRes.features?.forEach((feature) => {
if (feature.visible) {
visibleFeatures.push(feature);
}
})
r(visibleFeatures);
}).catch((error) => {
console.log(error);
j(error);
})
}
})
})
When I look for anything but a 1 or 2, they aren't visible on the map, so that flag shouldn't be set.
Thanks