Mobile device click not working

Hello

Marker click events are not working in mobile device

https://jsfiddle.net/rsks86/xg1o4ekr/1026/

1 Like

Hi!
For mobile devices you need to use Touch Events.

Hi,

Thanks for reply,

zoom event’s are working as well as touch event’s working,

my concern is click event not working on mobile device.

I need your help. ASAP

Thanks
Dhanraj

You need something like this:

window.addEventListener("touchend", onTouchEnd);

and in the onTouchEnd function you need to get coordinates of the touch (see here or here), transform them into NDC and the rest of the logics is the same like you do here

window.onmousedown = function(event) {

Because they are implemented in the orbit controls. So you can see how it works under the hood, taking a look at the source code of the controls

PS I’m sure, there are many advanced users on the forum who could give you more valuable advice :slight_smile:

1 Like