Skip to content

SkySchema

const SkySchema: ZodObject<{ atmosphere-blend: ZodOptional<ZodUnion<[ZodNumber, ZodType<any[], ZodTypeDef, any[]>]>>; fog-color: ZodOptional<ZodUnion<[ZodEffects<ZodString, string, string>, ZodType<any[], ZodTypeDef, any[]>]>>; fog-ground-blend: ZodOptional<ZodUnion<[ZodNumber, ZodType<any[], ZodTypeDef, any[]>]>>; horizon-color: ZodOptional<ZodUnion<[ZodEffects<ZodString, string, string>, ZodType<any[], ZodTypeDef, any[]>]>>; horizon-fog-blend: ZodOptional<ZodUnion<[ZodNumber, ZodType<any[], ZodTypeDef, any[]>]>>; sky-color: ZodOptional<ZodUnion<[ZodEffects<ZodString, string, string>, ZodType<any[], ZodTypeDef, any[]>]>>; sky-horizon-blend: ZodOptional<ZodUnion<[ZodNumber, ZodType<any[], ZodTypeDef, any[]>]>>; }, "strip", ZodTypeAny, { atmosphere-blend?: number | any[]; fog-color?: string | any[]; fog-ground-blend?: number | any[]; horizon-color?: string | any[]; horizon-fog-blend?: number | any[]; sky-color?: string | any[]; sky-horizon-blend?: number | any[]; }, { atmosphere-blend?: number | any[]; fog-color?: string | any[]; fog-ground-blend?: number | any[]; horizon-color?: string | any[]; horizon-fog-blend?: number | any[]; sky-color?: string | any[]; sky-horizon-blend?: number | any[]; }>

Defined in: packages/core/src/schemas/map.schema.ts:672

Sky, horizon, fog, and globe atmosphere (U15, ml-chh.7) — the style spec’s root sky.

Every property is the spec’s own, spelled the spec’s way, and each takes a value or a zoom expression. Style half: live, map.setSky; on export it compiles verbatim to the style.json root (class exports).

Runtime minimums: sky needs maplibre-gl 4.5.0 (Map#setSky); on an older runtime it warns once and the map renders without it. atmosphere-blend only draws under projection: { type: globe }, so it needs 5.0.0 in practice. The sky itself is only visible when the camera can see the horizon — a pitched map — and fog only affects 3D terrain.

sky:
sky-color: "#199EF3"
horizon-color: "#ffffff"
fog-color: "#ffffff"
sky-horizon-blend: 0.5
horizon-fog-blend: 0.5
fog-ground-blend: 0.1

Style spec: sky