Skip to content

chore(web): bump @reearth/core to 0.0.7-alpha.72 for conditional Cesium Ion credit - #2290

Merged
ZTongci merged 10 commits into
mainfrom
feat/conditional-cesium-ion-credit
Jul 15, 2026
Merged

chore(web): bump @reearth/core to 0.0.7-alpha.72 for conditional Cesium Ion credit#2290
ZTongci merged 10 commits into
mainfrom
feat/conditional-cesium-ion-credit

Conversation

@ZTongci

@ZTongci ZTongci commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Overview

The Cesium-ion attribution logo was always displayed in the DataAttribution widget, even when the scene contained no Cesium-ion assets. This change removes Ion detection from the visualizer entirely — detection now happens inside the core's Map component, which already has direct access to property and layers, keeping Ion-awareness consistent with how credits are surfaced via getCredits.

What I've done

  • Removed cesiumIonDetection.ts and its unit tests from the visualizer.
  • Removed hasCesiumIonAsset prop from <CoreVisualizer> — no longer needed; core handles it internally.
  • Removed computeHasCesiumIonAsset from utils/index.ts.

What I haven't done

  • No changes to the DataAttribution widget itself — it already conditionally renders the logo based on whether credits.engine.cesium is present.

How I tested

Manually verified: default scene (OSM tile + reearth terrain) → logo hidden; switching to a Cesium Ion tile → logo appears; switching back → logo disappears after the next 3-second credit poll.

How to test the conditional Cesium Ion credit

The Cesium Ion logo in the bottom-right corner should appear only when at least one Cesium Ion asset is actively used in the scene.

Logo should appear when:

  • Tile type is set to cesium_ion (Scene settings → Tiles)
  • Terrain is enabled and type is cesium or cesiumion
  • A layer (3D Tiles, GeoJSON, etc.) has a URL pointing to assets.ion.cesium.com
  • An OSM Buildings layer is added (it uses Cesium Ion internally)
  • A Google Photorealistic 3D Tiles layer is added with provider set to cesium-ion

Logo should NOT appear when:

  • Tile type is open_street_map, googleSatellite or any non-Ion tile
  • Terrain is disabled, or type is url pointing to a non-Ion host
  • All layers use URLs outside of assets.ion.cesium.com

Quick manual test flow:

  1. Change the tile to CesiumIon → logo should appear within ~3 seconds.
  2. Change the tile to OpenStreetMap → logo should disappear within ~3 seconds.
  3. Add an OSM Buildings( Google Photorealistic 3D Tiles using Ion key) 3D Tiles layer → logo should reappear.
  4. Remove that layer → logo should disappear again.

Memo

Depends on the companion core PR: reearth/core#144

Checklist

  • Verified backward compatibility related to feature modifications (if not compatible, reported deployment notes to the next release owner).
  • Confirmed backward compatibility for migrations.
  • Verified that no personally identifiable information (PII) is included in any values that may be displayed.
  • Verified that all relevant documentation has been created or updated.

Compute hasCesiumIonAsset from the current viewer property and layers,
then pass it to CoreVisualizer so the engine omits the Cesium credit
when no Ion assets are loaded.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 6, 2026 05:27
@github-actions github-actions Bot added the web label Jul 6, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the web Visualizer to hide the Cesium-ion attribution logo unless the current scene actually uses Cesium-ion-backed assets, by computing a hasCesiumIonAsset signal (from viewer property + migrated layers) and passing it to the core visualizer.

Changes:

  • Add computeHasCesiumIonAsset(viewerProperty, layers) to detect Cesium-ion usage via tiles, terrain, and specific layer types.
  • Export the new detection utility from Visualizer/utils.
  • Compute hasCesiumIonAsset in Visualizer/index.tsx and pass it into <CoreVisualizer>.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
web/src/app/features/Visualizer/utils/index.ts Re-exports the new Cesium-ion detection helper.
web/src/app/features/Visualizer/utils/cesiumIonDetection.ts Implements Cesium-ion usage detection across tiles/terrain/layers.
web/src/app/features/Visualizer/index.tsx Computes hasCesiumIonAsset and forwards it to the core visualizer.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread web/src/app/features/Visualizer/utils/cesiumIonDetection.ts Outdated
Comment thread web/src/app/features/Visualizer/utils/cesiumIonDetection.ts Outdated
Comment thread web/src/app/features/Visualizer/utils/cesiumIonDetection.ts Outdated
- Recurse into LayerGroup children so nested Ion layers are detected
- Remove no-explicit-any by using LayerSimple type directly after type
  narrowing; fix googleMapApiKey access via serviceTokens
- Add unit tests covering tiles, terrain, layers, and nested groups

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ZTongci
ZTongci force-pushed the feat/conditional-cesium-ion-credit branch from 1318ab0 to d371e19 Compare July 6, 2026 09:10
ZTongci and others added 7 commits July 6, 2026 18:10
Ion asset detection was moved into core's Map component, which already
has access to both viewerProperty and layers. Visualizer no longer needs
to compute or pass hasCesiumIonAsset — it is now an implementation detail
of core.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ZTongci ZTongci changed the title feat(web): show Cesium-ion logo only when Ion assets are in use chore(web): bump @reearth/core to 0.0.7-alpha.72 for conditional Cesium Ion credit Jul 14, 2026
@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown

🚀 Cloud Run Preview Deployed

🔗 Click here to open the preview in a new tab

@ZTongci
ZTongci merged commit 33dae22 into main Jul 15, 2026
23 checks passed
@ZTongci
ZTongci deleted the feat/conditional-cesium-ion-credit branch July 15, 2026 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants