camera.changed event

Has anyone noticed a difference in v33 with the camera changed event? It seems like I’m getting the callback less often now. I have some code that keeps the camera within a set of defined lat/long ranges. When the camera gets outside of the bounds, the camera flys to the last good position. That position seems to be the position that was recorded on the mouseDown of the camera navigation now instead of a position close to the bounds. I was just wondering if anyone else has seen a change with the event.


Scott, I can’t think of anything that would have changed, but for the type of functionality you’re describing, I would hook into the scene.preRender event instead of the camera changed event. preRender is a better choice for stopping things from happening instead of changed which tries to undo them after the fact.

Ok, cool. I didn’t think of that. The one issue I can think of is that how do I stop the camera navigation that I don’t control. Maybe a vector of the direction of the camera and then disable the camera nav(while the mouse is down)?

I will add that we have currently two applications built on top of cesium, and both want this type of camera bounding. Is there a way to push a little more control for the camera nav out to the developer?


Hi Scott,

There’s actually an open issue for this:

If you can hang on for a few weeks, we were actually planning on tackling this during a team code sprint this month. If you need a fix now, then I second Matt’s suggestion to look into scene.preRender.


  • Rachel