Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.
fix: video export quality in single view not taken into account (#3516)
Igor Dykhta4e9d38133d44
diff --git a/src/components/src/modals/export-video-modal.spec.tsx b/src/components/src/modals/export-video-modal.spec.tsxindex f5b14f74c..66c3b4b53 100644--- a/src/components/src/modals/export-video-modal.spec.tsx+++ b/src/components/src/modals/export-video-modal.spec.tsx@@ -92,7 +92,7 @@ const DEFAULT_PROPS = {mediaType: 'webm',cameraPreset: 'None',fileName: 'kepler.gl',- resolution: '',+ resolution: '1280x720',durationMs: 1000},containerW: 800,diff --git a/src/components/src/modals/export-video-modal.tsx b/src/components/src/modals/export-video-modal.tsxindex a61fc5d68..eda6dc8b9 100644--- a/src/components/src/modals/export-video-modal.tsx+++ b/src/components/src/modals/export-video-modal.tsx@@ -376,39 +376,8 @@ const ExportVideoModalFactory = () => {[keplerState, onViewChange, mapboxApiAccessToken, mapboxApiUrl]);- const trueDevicePixelRatio = useRef(- typeof window !== 'undefined' ? window.devicePixelRatio : 1- );-const isSwipeMode = mapState.mapSplitMode === MapSplitMode.SWIPE_COMPARE && mapState.isSplit;- useEffect(() => {- // Block DPR changes during preview to keep basemap and deck.gl layers in sync.- // hubble.gl sets window.devicePixelRatio to scale render buffers, but this causes- // visual misalignment between MapLibre and DeckGL during animated preview.- // Skip in swipe mode — the swipe preview manages its own DPR for canvas compositing.- if (isSwipeMode) return;-- const trueDpr = trueDevicePixelRatio.current;- const descriptor = Object.getOwnPropertyDescriptor(window, 'devicePixelRatio');-- Object.defineProperty(window, 'devicePixelRatio', {- get: () => trueDpr,- set: () => {- // no-op: prevent hubble.gl from changing DPR during preview- },- configurable: true- });-- return () => {- if (descriptor) {- Object.defineProperty(window, 'devicePixelRatio', descriptor);- } else {- delete (window as any).devicePixelRatio;- }- };- }, [isSwipeMode]);-const onFilterFrameUpdate = useCallback((filterIdx: number, name: string, value: any) => {visStateActions.setFilterAnimationTime(filterIdx, name, value);diff --git a/src/reducers/src/ui-state-updaters.ts b/src/reducers/src/ui-state-updaters.tsindex 99558f2a5..34705d191 100644--- a/src/reducers/src/ui-state-updaters.ts+++ b/src/reducers/src/ui-state-updaters.ts@@ -231,7 +231,7 @@ export const DEFAULT_EXPORT_MAP: ExportMap = {* @property mediaType Default: `'webm'`* @property cameraPreset Default: `'None'`* @property fileName Default: `'kepler.gl'`- * @property resolution Default: `''`+ * @property resolution Default: `'1280x720'`* @property durationMs Default: `1000`* @public*/@@ -239,7 +239,7 @@ export const DEFAULT_EXPORT_VIDEO: ExportVideo = {mediaType: 'webm', // use webm as default as gif export tends to freeze on larger recordingscameraPreset: 'None',fileName: 'kepler.gl',- resolution: '',+ resolution: '1280x720',durationMs: 1000,swipeStartPct: 0,swipeEndPct: 100,