diff --git a/src/layers/src/arc-layer/arc-layer.ts b/src/layers/src/arc-layer/arc-layer.ts index 674dae6b8d..a4f6861d8b 100644 --- a/src/layers/src/arc-layer/arc-layer.ts +++ b/src/layers/src/arc-layer/arc-layer.ts @@ -533,14 +533,19 @@ export default class ArcLayer extends Layer { const useArrowLayer = Boolean(this.geoArrowVector0); let ArcLayerClass: typeof DeckArcLayer | typeof GeoArrowArcLayer = DeckArcLayer; - let deckLayerData = data.data; - let getSourcePosition = data.getPosition; - let getTargetPosition = data.getPosition; + let experimentalPropOverrides: { + data?: arrow.Table; + getSourcePosition?: arrow.Vector; + getTargetPosition?: arrow.Vector; + } = {}; + if (useArrowLayer) { ArcLayerClass = GeoArrowArcLayer; - deckLayerData = dataset.dataContainer.getTable(); - getSourcePosition = this.geoArrowVector0; - getTargetPosition = this.geoArrowVector1; + experimentalPropOverrides = { + data: dataset.dataContainer.getTable(), + getSourcePosition: this.geoArrowVector0, + getTargetPosition: this.geoArrowVector1 + }; } return [ @@ -549,9 +554,7 @@ export default class ArcLayer extends Layer { ...defaultLayerProps, ...this.getBrushingExtensionProps(interactionConfig, 'source_target'), ...data, - data: deckLayerData, - getSourcePosition, - getTargetPosition, + ...experimentalPropOverrides, widthScale, updateTriggers, extensions: [ diff --git a/src/layers/src/line-layer/line-layer.ts b/src/layers/src/line-layer/line-layer.ts index 804b5783a5..b840fbcdd4 100644 --- a/src/layers/src/line-layer/line-layer.ts +++ b/src/layers/src/line-layer/line-layer.ts @@ -1,6 +1,8 @@ // SPDX-License-Identifier: MIT // Copyright contributors to the kepler.gl project +import * as arrow from 'apache-arrow'; + import {BrushingExtension} from '@deck.gl/extensions'; import {GeoArrowArcLayer} from '@kepler.gl/deckgl-arrow-layers'; @@ -272,14 +274,19 @@ export default class LineLayer extends ArcLayer { const useArrowLayer = Boolean(this.geoArrowVector0); let LineLayerClass: typeof EnhancedLineLayer | typeof GeoArrowArcLayer = EnhancedLineLayer; - let deckLayerData = data.data; - let getSourcePosition = data.getPosition; - let getTargetPosition = data.getPosition; + let experimentalPropOverrides: { + data?: arrow.Table; + getSourcePosition?: arrow.Vector; + getTargetPosition?: arrow.Vector; + } = {}; + if (useArrowLayer) { LineLayerClass = GeoArrowArcLayer; - deckLayerData = dataset.dataContainer.getTable(); - getSourcePosition = this.geoArrowVector0; - getTargetPosition = this.geoArrowVector1; + experimentalPropOverrides = { + data: dataset.dataContainer.getTable(), + getSourcePosition: this.geoArrowVector0, + getTargetPosition: this.geoArrowVector1 + }; } return [ @@ -288,9 +295,7 @@ export default class LineLayer extends ArcLayer { ...defaultLayerProps, ...this.getBrushingExtensionProps(interactionConfig, 'source_target'), ...data, - data: deckLayerData, - getSourcePosition, - getTargetPosition, + ...experimentalPropOverrides, ...layerProps, updateTriggers, extensions: [