# Why Is the CesiumJS Globe Set to False in God's Eye View?

> Discover why the CesiumJS globe is disabled in God's Eye View. Learn how setting viewer.scene.globe.show to false prevents conflicts with custom 3D Tiles globes for a better visual experience.

- Repository: [Bilawal Sidhu/gods-eye-view](https://github.com/bilawalsidhu/gods-eye-view)
- Tags: deep-dive
- Published: 2026-09-09

---

**God's Eye View disables the native CesiumJS globe by setting `viewer.scene.globe.show = false` to prevent visual conflicts with the custom Google Photorealistic 3D Tiles globe that provides the application's primary global imagery.**

The open-source project `bilawalsidhu/gods-eye-view` intentionally hides CesiumJS's default globe rendering to avoid redundancy and rendering conflicts. This architectural decision ensures that only the custom globe stack—which leverages Google's Photorealistic 3D Tiles—renders global terrain and imagery, eliminating GPU waste and camera logic complexity.

## Primary Initialization in main.js

The CesiumJS globe is disabled immediately upon viewer initialization. In [`src/main.js`](https://github.com/bilawalsidhu/gods-eye-view/blob/main/src/main.js) at line 138, the application explicitly sets the visibility flag to `false` right after creating the viewer instance.

This ensures the default Cesium ellipsoid and imagery layers never render before the custom globe stack loads:

```javascript
import { Viewer } from 'cesium';

const viewer = new Viewer('cesiumContainer');

// Hide the default Cesium globe immediately
viewer.scene.globe.show = false;

```

By setting `viewer.scene.globe.show = false` at boot time, the application prevents any frame where the default blue sphere would be visible beneath the Photorealistic 3D Tiles.

## Dynamic Stack Management in mapStackController.js

The application dynamically toggles globe visibility based on the active map stack. In [`src/mapStackController.js`](https://github.com/bilawalsidhu/gods-eye-view/blob/main/src/mapStackController.js) at line 273, the `MapStackController` class manages whether the native Cesium globe should render depending on the selected base layer.

When a **non-globe stack** such as Google Photorealistic 3D Tiles is active, the code explicitly disables the globe:

```javascript
// Inside mapStackController.js when activating 3D Tiles stacks
this.viewer.scene.globe.show = false;

```

Conversely, when users switch to traditional **globe-only stacks** like OpenStreetMap or Esri World Imagery, the controller re-enables the native Cesium globe:

```javascript
// When activating OSM or Esri stacks
this.viewer.scene.globe.show = true;

```

This conditional logic ensures that exactly one globe—either Cesium's native ellipsoid or the custom 3D Tiles mesh—renders at any given time.

## Why the CesiumJS Globe Remains Hidden

Hiding the default Cesium globe serves three critical architectural purposes according to the source code and [`README.md`](https://github.com/bilawalsidhu/gods-eye-view/blob/main/README.md) documentation at line 135:

- **Eliminates visual duplication**: Google Photorealistic 3D Tiles provides its own globe geometry, textures, and terrain at all LODs. Rendering Cesium's built-in ellipsoid simultaneously would create z-fighting and visual artifacts.

- **Optimizes GPU resources**: Disabling the redundant globe prevents the GPU from processing two separate sets of globe geometry and texture tiles, conserving memory and improving frame rates.

- **Ensures consistent interaction logic**: Camera controllers, zoom-to-globe actions, and layer management systems assume a single globe entity. Keeping `viewer.scene.globe.show = false` standardizes the coordinate system and collision detection to use the custom stack exclusively.

## Re-enabling the Cesium Globe for Development

If you need to restore the native Cesium globe for debugging, comparison, or custom experiments, you can toggle the visibility flag at runtime. This is useful when testing tile loading issues or verifying coordinate transformations against the default ellipsoid:

```javascript
// Re-enable the native Cesium globe
viewer.scene.globe.show = true;

// To hide it again and return to the custom stack
viewer.scene.globe.show = false;

```

Note that enabling the native globe while Google Photorealistic 3D Tiles are active will result in two overlapping globes, which may cause rendering artifacts and increased GPU load.

## Summary

- **Initialization**: [`src/main.js`](https://github.com/bilawalsidhu/gods-eye-view/blob/main/src/main.js) sets `viewer.scene.globe.show = false` immediately after viewer creation to hide the default globe.
- **Dynamic control**: [`src/mapStackController.js`](https://github.com/bilawalsidhu/gods-eye-view/blob/main/src/mapStackController.js) toggles the flag based on whether the active stack provides its own globe geometry.
- **Replacement**: Google Photorealistic 3D Tiles replaces the Cesium globe entirely, providing photorealistic terrain and buildings.
- **Purpose**: The disable prevents visual duplication, saves GPU resources, and maintains clean interaction logic.
- **Reversibility**: Developers can re-enable the globe by setting `viewer.scene.globe.show = true` for testing or debugging purposes.

## Frequently Asked Questions

### Why does God's Eye View hide the default Cesium globe?

God's Eye View hides Cesium's default globe because the application renders a **Google Photorealistic 3D Tiles** globe instead. Showing both would create visual duplication and waste GPU resources on rendering two sets of global terrain data simultaneously.

### Can I enable the native Cesium globe without breaking the application?

Yes, you can temporarily enable it by setting `viewer.scene.globe.show = true` after initialization. However, doing so while Google 3D Tiles are active will cause overlapping geometry and potential rendering artifacts. It is safe for debugging but not recommended for production use.

### What replaces the Cesium globe when it is disabled?

When `viewer.scene.globe.show` is `false`, the **Google Photorealistic 3D Tiles** service provides the global base layer. This tileset includes its own globe geometry, imagery, and elevation data, eliminating the need for Cesium's built-in ellipsoid.

### Where is the globe visibility controlled in the codebase?

The primary controls are located in [`src/main.js`](https://github.com/bilawalsidhu/gods-eye-view/blob/main/src/main.js) at line 138 for initial hiding, and [`src/mapStackController.js`](https://github.com/bilawalsidhu/gods-eye-view/blob/main/src/mapStackController.js) at line 273 for dynamic toggling between different map stacks. The [`README.md`](https://github.com/bilawalsidhu/gods-eye-view/blob/main/README.md) at line 135 documents the design rationale for hiding the default globe.