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:
Solved! Go to Solution.
Finally I was able to bypass my problem by doing this:
1: Disable the property "Show pop-up when the feature or location is found." in the widget setting
2: Commented and added this code in the Widget.js:
4: Zoom on the selected polygon using this code:
Finally I was able to bypass my problem by doing this:
1: Disable the property "Show pop-up when the feature or location is found." in the widget setting
2: Commented and added this code in the Widget.js:
4: Zoom on the selected polygon using this code: