diff --git a/src/scripts/domWidget.ts b/src/scripts/domWidget.ts index c329f35e3..e2429e062 100644 --- a/src/scripts/domWidget.ts +++ b/src/scripts/domWidget.ts @@ -56,6 +56,9 @@ export interface ComponentWidget export interface DOMWidgetOptions extends IWidgetOptions { + /** + * Whether to render a placeholder rectangle when zoomed out. + */ hideOnZoom?: boolean selectOn?: string[] onHide?: (widget: BaseDOMWidget) => void @@ -145,7 +148,7 @@ abstract class BaseDOMWidgetImpl widget_height: number, lowQuality?: boolean ): void { - if (this.options.hideOnZoom && lowQuality) { + if (this.options.hideOnZoom && lowQuality && this.isVisible()) { // Draw a placeholder rectangle const originalFillStyle = ctx.fillStyle ctx.beginPath()