Good Day
I have a map with many layers on it, when I turned off a layer by setting opacity to 0 in the feature query:
if (featureQuery.length > 0) {
this._view.whenLayerView(this._layers[prop][innerProp]).then((featureLayerView) => {
featureLayerView.effect = {
filter: {
where: featureQuery
},
excludedEffect: 'opacity(0%)'
};
});
} else {
this._layers[prop][innerProp].visible = false;
}
the layer disappears, but I'm still able to select the feature, the circle is not visible on the map
I'm using ArcGIS Core 4.20.2, I'm doing a hittest to pick up the feature clicked, is there away to filter out features which aren't visible, or have an opacity of 0?
This is the main part of my query function:
try {
if (this._layers[prop][geometryProp]) {
if (this._layers[prop][geometryProp].visible) {
if (typeof this._layers[prop][geometryProp].createQuery === 'function') {
const query = this._layers[prop][geometryProp].createQuery();
query.where = 'ObjectID = ' + objectId;
query.outFields = ['*'];
query.returnGeometry = geometry;
this._layers[prop][geometryProp].queryFeatures(query).then((queryRes) => {
queryRes.features.map((feature) => {
if (geometry) {
if (feature.geometry) {
r(feature.geometry);
}
} else {
if (feature) {
r(feature);
}
}
});
});
}
}
}
} catch (error) {
console.log(error);
}
Thanks