Default View Options not Applied on First Render

I’m using Cesium.Camera.DEFAULT_VIEW_FACTOR and Cesium.Camera.DEFAULT_VIEW_RECTANGLE to set initial extent in my 2D map. The first time my map renders, these values exist and are set properly, but the display does not reflect that. When I call a function to reload my viewer, then the display reflects the default view values.

How can I ensure that the default view values are properly applied to the viewer the first time it is rendered?

First Render:

After Viewer Reloads:

 Cesium.Camera.DEFAULT_VIEW_FACTOR = view;
 Cesium.Camera.DEFAULT_VIEW_RECTANGLE = rectangle;

  var viewer = new Cesium.Viewer("cesiumContainer");
1 Like

@sarah1

I apologize for the late response. This post somehow flew under my radar.

Thank you for sharing this with the community! This is strange behavior that I would like to investigate further. Can you please share a complete sandcastle demo that showcases this issue? Are you switching between a 2D and 3D view? I would love to try this out on my machine.

-Sam

Same problem ;(

Do you have any solution?

Regards,
Jose

@protonjm

Thank you for your follow-up! If possible, could you please provide some of the details that I asked for above? This information would really help me start debugging the issue.

-Sam

Hmm. Those two maps are not the same, though. What do you mean by “render”? Are you calling the actual renderer, or is this a browser refresh thing? Do you have the actual code you could share in a Sandcastle? Otherwise helping you is rather tricky.

Cheers,

Alex