Bind listener to zooming

Does anyone have example code of how to create a listener anytime you zoom?

You could use the camera.changed event, which fires every time the camera moves, and compare the previous position with the current one.

Alternatively you could listen for the mouse wheel/right click drag events themselves, like this:

var cameraAggregator = new Cesium.CameraEventAggregator(viewer.canvas);

viewer.clock.onTick.addEventListener(function(){
  var rightDrag = cameraAggregator.isButtonDown(Cesium.CameraEventType.RIGHT_DRAG);
  if (rightDrag) {
    console.log("Zooming");
  }
});

Sandcastle. I think you can also do this outside of CesiumJS, just by creating an event listener directly on the canvas.