# how to get current camera parameter

**URL:** <https://community.cesium.com/t/how-to-get-current-camera-parameter/5729>\
**Category:** CesiumJS\
**Created:** [June 29, 2017, 2:44am UTC](https://community.cesium.com/t/how-to-get-current-camera-parameter/5729 "2017-06-29T02:44:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![arc\_z](https://avatars.discourse-cdn.com/v4/letter/a/e9bcb4/32.png) [@arc\_z](https://community.cesium.com/u/arc_z)\
**Post date:** [June 29, 2017, 2:44am UTC](https://community.cesium.com/t/how-to-get-current-camera-parameter/5729/1 "2017-06-29T02:44:44Z")

</div>

When initializing map, I set camera parameter,

```
  viewer.camera.setView( { 
        destination : Cesium.Cartesian3.fromDegrees(116, 39, 100000),// x y z
        orientation: {
            heading : Cesium.Math.toRadians(-0),
            pitch : Cesium.Math.toRadians(-40), 
            roll : 0.0
        } 
    });

```

When users drag map , change map direction , I wanto to save z, but reset x and y. In the console , I output the viewer.camera, find the parameter( position, direction ) value is very large, not use degree, how to get the parameter (using degree), thanks!

---

<div class="post-metadata">

**Author:** ![Rachel\_Hwang](https://avatars.discourse-cdn.com/v4/letter/r/d78d45/32.png) [@Rachel\_Hwang](https://community.cesium.com/u/Rachel_Hwang)\
**Post date:** [June 29, 2017, 1:14pm UTC](https://community.cesium.com/t/how-to-get-current-camera-parameter/5729/2 "2017-06-29T13:14:44Z")

</div>

Hi there,

Here’s a code example that prints the camera values in degrees on button click.

> **[Cesium Sandcastle](https://sandcastle.cesium.com/?src=Hello%20World.html&label=Showcases&gist=dfab724606b2cf9a88c43fb85e283fb6)**
>
> The Cesium Sandcastle provides an interactive environment for testing Cesium code.

Hope that helps,

- Rachel
