Skip to content

v1.26.0 β€” Cesium 1.145 support + Viewer crash fix

Latest

Choose a tag to compare

@bnimit bnimit released this 03 Sep 07:37
e75965d

Monthly maintenance release picking up Cesium 1.145.0 (2026-09-01), plus a fix for a crash that affected every release since 1.21.1.

Highlights

fix β€” <Viewer> no longer crashes on mount under Webpack

If you are on Next.js 12 + Webpack, mounting <Viewer> threw immediately, even with no event handlers attached:

TypeError: Cannot read properties of undefined (reading 'onClick')

The source was always correct; the published bundle was not. EventManager's static event-type lookup was a self-reference to the class by name, which the bundler emitted as a named class expression whose minified name (e) collided with React's createContext import. Webpack's import rewriting doesn't honour the inner class-name binding, so the lookup resolved to the React namespace and returned undefined.

This affected 1.21.1 through 1.25.0. Vite consumers were never affected, which is why it went unnoticed for so long. If you pinned to an older version or applied a patch-package workaround, you can drop it now.

Reported and diagnosed β€” right down to the offending line β€” by @tedckh (#806, fixed in #811). Thank you!

A build-time check now fails the release if the same bundler pattern ever reappears.

feat β€” Cesium 1.145 draping props

Cesium 1.145 can drape vector geometry onto terrain and 3D Tiles rather than drawing it as free-standing geometry. Four components pick that up via heightReference:

  • BufferPolygonCollection
  • BufferPolylineCollection
  • MVTDataProvider
  • GeoJsonPrimitive
import { Viewer, GeoJsonPrimitive } from "resium";
import { HeightReference } from "cesium";

<Viewer full>
  <GeoJsonPrimitive url="/roads.geojson" heightReference={HeightReference.CLAMP_TO_GROUND} />
</Viewer>

CLAMP_TO_TERRAIN targets terrain, CLAMP_TO_3D_TILE targets 3D Tiles, and CLAMP_TO_GROUND targets both. Cesium requires a Scene alongside a clamping value β€” Resium supplies the enclosing Viewer / CesiumWidget scene automatically, so there is no scene prop to thread through.

BufferPolylineCollection also gains widthUnits: the default "pixels" keeps a line a constant thickness on screen, while "meters" measures it in world space so it scales with zoom.

Two caveats worth knowing:

  • GeoJsonPrimitive draping covers polylines and polygons only. Cesium 1.145 does not clamp points β€” Point features keep their original heights, and Cesium logs a one-time warning if you pass point data with a clamping value.
  • BufferPointCollection has no heightReference. Cesium added the option to the polygon and polyline collections only.

New Storybook examples: Draped for BufferPolygonCollection, BufferPolylineCollection and GeoJsonPrimitive, plus WidthInMeters.

docs

The component reference was silently omitting construction-only props β€” the generator matched type names by suffix and didn't recognise the ConstructorProps convention. 29 previously undocumented props across BufferPointCollection, BufferPolygonCollection, BufferPolylineCollection, CubeMapPanorama and EquirectangularPanorama now appear on the site.

Under the hood (bundled with #808)

  • Monthly dev-dep refresh: Storybook 10.5.10, Vite 8.2.2, Vitest 4.1.11, ESLint 10.9.1, vite-plugin-dts 5.1.0, @types/node 26.4.1, globby 16.2.4
  • Docs site: Astro 7.2.10, Starlight 0.41.11, sharp 0.35.4
  • .node-version 24.19.0 β†’ 24.20.0

Changes

  • feat: Support Cesium 1.145 β€” draping props (heightReference, widthUnits) + monthly dep refresh (#808)
  • fix: <Viewer> crash on mount under Next.js 12 + Webpack (#806, #811 β€” thanks @tedckh)

Install: npm install resium@1.26.0 (published to latest with npm provenance β€” verify with npm audit signatures).

Full diff: v1.25.0...v1.26.0