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

Could it rotate itself? #103

Open
daedalus1984 opened this issue Dec 23, 2017 · 1 comment
Open

Could it rotate itself? #103

daedalus1984 opened this issue Dec 23, 2017 · 1 comment

Comments

@daedalus1984
Copy link

How can I achieve to make it rotate automatically?

@469090194
Copy link

year, you can write:
var before = null;
requestAnimationFrame(function animate(now) {
var c = map.getPosition();
var elapsed = before? now - before: 0;
before = now;
map.setCenter([c[0], c[1] + 0.1*(elapsed/30)]);
requestAnimationFrame(animate);
});

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