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?
<SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>searchWidget<SPAN class="punctuation token">.</SPAN><SPAN class="token function">on</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">'select-result'</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">{</SPAN>result<SPAN class="punctuation token">,</SPAN> source<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="operator token">=</SPAN><SPAN class="operator token">></SPAN><SPAN class="punctuation token">{</SPAN>
result<SPAN class="punctuation token">.</SPAN>feature<SPAN class="punctuation token">.</SPAN>symbol <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">{</SPAN>
type<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"point-3d"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="comment token">// autocasts as new PointSymbol3D()</SPAN>
symbolLayers<SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="punctuation token">{</SPAN>
type<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"object"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="comment token">// autocasts as new ObjectSymbol3DLayer()</SPAN>
width<SPAN class="punctuation token">:</SPAN> <SPAN class="number token">20</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="comment token">// diameter of the object from east to west in meters</SPAN>
height<SPAN class="punctuation token">:</SPAN> <SPAN class="number token">50</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="comment token">// height of the object in meters</SPAN>
depth<SPAN class="punctuation token">:</SPAN> <SPAN class="number token">15</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="comment token">// diameter of the object from north to south in meters</SPAN>
resource<SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">{</SPAN> primitive<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"cylinder"</SPAN> <SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">,</SPAN>
material<SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">{</SPAN> color<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"red"</SPAN> <SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">]</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>