Watch current position in Cesium with angular

I'm new to Cesium, and I'm trying to get the current position.
I hooked into the variable.
Here's the code: =;
                return {
            }, function(newPositions, oldPositions){

It works fine tracking changes after flyToo or lookAt, but not after mouse movement (e.g. zoom, drag).

Taking a look at the camera variable itself shows the camera position doesn't change with the mouse controls. Any way to see the current view of the camera after mouse move?

I haven’t used AngularJS, but the Cesium camera positionCartographic value does correctly update in response to mouse movements.

This simple Sandcastle example logs positionCartographic on an interval. You can see that the value changes as you move around with the mouse.

var viewer = new Cesium.Viewer(‘cesiumContainer’);

setInterval(function() {


}, 100);

Thanks. Your interval gave me the solution eventually.
Whenever I'm using angularjs $interval, it forces a digest, which updates my view.

What's still a mystery to me is why my $watch was not working. I tried to:

scope.cesium.viewer = new Cesium.Viewer('cesiumContainer');
$watch('', function(new, old){console.log(new); console.log(old);}, true);

It enters the function only once (on startup), gives the correct starting coordinates, and then doesn't fire when I change the coordinates.

If anyone has any idea why this isn't working, I'll appreciate it.
Thanks again :slight_smile:

check this file in cesium directory


this will give you current coords on mouse move.