Skip to content

Add a map-level debug flag for Cesium maps#2808

Open
robyngit wants to merge 3 commits intodevelopfrom
feature-2807-cesium-debug
Open

Add a map-level debug flag for Cesium maps#2808
robyngit wants to merge 3 commits intodevelopfrom
feature-2807-cesium-debug

Conversation

@robyngit
Copy link
Copy Markdown
Member

This PR adds a map-level debug as well as a show3DTilesInspector option to Cesium map config.

When debug: true is set, the Cesium widget now:

  • enables Cesium tile coordinate and grid imagery overlays
  • shows the FPS counter
  • hides globe skirts to make tile edges easier to inspect
  • logs loaded/rendered/removed layer details to the console
  • shows a small camera position overlay on the map

When show3DTilesInspector: true is set, the Cesium widget now:

  • renders Cesium's built-in 3D Tiles inspector widget
  • lazy-loads the inspector stylesheet only when the inspector is enabled

This change does not automatically enable layer-specific Cesium debug flags such as 3D Tiles debug properties passed through cesiumOptions.

It also adds a shared Utilities.formatFixedNumber() helper and uses it for the camera overlay formatting.

To test manually:

Debug mode:

  1. Configure a Cesium map with debug: true in its map config.
  2. Open a page that renders that Cesium map.
  3. Confirm the map shows:
    • tile coordinate labels
    • grid imagery overlay
    • FPS counter
    • camera position overlay
  4. Pan, zoom, and rotate the camera and confirm the camera overlay updates as the view changes.
  5. Open the browser console and confirm layer information is logged when the map loads.
  6. Set debug: false or remove the flag and confirm the debug overlays/counter/logging no longer appear.

3D Tiles inspector:

  1. Configure a Cesium map with show3DTilesInspector: true in its map config.
  2. Open a page that renders that Cesium map, ideally with a 3D Tiles layer.
  3. Confirm the 3D Tiles inspector appears in the top-right of the map.
  4. Expand and collapse inspector sections and confirm the widget is styled correctly.
  5. Use the inspector controls and confirm they affect the loaded 3D Tileset as expected.
  6. Disable show3DTilesInspector and confirm the inspector no longer appears.

When enabled, the Cesium widget now shows tile/grid debug imagery,
an FPS counter, a camera position overlay, and layer debug logging.
This also adds a shared fixed-number formatter in Utilities and
coverage for the new config and widget behavior.

Issue #2807
When enabled, the Cesium widget now renders Cesium's built-in
3D Tiles inspector and lazy-loads the inspector stylesheet through
MetacatUI's CSS loader.

Issue #2807
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant