Hello, I have been trying to make a query builder widget that looks similar and functions similar to the Select by tools we have in ArcGIS Pro. I have something working but I have questions on how to improve it.
1. The widget uses the dataSource.selectRecords method, but I don't see an option in that method for additional selection methods like "add to selection" or "remove from selection". Does anyone know of an alternative method? Right now, it'll just make a new selection.
2. When using the select by location option, if no features or multiple features are selected in the Selecting Features, then the widget unions the geometry of all those features. This is because I can only pass in a single geometry in the selectRecords method. However, I am using the unionOperator from the JavaScript SDK and the returned results doesn't seem to work with the selectRecords because of type differences. selectRecords expects IGeometry and I am passing in __esri.GeometryUnion. To get around this, I have an ugly function that returns only the necessary fields based on the type of geometry. Does anyone know of a better way to get around this?
The code is here.
