OK, the first time using cesium. I have a simple, ill-conceived question that I wrote a couple of times on their forms, but no one answers. So I thought I would try here.
All I have to do is figure out how to stop the event before calling another. Here is an example of what is happening. The globe rotates around the user connection, but I need to stop it if they then click on "fly home", etc.
The code is below.
So arg in spinGlobe is spinRate. If I go to 0.0 on the built-in connection, it will not rotate. Excellent. That way, I, though, if the click event (the user clicks me on my home), then spinGlobe (0.0) is called, that the globe will stop spinning. But this is not so. Can I dynamically change spinRate? Or am I all about this wrong?
spinGlobe( 0.5 ) function spinGlobe( dynamicRate ) var previousTime = Date.now(); viewer.clock.onTick.addEventListener(function( clock ) { var spinRate = dynamicRate; var currentTime = Date.now(); var delta = ( currentTime - previousTime ) / 1000; previousTime = currentTime; viewer.scene.camera.rotate(Cesium.Cartesian3.UNIT_Z, -spinRate * delta); }); }
source share