I'm having a difficult time intercepting a search widget selected result and dynamically changing the symbol that gets placed on the map based on application state, and am curious if this workflow is supported. At its most simplistic, I've tried with the below, which does not work.
In my case, setting the resultSymbol on the search sources object or anything "hard-coded" would not work, since I have multiple application settings that might affect how I want a search result displayed - what's missing in the below code are the conditionals checking those application settings, but I wasn't even able to get the simple case to work.
Can anyone help me out?
this.searchWidget.on('select-result', ({result, source})=>{
result.feature.symbol = {
type: "point-3d",
symbolLayers: [{
type: "object",
width: 20,
height: 50,
depth: 15,
resource: { primitive: "cylinder" },
material: { color: "red" }
}]
};
});