Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Double Click Event Not Working on Globe #168

Open
niravupxselling opened this issue Jul 25, 2023 · 1 comment
Open

Double Click Event Not Working on Globe #168

niravupxselling opened this issue Jul 25, 2023 · 1 comment

Comments

@niravupxselling
Copy link

Description:
Hi @vasturiano,

I encountered a bug while attempting to implement a solution that involves "double-clicking" on any country of the globe to zoom and center the page. Currently, the double-click event does not seem to be functioning as expected.

Steps to Reproduce:

Attempt to double-click on any country on the globe.
Observe that the zoom and center functionality does not trigger.
Expected Behavior:
Double-clicking on a country of the globe should trigger the zoom and center functionality.

Actual Behavior:
Double-click event is not firing when attempting to double-click on a country of the globe.

Code:

typescript
Copy code
this.world.nativeElement.addEventListener("dblclick", (ev: MouseEvent) => {
console.log('dblclick', ev);
});
Additional Information:

The single click event works as expected, and it triggers the this.stopRotation() function.
The error message "nativeElement is undefined" may be related to the issue.
System Information:

Browser: [e.g., Chrome version X, Firefox version Y]
Operating System: [e.g., Windows 10, macOS Big Sur]
Possible Solution:
I have attempted to listen to the double-click event on this.world.nativeElement, but it does not seem to work. Could you please suggest any alternative ways to implement the double-click functionality on the globe?

Thank you for your assistance in resolving this issue.

Best regards,
Nirav Dhanorkar

@vasturiano
Copy link
Owner

@niravupxselling can you not use onGlobeClick, and detect double-clicks if the duration between two clicks is smaller than say 100ms?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants