I have a sketch tool (based on this sample) that creates graphics that are used for geometry queries. The problem is that my code is only using the most recently drawn polygon for the query.
How do I append graphics together so that the user can draw multiple graphics and have the combined areas be used for the geometry query?
sketchViewModel.on('create', (event) => {
if (event.state === 'complete') {
sketchGeometry = event.graphics.geometry;
console.log('sketch created');
// apply a grayscale feature effect to non selected features
DataLayers.forEach((layer) => {
view.whenLayerView(layer).then((layerView) => {
const featureFilter = { where: fullQuery, geometry: sketchGeometry };
layerView.featureEffect = {
filter: featureFilter,
excludedEffect: 'grayscale(100%) opacity(70%)',
};
});
});
updateChartsUsingActiveLayerView();
}
Is using a groupLayer the correct way? If so, how do I get the geometry of all features in the groupLayer.
Thanks for any help!