File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { MapViewState, PickingInfo } from "@deck.gl/core";
44import { DeckGLRef } from "@deck.gl/react" ;
55import type { IWidgetManager } from "@jupyter-widgets/base" ;
66import { NextUIProvider } from "@nextui-org/react" ;
7+ import debounce from "lodash.debounce" ;
78import throttle from "lodash.throttle" ;
89import * as React from "react" ;
910import { useCallback , useEffect , useRef , useState } from "react" ;
@@ -193,6 +194,11 @@ function App() {
193194 onClick : onMapClickHandler ,
194195 onHover : onMapHoverHandler ,
195196 ...( isDefined ( useDevicePixels ) && { useDevicePixels } ) ,
197+ // This is a hack to force a react re-render when the canvas is resized
198+ // https://github.com/developmentseed/lonboard/issues/994
199+ // until the upstream is resolved:
200+ // https://github.com/visgl/deck.gl/issues/9666
201+ onResize : debounce ( updateStateCallback , 100 ) ,
196202 onViewStateChange : ( event ) => {
197203 setViewState ( sanitizeViewState ( views , event . viewState ) ) ;
198204 } ,
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ export type MapRendererProps<ViewsT extends ViewOrViews = ViewOrViews> = Pick<
1313 | "layers"
1414 | "onClick"
1515 | "onHover"
16+ | "onResize"
1617 | "onViewStateChange"
1718 | "parameters"
1819 | "pickingRadius"
You can’t perform that action at this time.
0 commit comments