# Add Pitch to DEFAULT\_VIEW\_RECTANGLE

**URL:** <https://community.cesium.com/t/add-pitch-to-default-view-rectangle/7846>\
**Category:** CesiumJS\
**Created:** [December 26, 2018, 11:06pm UTC](https://community.cesium.com/t/add-pitch-to-default-view-rectangle/7846 "2018-12-26T23:06:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chase\_G](https://avatars.discourse-cdn.com/v4/letter/c/74df32/32.png) [@Chase\_G](https://community.cesium.com/u/Chase_G)\
**Post date:** [December 26, 2018, 11:06pm UTC](https://community.cesium.com/t/add-pitch-to-default-view-rectangle/7846/1 "2018-12-26T23:06:04Z")

</div>

I have the DEFAULT\_VIEW\_RECTANGLE set up and working as expected, however I would like to add a pitch to this view.

const rectangle = Cesium.Rectangle.fromDegrees(west, south, east, north);

Cesium.Camera.DEFAULT\_VIEW\_RECTANGLE = rectangle;  
Cesium.Camera.DEFAULT\_VIEW\_FACTOR = 0;

``

I can use setView() to control the default view that loads in, however I also want the Home button to go back to this view. Using the pitch below I get the default camera angle I want however clicking the Home button defaults to the DEFAULT\_VIEW\_RECTANGLE and I can not figure out how to either incorporate a pitch into that OR how to use the setView() as the default home.

camera.setView({  
destination: Cesium.Cartesian3.fromDegrees(-95, 15, 3500000),  
orientation: {  
heading: 0.0,  
pitch: Cesium.Math.toRadians(-62.5),  
roll: Cesium.Math.toRadians(0)  
}

``

Ultimately open to doing this another way, just want to have a default pitch when the viewer loads, and retain that pitch when you click the Home button.

Thank you,

Chase

\*Cesium 1.5.0 on Windows, using Chrome. \*

---

<div class="post-metadata">

**Author:** ![omar](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/omar/32/1999_2.png) [@omar](https://community.cesium.com/u/omar)\
**Post date:** [January 2, 2019, 6:53pm UTC](https://community.cesium.com/t/add-pitch-to-default-view-rectangle/7846/2 "2019-01-02T18:53:18Z")

</div>

I don’t see an easy way to override this in CesiumJS. I opened a GitHub issue inquiring about that here:

[https://github.com/AnalyticalGraphicsInc/cesium/issues/7450](https://github.com/AnalyticalGraphicsInc/cesium/issues/7450)

As I alluded there, my best guess is it might be easier to make your own button, and that way you can control exactly what the home view looks like. This is what the button does when clicked:

[https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Widgets/HomeButton/HomeButtonViewModel.js#L34-L36](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Widgets/HomeButton/HomeButtonViewModel.js#L34-L36)

And what the flyHome function does:

[https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Scene/Camera.js#L1286-L1297](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Scene/Camera.js#L1286-L1297)

---

<div class="post-metadata">

**Author:** ![Chase\_G](https://avatars.discourse-cdn.com/v4/letter/c/74df32/32.png) [@Chase\_G](https://community.cesium.com/u/Chase_G)\
**Post date:** [January 2, 2019, 8:06pm UTC](https://community.cesium.com/t/add-pitch-to-default-view-rectangle/7846/3 "2019-01-02T20:06:59Z")

</div>

Thank you Omar, I will try and create a custom button.
