diff --git a/src/layers/extruded-path-layer/extruded-path-layer.ts b/src/layers/extruded-path-layer/extruded-path-layer.ts index 0502ea5..3f3fae9 100644 --- a/src/layers/extruded-path-layer/extruded-path-layer.ts +++ b/src/layers/extruded-path-layer/extruded-path-layer.ts @@ -4,6 +4,8 @@ import { vs } from "./extruded-path-layer-vertex.glsl"; import { Geometry, Model } from "@luma.gl/engine"; import type { Accessor, Color } from "@deck.gl/core"; import { TransitionSettings } from "@deck.gl/core/dist/lib/attribute/transition-settings"; +import { NumberArray, TypedArray } from "@math.gl/types"; +import * as _ from "lodash"; export type ExtrudedPathLayerProps = PathLayerProps & { /** @@ -14,9 +16,15 @@ export type ExtrudedPathLayerProps = PathLayerProps & { }; const ATTRIBUTE_TRANSITION: Partial = { - enter: (value: number[], chunk?: number[]) => { + enter: (value: NumberArray, chunk?: NumberArray) => { + if (!_.isTypedArray(chunk)) { + return value; + } + return chunk?.length - ? chunk.subarray(chunk.length - value.length) + ? ((chunk as unknown as TypedArray).subarray( + chunk.length - value.length, + ) as unknown as NumberArray) : value; }, };