Hi everyone, I'm currently customizing a Search widget in Web AppBuilder for developper and I would like to know how I can change the selected feature result to a polygon containing the point address from the search.
This is the workflow:
1: The user search for a specific address in the search bar.
2: The user select either a suggestion or press enter to do the search
3: The search widget get the coordinates of the place searched by the user.
4: For all polygon in the feature layer, find the first polygon that contain the point using the within function and return the polygon ID
5: Select the polygon with the objectid property found at step 4 instead of the new point created from the search result.
So far, there is only the step 5 I am not able to do. My understanding is that the selection is done somewhere else when this method is called:
this.publishData({
'searchResults': evt
});
So I was guessing that I could change the evt variable by removing the point feature and replace it by the polygon but I am not sure this is the right way to do this. If it is, how can I get the polygon feature object when I only have it's objectId?
Thank you for your time