Antv L7
antvis/L7
Comprehensive guide for AntV L7 geospatial visualization library.
CesiumJS imagery layers - ImageryProvider, ImageryLayer, ImageryLayerCollection, WMS, WMTS, Bing, OpenStreetMap, ArcGIS, Mapbox, tile discard policies.
$ npx skills add CesiumGS/cesiumjs-skills --skill cesiumjs-imagery -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install CesiumGS/cesiumjs-skills cesiumjs-imagery --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/CesiumGS/cesiumjs-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/cesiumjs-imagery .claude/skills/cesiumjs-imagery && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "cesiumjs-imagery" agent skill from https://github.com/CesiumGS/cesiumjs-skills/tree/main/skills/cesiumjs-imagery into .claude/skills/cesiumjs-imagery/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cesiumjs-imagery", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/CesiumGS/cesiumjs-skills/tree/main/skills/cesiumjs-imageryType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add CesiumGS/cesiumjs-skills --skill cesiumjs-imagery -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install CesiumGS/cesiumjs-skills cesiumjs-imagery --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/CesiumGS/cesiumjs-skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/cesiumjs-imagery .agents/skills/cesiumjs-imagery && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "cesiumjs-imagery" agent skill from https://github.com/CesiumGS/cesiumjs-skills/tree/main/skills/cesiumjs-imagery into .agents/skills/cesiumjs-imagery/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cesiumjs-imagery", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add CesiumGS/cesiumjs-skills --skill cesiumjs-imagery -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install CesiumGS/cesiumjs-skills cesiumjs-imagery --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/CesiumGS/cesiumjs-skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/cesiumjs-imagery .cursor/skills/cesiumjs-imagery && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "cesiumjs-imagery" agent skill from https://github.com/CesiumGS/cesiumjs-skills/tree/main/skills/cesiumjs-imagery into .cursor/skills/cesiumjs-imagery/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cesiumjs-imagery", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/CesiumGS/cesiumjs-skills.git --path skills/cesiumjs-imagery--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add CesiumGS/cesiumjs-skills --skill cesiumjs-imagery -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install CesiumGS/cesiumjs-skills cesiumjs-imagery --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/CesiumGS/cesiumjs-skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/cesiumjs-imagery .gemini/skills/cesiumjs-imagery && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "cesiumjs-imagery" agent skill from https://github.com/CesiumGS/cesiumjs-skills/tree/main/skills/cesiumjs-imagery into .gemini/skills/cesiumjs-imagery/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cesiumjs-imagery", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install CesiumGS/cesiumjs-skills cesiumjs-imageryInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add CesiumGS/cesiumjs-skills --skill cesiumjs-imagery -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/CesiumGS/cesiumjs-skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/cesiumjs-imagery .github/skills/cesiumjs-imagery && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "cesiumjs-imagery" agent skill from https://github.com/CesiumGS/cesiumjs-skills/tree/main/skills/cesiumjs-imagery into .github/skills/cesiumjs-imagery/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cesiumjs-imagery", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add CesiumGS/cesiumjs-skills --skill cesiumjs-imagery -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install CesiumGS/cesiumjs-skills cesiumjs-imagery --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/CesiumGS/cesiumjs-skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/cesiumjs-imagery .opencode/skills/cesiumjs-imagery && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "cesiumjs-imagery" agent skill from https://github.com/CesiumGS/cesiumjs-skills/tree/main/skills/cesiumjs-imagery into .opencode/skills/cesiumjs-imagery/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cesiumjs-imagery", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
cesiumjs-imageryCesiumJS imagery layers - ImageryProvider, ImageryLayer, ImageryLayerCollection, WMS, WMTS, Bing, OpenStreetMap, ArcGIS, Mapbox, tile discard policies.
Cesiumjs Imagery is an agent skill from CesiumGS/cesiumjs-skills. CesiumJS imagery layers - ImageryProvider, ImageryLayer, ImageryLayerCollection, WMS, WMTS, Bing, OpenStreetMap, ArcGIS, Mapbox, tile discard policies. Use when adding or swapping base map layers, configuring imagery providers, layering multiple map sources, or creating split-screen imagery comparisons.
Its SKILL.md is about 5.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It works with Mapbox. The repository describes itself as: Curated agent skills for CesiumJS development. The licence is Apache-2.0.
8 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 5f4792c. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are javascript).
From the folder's file list and the shell code blocks in SKILL.md.
Hosts in commands or code, which the agent is likely to contact:
tile.openstreetmap.orggibs.earthdata.nasa.govbasemap.nationalmap.govservices.arcgisonline.comdev.virtualearth.netFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Cesiumjs Imagery loads about 5.2k tokens when it runs. Until then it costs about 80 tokens; SKILL.md has 1,273 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from CesiumGS/cesiumjs-skills at commit 5f4792c, republished under its Apache-2.0 licence (© CesiumGS). 1,273 words, ~5,249 tokens.
.claude/skills/cesiumjs-imagery/SKILL.md (or your agent's skills folder).CesiumJS v1.144 -- Imagery providers supply raster tile data rendered on the Globe or draped over a Cesium3DTileset. The three core abstractions are ImageryProvider (fetches tiles), ImageryLayer (display settings), and ImageryLayerCollection (ordered stack on the globe).
ImageryProvider (abstract -- fetches tile images)
-> ImageryLayer (wraps one provider; alpha, brightness, split, etc.)
-> ImageryLayerCollection (ordered stack; index 0 = base layer)
-> Globe / Cesium3DTilesetLayers render bottom-to-top. Index 0 is the base layer, stretched to fill the globe even if its rectangle does not cover the entire world.
When creating a viewer for imagery work, disable unneeded widgets so the imagery
is the visual focus. Use camera.setView (not flyTo) when you need the camera
in position immediately — flyTo animates and may not finish before your code
continues.
import { Viewer, ImageryLayer, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, Math as CesiumMath } from "cesium";
// Clean viewer -- disable widgets that distract from imagery
const viewer = new Viewer("cesiumContainer", {
baseLayer: new ImageryLayer(new OpenStreetMapImageryProvider({
url: "https://tile.openstreetmap.org/",
maximumLevel: 18,
})),
baseLayerPicker: false,
animation: false,
timeline: false,
navigationHelpButton: false,
navigationInstructionsInitiallyVisible: false,
});
// Position camera immediately (no animation)
viewer.camera.setView({
destination: Cesium.Cartesian3.fromDegrees(-73.0, 41.0, 1500000),
orientation: {
heading: 0.0,
pitch: CesiumMath.toRadians(-90), // look straight down
roll: 0.0,
},
});
// Public URL-backed overlay
const nightLayer = new ImageryLayer(new UrlTemplateImageryProvider({
url: "https://gibs.earthdata.nasa.gov/wmts/epsg3857/best/VIIRS_CityLights_2012/default/default/GoogleMapsCompatible_Level8/{z}/{y}/{x}.jpeg",
maximumLevel: 8,
credit: "NASA GIBS",
}));
nightLayer.alpha = 0.5;
nightLayer.brightness = 2.0;
viewer.imageryLayers.add(nightLayer);Use IonImageryProvider and ImageryLayer.fromWorldImagery only when the
runtime has the required Cesium ion entitlement. For public/no-token examples,
prefer OpenStreetMap, ArcGIS, NASA GIBS, WMS, WMTS, or URL-template providers.
Use camera.setView with these approximate heights:
| Scale | Height (m) | Example |
|---|---|---|
| Street / block | 500–2,000 | Downtown intersection |
| City | 5,000–25,000 | Washington DC, Paris |
| Metro area | 50,000–200,000 | Greater London |
| Region / state | 300,000–1,500,000 | Florida, Japan |
| Continent | 3,000,000–8,000,000 | Europe, North America |
For top-down (map-style) views set pitch: CesiumMath.toRadians(-90).
For oblique 3D views set pitch: CesiumMath.toRadians(-35) to CesiumMath.toRadians(-60).
Default to top-down framing when a scenario names a specific country, city, or region. It keeps the named feature centered without perspective skew. Oblique high-altitude views can easily show a neighboring landmass because the target falls outside the view frustum.
Frame named places by their actual longitude and latitude, not a nearby guess.
Use camera.setView with Cartesian3.fromDegrees(lon, lat, height) and a
top-down pitch unless the prompt explicitly asks for an oblique view.
| Place | lon, lat | Suggested height |
|---|---|---|
| London | -0.12, 51.50 | 60,000 |
| Paris | 2.35, 48.86 | 30,000 |
| New York City | -74.00, 40.71 | 60,000 |
| New York-Boston corridor | -72.5, 41.5 | 800,000 |
| Washington DC, National Mall | -77.03, 38.89 | 25,000 |
| Florida peninsula | -81.5, 28.0 | 1,500,000 |
| Grand Canyon | -112.5, 36.3 | 200,000 |
| Hawaiian Islands | -157.0, 20.5 | 1,800,000 |
| Iceland | -19.0, 64.9 | 1,200,000 |
| Italy peninsula | 12.5, 42.0 | 2,500,000 |
| Southern Europe split view | 13.0, 42.0 | 4,500,000 |
| Greenland | -42.0, 72.0 | 5,000,000 |
| Japan, Honshu | 138.0, 36.5 | 2,500,000 |
Access via viewer.imageryLayers (same as viewer.scene.imageryLayers).
const layers = viewer.imageryLayers;
layers.add(myLayer); // add on top
layers.add(myLayer, 0); // add at index
layers.addImageryProvider(provider); // create layer + add
layers.raise(myLayer); // move up one
layers.lower(myLayer); // move down one
layers.raiseToTop(myLayer); // move to top
layers.lowerToBottom(myLayer); // move to bottom
layers.remove(myLayer); // remove and destroy
layers.remove(myLayer, false); // remove without destroying
layers.removeAll();
const count = layers.length;
const base = layers.get(0);
const idx = layers.indexOf(myLayer);
const has = layers.contains(myLayer);Events: layerAdded(layer, index), layerRemoved(layer, index),
layerMoved(layer, newIndex, oldIndex), layerShownOrHidden(layer, index, show).
Properties accept a number or a per-tile callback (frameState, layer, x, y, level) => value.
| Property | Default | Notes |
|---|---|---|
alpha | 1.0 | 0 = transparent, 1 = opaque |
brightness | 1.0 | < 1 darker, > 1 brighter |
contrast | 1.0 | < 1 lower, > 1 higher |
hue | 0.0 | Shift in radians |
saturation | 1.0 | < 1 desaturated, > 1 oversaturated |
gamma | 1.0 | Gamma correction |
show | true | Visibility toggle |
splitDirection | SplitDirection.NONE | LEFT, RIGHT, or NONE |
nightAlpha / dayAlpha | 1.0 | Requires Globe.enableLighting |
Additional options: rectangle, minimumTerrainLevel / maximumTerrainLevel,
cutoutRectangle, colorToAlpha / colorToAlphaThreshold,
minificationFilter / magnificationFilter (LINEAR default, or NEAREST).
// Adjust appearance at runtime
layer.alpha = 0.7;
layer.brightness = 1.3;
layer.contrast = 1.5;
layer.saturation = 0.5;
layer.gamma = 1.2;Remove the default base layer and replace it at index 0. The replacement becomes the new base layer, stretched to fill the globe.
import { ImageryLayer, OpenStreetMapImageryProvider } from "cesium";
// Remove default Bing aerial
viewer.imageryLayers.remove(viewer.imageryLayers.get(0));
// Add OSM as new base layer at index 0
const osmLayer = new ImageryLayer(
new OpenStreetMapImageryProvider({
url: "https://tile.openstreetmap.org/",
maximumLevel: 19,
credit: "OpenStreetMap contributors",
}),
);
viewer.imageryLayers.add(osmLayer, 0);When a scenario asks for a light or everyday basemap, do not use night-lights, dark-canvas, or satellite-night tiles as the base layer. Those render as mostly black pixels and visibly fail the requirement. Reliable public light basemaps:
https://tile.openstreetmap.org/)https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png)Reserve VIIRS_CityLights_2012, BlackMarble, and CANVAS_DARK for overlays
on top of a light base, or for scenes that explicitly call for a night view.
Requires Cesium ion asset access. Do not use in public/no-token examples unless the caller explicitly asks for an ion imagery asset.
// Always use fromAssetId (async factory); never call constructor directly
const layer = ImageryLayer.fromProviderAsync(
IonImageryProvider.fromAssetId(3812),
);
viewer.imageryLayers.add(layer);Extends UrlTemplateImageryProvider for Slippy tile servers.
const osm = new OpenStreetMapImageryProvider({
url: "https://tile.openstreetmap.org/",
maximumLevel: 19,
credit: "OpenStreetMap contributors",
// retinaTiles: true, // request @2x tiles
});
viewer.imageryLayers.addImageryProvider(osm);The most flexible provider. Placeholders: {x}, {y}, {z}, {s},
{reverseX/Y/Z}, {west/south/east/northDegrees},
{west/south/east/northProjected}, {width}, {height}.
import { UrlTemplateImageryProvider, GeographicTilingScheme, buildModuleUrl } from "cesium";
// TMS-style with Geographic tiling
const tms = new UrlTemplateImageryProvider({
url: buildModuleUrl("Assets/Textures/NaturalEarthII") + "/{z}/{x}/{reverseY}.jpg",
tilingScheme: new GeographicTilingScheme(),
maximumLevel: 5,
});
viewer.imageryLayers.addImageryProvider(tms);
// Carto Positron with subdomains
const positron = new UrlTemplateImageryProvider({
url: "https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png",
subdomains: "abcd",
credit: "Map tiles by CartoDB, under CC BY 3.0. Data by OpenStreetMap, under ODbL.",
});
// Custom tags for time-varying data
const custom = new UrlTemplateImageryProvider({
url: "https://yourserver/{Time}/{z}/{y}/{x}.png",
customTags: {
Time: (imageryProvider, x, y, level) => "20240101",
},
});import { WebMapServiceImageryProvider, ImageryLayer, Rectangle } from "cesium";
const wms = new WebMapServiceImageryProvider({
url: "https://basemap.nationalmap.gov:443/arcgis/services/USGSHydroCached/MapServer/WMSServer",
layers: "0",
rectangle: Rectangle.fromDegrees(-180, -90, 180, 90),
// parameters: { transparent: true, format: "image/png" },
// crs: "EPSG:4326", // WMS >= 1.3.0
// srs: "EPSG:4326", // WMS 1.1.x
});
viewer.imageryLayers.add(new ImageryLayer(wms));Required options: url, layer, style, tileMatrixSetID.
import { WebMapTileServiceImageryProvider, Credit } from "cesium";
const wmts = new WebMapTileServiceImageryProvider({
url: "https://basemap.nationalmap.gov/arcgis/rest/services/USGSShadedReliefOnly/MapServer/WMTS",
layer: "USGSShadedReliefOnly",
style: "default",
format: "image/jpeg",
tileMatrixSetID: "default028mm",
maximumLevel: 19,
credit: new Credit("U. S. Geological Survey"),
});
viewer.imageryLayers.addImageryProvider(wmts);GetFeatureInfo (1.140+, #13196): WebMapTileServiceImageryProvider now supports
pickFeatures for both KVP and RESTful WMTS services. Enable it with the new
constructor options enablePickFeatures, getFeatureInfoFormats,
getFeatureInfoUrl, and getFeatureInfoParameters; then call
provider.pickFeatures(x, y, level, longitude, latitude) (the same signature WMS
uses) to query attributes at a location.
import { ArcGisMapServerImageryProvider, ArcGisMapService, ArcGisBaseMapType, ImageryLayer } from "cesium";
ArcGisMapService.defaultAccessToken = "<YOUR_ARCGIS_TOKEN>";
// From basemap type enum: SATELLITE, OCEANS, HILLSHADE
const arcgis = ImageryLayer.fromProviderAsync(
ArcGisMapServerImageryProvider.fromBasemapType(ArcGisBaseMapType.SATELLITE),
);
viewer.imageryLayers.add(arcgis);
// From a specific MapServer URL
const streets = ImageryLayer.fromProviderAsync(
ArcGisMapServerImageryProvider.fromUrl(
"https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer",
),
);import { BingMapsImageryProvider, BingMapsStyle, ImageryLayer } from "cesium";
const bing = ImageryLayer.fromProviderAsync(
BingMapsImageryProvider.fromUrl("https://dev.virtualearth.net", {
key: "<YOUR_BING_KEY>",
mapStyle: BingMapsStyle.AERIAL_WITH_LABELS_ON_DEMAND,
}),
);
viewer.imageryLayers.add(bing);Styles: AERIAL, AERIAL_WITH_LABELS_ON_DEMAND, ROAD_ON_DEMAND,
CANVAS_DARK, CANVAS_LIGHT, CANVAS_GRAY.
import { MapboxStyleImageryProvider, ImageryLayer } from "cesium";
const mapbox = new MapboxStyleImageryProvider({
styleId: "streets-v11",
accessToken: "<YOUR_MAPBOX_TOKEN>",
// tilesize: 512, scaleFactor: true // retina
});
viewer.imageryLayers.add(new ImageryLayer(mapbox));import { SingleTileImageryProvider, ImageryLayer, Rectangle } from "cesium";
const logo = ImageryLayer.fromProviderAsync(
SingleTileImageryProvider.fromUrl("/images/overlay.png", {
rectangle: Rectangle.fromDegrees(-75.0, 28.0, -67.0, 29.75),
}),
);
viewer.imageryLayers.add(logo);1.140+ (#13297):
OffscreenCanvasis now an acceptedImageryTypesvalue, so you can feed a worker-rendered or dynamically-drawnOffscreenCanvaswherever an image source is expected -- useful for procedurally generated or live-updating overlays without round-tripping through a data URL.
import { ImageryLayer, SplitDirection, UrlTemplateImageryProvider } from "cesium";
// Add an overlay that only appears on the left side of the split
const nightLayer = new ImageryLayer(new UrlTemplateImageryProvider({
url: "https://gibs.earthdata.nasa.gov/wmts/epsg3857/best/VIIRS_CityLights_2012/default/default/GoogleMapsCompatible_Level8/{z}/{y}/{x}.jpeg",
maximumLevel: 8,
}));
nightLayer.splitDirection = SplitDirection.LEFT;
viewer.imageryLayers.add(nightLayer);
viewer.scene.splitPosition = 0.5; // 0-1 fraction of viewport widthSplitDirection: LEFT (-1), NONE (0), RIGHT (1).
When splitting two basemaps and the prompt names a country or region, center the camera on that region before setting the split. A split view that lands on a neighboring landmass fails the framing intent regardless of which side the overlay covers.
import { Rectangle } from "cesium";
// Cover the full named region. Florida peninsula needs roughly -87..-80 lon,
// 24..31 lat; a narrow strip or off-center box will miss the visual target.
const cutout = Rectangle.fromDegrees(-87.6, 24.5, -80.0, 31.0);
// Cut a hole in the base layer to reveal imagery beneath
const base = viewer.imageryLayers.get(0);
base.cutoutRectangle = cutout;Size cutouts to match the full extent of the feature being revealed. For peninsulas, states, or islands, use a rectangle that spans the named feature in both longitude and latitude, then center the camera on the same region so the revealed hole sits in the middle of the frame.
colorToAlpha removes pixels matching a target color; colorToAlphaThreshold
controls how aggressively similar colors are removed. The default threshold is
too tight for night-lights overlays where the "black" background varies
tile-to-tile. Use a noticeably higher threshold so the light base actually
shows through.
import { Color } from "cesium";
// On a VIIRS-style night-lights overlay added above an OSM base
const overlay = viewer.imageryLayers.get(1);
overlay.colorToAlpha = new Color(0.0, 0.016, 0.059); // dark ocean blue
overlay.colorToAlphaThreshold = 0.2; // generous toleranceIf the result still looks predominantly dark, raise the threshold further
(roughly 0.3-0.5) or lower the overlay alpha. For a translucent or brightened
overlay, set both layer.alpha < 1.0 and layer.brightness > 1.0 explicitly.
import { Cesium3DTileset, ImageryLayer, IonImageryProvider } from "cesium";
const tileset = await Cesium3DTileset.fromUrl("/path/to/tileset.json");
viewer.scene.primitives.add(tileset);
const labelLayer = ImageryLayer.fromProviderAsync(
IonImageryProvider.fromAssetId(2411391),
);
tileset.imageryLayers.add(labelLayer); // drape on tileset, not globe
labelLayer.show = false; // toggle offWhen demonstrating imagery draped on a public sample tileset, zoom out enough to frame the whole tileset so the imagery is visible across the model surface, not just one close-up section.
Since 1.144, feature-info picking also works for layers draped on tilesets:
the Viewer InfoBox and ImageryLayerCollection.pickImageryLayerFeatures fall
back to tileset.imageryLayers when the globe pick finds nothing, so a
WMS/WMTS layer configured with enablePickFeatures returns metadata on 3D
Tiles surfaces too (see the WMTS GetFeatureInfo options under Imagery
Providers).
import { TileCoordinatesImageryProvider, GridImageryProvider, ImageryLayer, Color } from "cesium";
// Show x/y/level labels on every tile
viewer.imageryLayers.add(new ImageryLayer(
new TileCoordinatesImageryProvider({ color: Color.YELLOW }),
));
// Wireframe grid overlay
viewer.imageryLayers.add(new ImageryLayer(new GridImageryProvider()));| Policy | Behavior |
|---|---|
DiscardEmptyTileImagePolicy | Discards zero-byte images (Bing Maps default) |
DiscardMissingTileImagePolicy | Compares pixels against a known "missing" tile |
NeverTileDiscardPolicy | Never discards (use when server always returns valid tiles) |
import { NeverTileDiscardPolicy, UrlTemplateImageryProvider } from "cesium";
const provider = new UrlTemplateImageryProvider({
url: "https://my-server/{z}/{x}/{y}.png",
tileDiscardPolicy: new NeverTileDiscardPolicy(),
});const layer = ImageryLayer.fromProviderAsync(IonImageryProvider.fromAssetId(3812));
viewer.imageryLayers.add(layer);
// Provider creation failure
layer.errorEvent.addEventListener((error) => {
console.error("Layer creation failed:", error);
});
// Provider resolved -- listen for per-tile errors
if (layer.readyEvent) {
layer.readyEvent.addEventListener((provider) => {
provider.errorEvent.addEventListener((tileError) => {
console.warn("Tile error:", tileError.message);
});
});
}Only wait on readyEvent when you need explicit readiness/error wiring. For
ordinary static map scenes, add the layer and frame the camera immediately so
missing or version-specific readiness events do not break the render path.
Pass clock and times (a TimeIntervalCollection) for time-varying layers.
Keep the timeline and animation viewer widgets enabled when the scenario
calls for a time-dynamic layer; the rendered clock controls are the clearest
visual evidence that the time interval wiring is active.
import { WebMapTileServiceImageryProvider, TimeIntervalCollection, JulianDate, Credit } from "cesium";
const times = TimeIntervalCollection.fromIso8601({
iso8601: "2015-07-30/2017-06-16/P1D",
dataCallback: (interval) => ({ Time: JulianDate.toIso8601(interval.start) }),
});
const weather = new WebMapTileServiceImageryProvider({
url: "https://gibs.earthdata.nasa.gov/wmts/epsg4326/best/AMSR2_Snow_Water_Equivalent/default/{Time}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png",
layer: "AMSR2_Snow_Water_Equivalent", style: "default",
tileMatrixSetID: "2km", maximumLevel: 5, format: "image/png",
clock: viewer.clock, times: times,
credit: new Credit("NASA Global Imagery Browse Services for EOSDIS"),
});
viewer.imageryLayers.addImageryProvider(weather);hasAlphaChannel: false on opaque providers to reduce memory and upload time.minimumTerrainLevel / maximumTerrainLevel to skip tile fetches at irrelevant zoom levels.ImageryLayer.fromProviderAsync over manual await -- avoids blank globe during provider load.rectangle bounds on regional providers to prevent out-of-extent tile requests.destroy: false and re-add instead of recreating.NeverTileDiscardPolicy when tiles are always valid; pixel comparison adds overhead.createWorldImageryAsync© CesiumGS, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in skills/cesiumjs-imagery of CesiumGS/cesiumjs-skills.
Open the folder on GitHubat commit 5f4792c
Cesiumjs Imagery next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Cesiumjs Imagery this skillCesiumGS/cesiumjs-skills | 189 | — | ~5.2k | Automated safety check: Pass | Apache-2.0 | |
| Antv L7antvis/L7 | 4.1k | — | ~1.4k | Automated safety check: Pass | MIT | |
| Antv L7antvis/L7 | 4.1k | — | ~4.4k | Automated safety check: Pass | MIT | |
| Releasegeoman-io/maplibre-geoman | 127 | — | ~1.2k | Automated safety check: Pass | MIT | |
| Checkalamenai/terrae | 244 | — | ~1.1k | Automated safety check: Pass | MIT | |
| Docsalamenai/terrae | 244 | — | ~576 | Automated safety check: Pass | MIT |
antvis/L7
Comprehensive guide for AntV L7 geospatial visualization library.
antvis/L7
基于 WebGL 的大规模地理空间数据可视化引擎。适用于: (1) 创建交互式 WebGL 地图应用 (2) 可视化地理空间数据(点、线、面、热力图) (3) 构建位置数据驾驶舱 (4) 添加地图图层、交互和动画效果 (5) 处理并展示 GeoJSON、CSV 等空间数据
geoman-io/maplibre-geoman
Cut a release of the free maplibre-geoman / mapbox-geoman packages (bump versions, finalize CHANGELOG, tag, publish to npm).
alamenai/terrae
Verify all outputs exist after creating a new component and fix any issues
alamenai/terrae
Generate or update documentation for Terrae components. An agent skill from alamenai/terrae.
maplibre/maplibre-agent-skills
Migrating from Mapbox GL JS to MapLibre GL JS — package and import changes, removing the access token, choosing tile sources, plugin equivalents, and what you gain or give up.
CesiumGS/cesiumjs-skills
CesiumJS 3D Tiles - Cesium3DTileset, compressed and CAD-style glTF content, MVTDataProvider, UrlTemplate3DTilesDataProvider, styling, metadata, feature picking, voxels, point clouds, I3S, Gaussian…
CesiumGS/cesiumjs-skills
CesiumJS core utilities and networking - Resource, Color, Event, Request, RequestScheduler, error handling, helper functions, feature detection.
CesiumGS/cesiumjs-skills
CesiumJS materials and post-processing — Material, Fabric JSON, MaterialAppearance, ImageBasedLighting, PostProcessStage, PostProcessStageLibrary, bloom, depth of field, ambient occlusion, FXAA…
CesiumGS/cesiumjs-skills
CesiumJS spatial math - Cartesian3, Cartographic, Matrix4, Quaternion, Transforms, Ellipsoid, BoundingSphere, projections, coordinate conversions.
CesiumGS/cesiumjs-skills
CesiumJS terrain, globe, and environment - TerrainProvider, Globe, sampleTerrain, atmosphere, sky, fog, lighting, shadows, panoramas.
CesiumGS/cesiumjs-skills
CesiumJS viewer setup - Viewer, CesiumWidget, widgets, Ion token, Scene configuration, SceneMode, factory helpers, geocoders, platform services.
Works with
CesiumJS imagery layers - ImageryProvider, ImageryLayer, ImageryLayerCollection, WMS, WMTS, Bing, OpenStreetMap, ArcGIS, Mapbox, tile discard policies. Cesiumjs Imagery is an agent skill from CesiumGS/cesiumjs-skills. CesiumJS imagery layers - ImageryProvider, ImageryLayer, ImageryLayerCollection, WMS, WMTS, Bing, OpenStreetMap, ArcGIS, Mapbox, tile discard policies.
Cesiumjs Imagery fits situations like: swapping base map layers; configuring imagery providers; layering multiple map sources; creating split-screen imagery comparisons.
Run `npx skills add CesiumGS/cesiumjs-skills --skill cesiumjs-imagery -a claude-code`. Or copy the skill folder (skills/cesiumjs-imagery in CesiumGS/cesiumjs-skills) into .claude/skills/cesiumjs-imagery in your project. Claude Code loads it when a task matches its description.
Run `npx skills add CesiumGS/cesiumjs-skills --skill cesiumjs-imagery -a codex`. Or copy the skill folder (skills/cesiumjs-imagery in CesiumGS/cesiumjs-skills) into .agents/skills/cesiumjs-imagery in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add CesiumGS/cesiumjs-skills --skill cesiumjs-imagery -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/cesiumjs-imagery, .gemini/skills/cesiumjs-imagery, .github/skills/cesiumjs-imagery and .opencode/skills/cesiumjs-imagery in your project.
SKILL.md names no scripts, command-line tools or credentials: Cesiumjs Imagery is instructions for the agent only. Our summary lists: A credential in YOUR_ARCGIS_TOKEN; A credential in YOUR_BING_KEY.
SKILL.md names 5 domains. In commands or code: tile.openstreetmap.org, gibs.earthdata.nasa.gov, basemap.nationalmap.gov, services.arcgisonline.com and dev.virtualearth.net; the agent is likely to contact these when it follows the instructions. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Cesiumjs Imagery is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 5.2k tokens (SKILL.md is roughly 21k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Cesiumjs Imagery: Antv L7 (antvis/L7, 4.1k stars), Antv L7 (antvis/L7, 4.1k stars), Release (geoman-io/maplibre-geoman, 127 stars) and Check (alamenai/terrae, 244 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
CesiumGS (a GitHub organization) maintains it in CesiumGS/cesiumjs-skills, which has 189 GitHub stars. The repository holds 14 skills in this directory. The repository was last updated on September 14, 2026.
Source: CesiumGS/cesiumjs-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.