Several years ago, I (with help from this fine community) developed a simple app that, when a user searched for a location (address, XY, etc.) using the search widget, a featurelayer was also queried and a pop-up would provide information from that feature layer. Example: an individual would enter an address and the search widget would query a state house district layer, resulting in a pop-up with info. about the district in which the address occurs (code snippet below to show what was done).
searchWidget.on('select-result', function(evt){
let query = hsb.createQuery();
query.geometry = evt.result.feature.geometry;
query.spatialRelationship = 'within';
query.outFields = ['*'];
query.returnGeometry = true;
query.outSpatialReference = view.spatialReference;
query.maxAllowableOffset = 0;
hsb.queryFeatures(query).then(function(result){
view.popup.open({
features: result.features,
location: result.features[0].geometry.centroid
});
});
});
We now have a need to do this for taxable jurisdictions. However, a single location can fall within multiple taxable jurisdictions (e.g. county, municipality, etc.), necessitating querying multiple layers and, ideally, returning a single pop-up.
The quickest, easiest solution would be to union the various layers and then query against it, but these data are dynamic, so being able to query each layer individually and returning the results at once is a better solution.
Anyone have any examples of something comparable I could use as a potential guide?