Skip to content
New issue

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

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

Already on GitHub? # to your account

Stop the animation #120

Open
Scippy opened this issue Jul 29, 2019 · 1 comment
Open

Stop the animation #120

Scippy opened this issue Jul 29, 2019 · 1 comment

Comments

@Scippy
Copy link

Scippy commented Jul 29, 2019

Hi, very thanks for this great and flexible project!
I'm initializating globe with simple rotation animation (the same of the official example), but I'd like to stop it when I click and manual rotate on the globe. Is it possible?

@Manthika
Copy link

Manthika commented Jun 4, 2020

Yes, Try this.

var interval = setInterval(function() {
    var c = earth.getPosition();
    earth.setCenter([c[0], c[1] + 0.9]);
}, 50);
···
earth.on('click', function(){
    clearInterval(interval);
});

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

No branches or pull requests

2 participants