Assigning different symbols to search results of the same geometry. Is it possible?

337
1
01-20-2022 02:53 PM
Fox71
by
New Contributor

Hello,

I have a search widget that is pointing to different layers. The information that can be retrieve is usually of the same geometry and I want to assign a different "picture-marker" to show on the map depending on what the result is.

I have found a way to assign a single symbol in the search widget:

resultSymbol: {
                    type: "picture-marker", // autocasts as new PictureMarkerSymbol()
                    url: "https://webdev.usu.edu/map2/images/icons/aggies.png",
                    width: '32px',
                    height: '37px'
                  },

But this creates a single symbol for all search results. I'd like  for example to assign a different symbol if the result is a building, a parking space, etc...

I have tried to define a renderer but the search widget doesn't seem to accept these.

Is this something that can be done?

Thank you!

B-

0 Kudos
1 Reply
Stacy-Rendall
New Contributor III

I don't think you can do such a thing directly with the search result, but you could take the result and put it in a graphics layer, for which you could give each graphic whatever symbol you wished...?

0 Kudos