diff --git a/src/layers/weather/imageryOrder.js b/src/layers/weather/imageryOrder.js index dc65fd47ed..521b0dde3f 100644 --- a/src/layers/weather/imageryOrder.js +++ b/src/layers/weather/imageryOrder.js @@ -3,6 +3,15 @@ * (wind), infrared, radar, then lightning, independent of enable order, and * above the port's other layers (zOrder 0). */ +/** What each product's imagery shows (the imagery's `shows`): both cloud products are clouds. */ +export const WEATHER_IMAGERY_SHOWS = Object.freeze({ + wind: 'wind', + clouds: 'clouds', + 'clouds-regional': 'clouds', + radar: 'radar', + lightning: 'lightning', +}); + export const WEATHER_IMAGERY_Z = Object.freeze({ wind: 1, clouds: 2, diff --git a/src/layers/weather/rendering.js b/src/layers/weather/rendering.js index 5c69c35742..cd5fe09733 100644 --- a/src/layers/weather/rendering.js +++ b/src/layers/weather/rendering.js @@ -1,5 +1,5 @@ import { weatherTileUrl, closeWeatherPixels } from './source.js'; -import { WEATHER_IMAGERY_Z } from './imageryOrder.js'; +import { WEATHER_IMAGERY_SHOWS, WEATHER_IMAGERY_Z } from './imageryOrder.js'; import { imageryHostStatus } from './imageryHost.js'; import { globeImageryHost } from './shellRendering.js'; import { drawMosaicTile, createFrameTileFetch } from './rasterTiles.js'; @@ -503,6 +503,7 @@ function createGlobeRendering({ drawMosaicTile(texture, rectangle, tile, canvas), admit, zOrder: WEATHER_IMAGERY_Z[snapshot.product], + shows: WEATHER_IMAGERY_SHOWS[snapshot.product], } : { kind: 'xyz', @@ -545,6 +546,7 @@ function createGlobeRendering({ } : {}), zOrder: WEATHER_IMAGERY_Z[snapshot.product], + shows: WEATHER_IMAGERY_SHOWS[snapshot.product], }; // A shown, transparent layer lets the renderer request staging tiles // while the last complete observation stays visible underneath it. diff --git a/src/layers/weather/shellRendering.js b/src/layers/weather/shellRendering.js index 06972473c5..9719bac78c 100644 --- a/src/layers/weather/shellRendering.js +++ b/src/layers/weather/shellRendering.js @@ -9,6 +9,7 @@ import { } from '../../render/rendererOf.js'; import { acquireWeatherImage } from './infraredImage.js'; import { imageryHostStatus } from './imageryHost.js'; +import { WEATHER_IMAGERY_SHOWS } from './imageryOrder.js'; import { WEATHER_DETAIL_SIZE, WEATHER_IMAGE_SIZES } from './source.js'; import { msg } from '../../i18n/index.js'; @@ -257,6 +258,7 @@ export function createWeatherShell({ heightM: height, alpha, detail: null, + shows: WEATHER_IMAGERY_SHOWS[product], }); fieldAlpha = alpha; owed = true; diff --git a/src/layers/weather/weather.test.mjs b/src/layers/weather/weather.test.mjs index bd69eaee9a..4975af9ec4 100644 --- a/src/layers/weather/weather.test.mjs +++ b/src/layers/weather/weather.test.mjs @@ -1006,6 +1006,7 @@ test('global infrared is acquired before staging and cropped from one processed assert.equal(provider.spec.kind, 'canvas'); assert.equal(provider.spec.maxLevel, 3); assert.equal(provider.spec.tileSize, 256); + assert.equal(provider.spec.shows, 'clouds'); assert.equal(provider.spec.tiling, 'geographic'); assert.deepEqual(provider.spec.rectangle, snapshot.bounds); const first = await provider.requestImage(0, 0, 0); diff --git a/src/render/contract/draw.d.ts b/src/render/contract/draw.d.ts index 11a69a433c..8191d78f2a 100644 --- a/src/render/contract/draw.d.ts +++ b/src/render/contract/draw.d.ts @@ -584,6 +584,8 @@ export type FieldSpec = */ detail?: { image: ImageRef; rectangle: GeoRect } | null; alpha?: number; + /** What the raster shows, as imagery's `shows`. */ + shows?: string; }; export interface FieldHandle extends Handle { diff --git a/src/render/contract/globe.d.ts b/src/render/contract/globe.d.ts index 38516e66e4..3e0be1b9fa 100644 --- a/src/render/contract/globe.d.ts +++ b/src/render/contract/globe.d.ts @@ -122,6 +122,11 @@ export interface ImagerySpec { ) => Promise | undefined; /** Draw order among imagery layers; higher draws on top. */ zOrder?: number; + /** + * What the imagery shows, such as `'clouds'` or `'radar'`. Drawing never + * depends on it; a renderer may use it to tell such a layer apart. + */ + shows?: string; } export interface TimedUrl {