Select to view content in your preferred language

How to query graphics from multiple layers on hover rather than click?

331
1
02-15-2024 04:30 AM
EmilyGoldsmith
New Contributor III

Hello.

I'm still trying to get my head around hitTests and hover functionality.

I've been playing around with the Feature widget - Query graphics from multiple layers example and wanted to figure out how to have it so that features are queried on hover, rather than click.

However, when I changed the reactiveUtils to "pointer-move", instances of the same popuptemplate keep generating. Is it right that a debounce() function would be necessary to prevent duplicate popups? Such as in the Feature widget in a side panel example.

Just a bit lost as to how to implement this. Any guidance would be greatly appreciated.

0 Kudos
1 Reply
ReneRubalcava
Frequent Contributor II

The Feature widget only supports a single graphic, if you want multiple graphics, you can use the Features widget, however I'm not sure about the UX of having multiple graphics populate it on hover, as when you navigate to the Features UI, it will probably change the graphics before your mouse gets there. pointer-move is the right event you are looking for, and that side panel example is on the right track, just wrong widget.