title: Get center in Cesium Map
body: <p>I need to know what is the current center of the Cesium Map.</p>
  
  <p>I tried to use <code>viewer.camera.position</code> but it always gives the same z value (x: 16921255.101297915, y: 5578093.302269477, z: 12756274) and I'm not sure about the x and y values. Are they in meters? </p>
  
  <p>Thanks a lot!</p>
  
  <p>EDIT: Solution</p>
  
  <p>With all the help I got (thanks!) I put this together:</p>
  
  <pre><code>getPosition(){
      if (viewer.scene.mode == 3) {
          var windowPosition = new Cesium.Cartesian2(viewer.container.clientWidth / 2, viewer.container.clientHeight / 2);
          var pickRay = viewer.scene.camera.getPickRay(windowPosition);
          var pickPosition = viewer.scene.globe.pick(pickRay, viewer.scene);
          var pickPositionCartographic = viewer.scene.globe.ellipsoid.cartesianToCartographic(pickPosition);
          console.log(pickPositionCartographic.longitude * (180 / Math.PI));
          console.log(pickPositionCartographic.latitude * (180 / Math.PI));
      } else if (viewer.scene.mode == 2) {
          var camPos = viewer.camera.positionCartographic;
          console.log(camPos.longitude * (180 / Math.PI));
          console.log(camPos.latitude * (180 / Math.PI));
      }
  };
  </code></pre>
  
  <p>This function gives longitude/latitude coordinates in degrees.</p>