AnalyticalGraphicsInc/cesium — pull request #1034 by evax (2013-08-14 13:28:30+00:00)
Title: Prevent the HomeButton to alter the ScreenSpaceCameraController settings...

... during animation as they might not be always restored.

In [HomeButtonViewModel.js](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Widgets/HomeButton/HomeButtonViewModel.js#L38) the viewHome function tries to prevent user interaction during transition, and saves the state of the ScreenSpaceCameraController to restore it in the onComplete callback.

However if wheel zooming occurs during the animation, [the tween is cancelled](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Scene/ScreenSpaceCameraController.js#L390) and the callback is never called, leaving [everything disabled](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Widgets/HomeButton/HomeButtonViewModel.js#L51) in the ScreenSpaceCameraController.

I took the approach of not altering the state at all with the idea that end users should be able to interrupt a transition.

The other approaches I can see are
- taking enableZoom into account in [wheelZooming](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Scene/ScreenSpaceCameraController.js#L387) (but it has ugly side effects with animations piling up)
- call onComplete on tweens before the [removeAll()](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Scene/ScreenSpaceCameraController.js#L391) call, although I'm not sure how safe it would be with the existing code.