projectionPicker.viewModel.switchToOrthographic result in black screen

1. A concise explanation of the problem you're experiencing.

When loading viewer, i can't switch to Orthographic view using API
viewer.projectionPicker.viewModel.switchToOrthographic()

2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.

var viewer = new Cesium.Viewer('cesiumContainer', {
    projectionPicker: true,
});
viewer.projectionPicker.viewModel.switchToOrthographic();

3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

our app saves map projection and load it back up when restart

4. The Cesium version you're using, your operating system and browser.
1.51, Windows, Firefox (it works with Cesium 1.38)

I’m not able to recreate this. Here’s the Sandcastle link I’m using. I’m also testing on Windows with Firefox.

Do you get a black screen when you open that? What happens if you try and zoom in and pan? If you check the browser console are there any errors? Is it a completely black screen or are you able to see the widgets?

The behavior is different for me, no error in console. When i try to pan the map is back to normal
- on my Windows PC with Chrome, i see a black screen. With Firefox, the map zoom very close to earth. Upon mouse pan, the globe goes back to normal
- on my home PC with chrome, i see the map zoom close to globe. With Firefox or Edge, it shows half of the globe and the other half is in odd shape.

So it might depend on the graphic card as well.

I do get the same behavior of the camera started out zoomed too far in. This might just be a matter of a corner case of switching projection modes before the initial loading. A workaround might be to wait for all the initial tiles in view to load like this:

var viewer = new Cesium.Viewer(‘cesiumContainer’, {
projectionPicker: true,
});

var globe = viewer.scene.globe;
var initialized = false;
globe.tileLoadProgressEvent.addEventListener(function(){
if (globe.tilesLoaded && initialized === false) {
initialized = true;
viewer.projectionPicker.viewModel.switchToOrthographic();
}
});

``