webglearth / webglearth2

[UNMAINTAINED] WebGL Earth 2 - the source code of the project
Apache License 2.0
888 stars 212 forks source link

Could it rotate itself? #103

Open daedalus1984 opened 6 years ago

daedalus1984 commented 6 years ago

How can I achieve to make it rotate automatically?

469090194 commented 6 years ago

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); });