Hello
Marker click events are not working in mobile device
Hello
Marker click events are not working in mobile device
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
https://github.com/mrdoob/three.js/blob/master/examples/js/controls/OrbitControls.js#L932-L934
PS I’m sure, there are many advanced users on the forum who could give you more valuable advice