Skip to main content

drawLayer

  • Signature : (stage: Stage) => void

redraw the shapes layer, the canvas on which we draw shapes. This method is useful to batch updates applied on shapes config.

How to get stage object ?

You can get the stage object using the getStage available on AnnotationViewer and AnnotationLens

Example#

const stageObject = useRef()
const triggerLayerRedraw = () => {  drawLayer(stageObject.current)}
return (  <AnnotationViewer    getStage={getStage}    // other props  />)