cesiumgs/cesiumjs-skills/cesiumjs-viewer-setup
Claude Code and agent skill by cesiumgs/cesiumjs-skills
- community
Checking that the SKILL.md file is still in the repository.
CesiumJS viewer setup - Viewer, CesiumWidget, widgets, Ion token, Scene configuration, SceneMode, factory helpers, geocoders, platform services. Use when initializing a CesiumJS application, configuring viewer widgets, setting Ion access tokens, creating default terrain or imagery, or bootstrapping a 3D globe.
Install
npx vskill@latest install cesiumgs/cesiumjs-skills/cesiumjs-viewer-setupSKILL.md
CesiumJS Viewer & Scene Setup
Reference for bootstrapping CesiumJS applications: Viewer, CesiumWidget, Ion/GoogleMaps/ITwinPlatform configuration, widgets, factory helpers, geocoder services, viewer mixins, Credits, and related enums.
Quick Start
Required HTML: <div id="cesiumContainer" style="width:100%;height:100vh"></div>
Use Cesium ion defaults (Terrain.fromWorldTerrain, ImageryLayer.fromWorldImagery, createOsmBuildingsAsync, Google Photorealistic 3D Tiles) only when the target runtime has the required ion or Google entitlement. For public/no-token examples, choose explicit public providers and URL-backed 3D Tiles.
Framing Loaded Content (Critical)
After adding a tileset, model, or data source, you must explicitly frame it. A Viewer constructed with default options starts the camera at a fixed view of Earth. It does NOT auto-zoom to primitives you add. Forgetting this is the most common cause of "I see only gray surface" or "the asset is a speck in the corner" failures.
viewer.zoomTo / viewer.flyTo accept Entity, Entity[], EntityCollection, DataSource, ImageryLayer, Cesium3DTileset, VoxelPrimitive, Model, or TimeDynamicPointCloud. They use the target's bounding sphere, which works for tilesets with arbitrary local coordinate systems where computing an ECEF camera position by hand will miss the asset entirely.
When you do need an explicit camera position (e.g., to satisfy a heading/pitch specification), still use viewer.zoomTo(target, headingPitchRange) so the range is derived from the bounding sphere rather than guessed:
Ion & Platform Configuration
Cesium Ion
IonResource
Google Maps Platform
iTwin Platform (experimental)
Viewer Constructor Options
new Viewer(container, options?) -- container is a DOM element or its string ID.
Widget Toggles
| Option | Default | Purpose | |
|---|---|---|---|
animation | true | Playback controls | |
baseLayerPicker | true | Imagery/terrain switcher | |
fullscreenButton | true | Fullscreen toggle | |
vrButton | false | WebVR toggle | |
geocoder | IonGeocodeProviderType.DEFAULT | Search bar (false to hide) | |
homeButton | true | Reset to home view | |
infoBox | true | Entity info popup | |
sceneModePicker | true | 2D/3D/Columbus toggle | |
selectionIndicator | true | Selection reticle | |
timeline | true | Time scrubber | |
navigationHelpButton | true | Mouse/touch help | |
projectionPicker | false | Perspective/ortho toggle |
Scene & Rendering
| Option | Default | Purpose | |
|---|---|---|---|
sceneMode | SceneMode.SCENE3D | Initial scene mode | |
scene3DOnly | false | Lock to 3D, saves GPU memory per geometry instance | |
shadows | false | Shadow casting | |
terrainShadows | ShadowMode.RECEIVE_ONLY | Terrain shadow mode | |
requestRenderMode | false | Render only on changes | |
maximumRenderTimeChange | 0.0 | Max sim-time delta for render | |
msaaSamples | 4 | MSAA (1 to disable) | |
orderIndependentTranslucency | true | Translucent ordering | |
mapMode2D | MapMode2D.INFINITE_SCROLL | 2D scroll behavior |
Pair requestRenderMode: true with scene3DOnly: true for low-power / dashboard apps; both are commonly required together when the scenario calls for GPU savings.
Layers & Terrain
| Option | Default | Purpose | |
|---|---|---|---|
baseLayer | ImageryLayer.fromWorldImagery() | Base imagery (false for none; needs baseLayerPicker: false) | |
terrain | none | Async terrain helper (cannot combine with terrainProvider) | |
terrainProvider | EllipsoidTerrainProvider | Sync terrain provider | |
globe | new Globe() | false for no globe (space scenes) | |
skyBox | auto (WGS84) | false disables sky/sun/moon | |
skyAtmosphere | auto (WGS84) | false disables limb glow |
Minimal Viewer (No Widgets)
CesiumWidget (Lightweight Alternative)
No UI widgets, no Knockout dependency. Suitable for custom UIs or embedding.
SceneMode Enum
| Value | Description | |
|---|---|---|
SceneMode.SCENE3D | Standard 3D globe (default) | |
SceneMode.SCENE2D | Top-down orthographic map | |
SceneMode.COLUMBUS_VIEW | 2.5D flat map with height | |
SceneMode.MORPHING | Transitioning between modes |
Scene Configuration
Important: never touch `scene.globe.*` or `scene.skyAtmosphere.*` when the matching constructor option was set to `false`. Disabling these in the Viewer options leaves the corresponding property as undefined on the scene, and accessing .enableLighting, .depthTestAgainstTerrain, .show, or any other field throws TypeError: Cannot set properties of undefined. For space scenes, configure once in the constructor and do not mutate those properties afterward (see "Space Scene" below).
Factory Helpers
createOsmBuildingsAsync
createGooglePhotorealistic3DTileset
Terrain.fromWorldTerrain / fromWorldBathymetry
Preferred for the terrain constructor option. Non-blocking with error events.
Terrain Event Handling
createWorldTerrainAsync / createWorldImageryAsync
Lower-level: return raw providers. Use when you need the provider directly.
IonWorldImageryStyle: AERIAL (default) | AERIAL_WITH_LABELS | ROAD
Geocoder Configuration
The geocoder option accepts false, an IonGeocodeProviderType, or a GeocoderService[].
IonGeocodeProviderType: DEFAULT | GOOGLE (required with Google tiles) | BING
Custom GeocoderService
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/cesiumjs-viewer-setup/SKILL.md
Popularity
- Repository stars
- 76
- Repository forks
- 10
- 7-day trend score
- 22
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 30 May 2026, 5 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/cesiumgs/cesiumjs-skills/cesiumjs-viewer-setup)