Select to view content in your preferred language

How to show popup in ESRI map on mouse hover

1417
3
10-12-2021 04:39 AM
RishavPathak
Emerging Contributor

Hi,

I want to show popup in ESRI map on mouse hover. Currently I am using Arcgis Javascrip API 4.19. 

Is it possible to implement such features without using dojo?

If yes then can someone guide me on how to do it?

 

Thanks

3 Replies
KenBuja
MVP Esteemed Contributor
0 Kudos
woriginal1
Emerging Contributor

I think this sample code is what you're looking for: https://developers.arcgis.com/javascript/latest/sample-code/view-hittest/

0 Kudos
GavinRehkemper
Esri Contributor

That view hitTest sample from @woriginal1  is probably the best resource. Here is an additional sample that uses the "pointer-move" event along with hitTest and a debounce to create a popup on mouse hover: https://codepen.io/gavinr/pen/WNEwKEq?editors=0010 

Shows how to do proper "show popup on hover" using debouncing so that there's no flickering/stuttering. Example without debouncing: https://codepen.io/...