From 4ce546b4ab27291f42863116a04261f958fb51f5 Mon Sep 17 00:00:00 2001 From: Natal Vande Casteele Date: Wed, 18 Jun 2025 20:20:25 +0200 Subject: [PATCH] Remove willReadFrequently hint --- src/ol/render/canvas/ExecutorGroup.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ol/render/canvas/ExecutorGroup.js b/src/ol/render/canvas/ExecutorGroup.js index 1920ea8f775..1d9435902e6 100644 --- a/src/ol/render/canvas/ExecutorGroup.js +++ b/src/ol/render/canvas/ExecutorGroup.js @@ -216,11 +216,14 @@ class ExecutorGroup { const newContext = !this.hitDetectionContext_; if (newContext) { + // Refrain from adding a 'willReadFrequently' hint in the options here. + // While it will remove the "Canvas2D: Multiple readback operations using + // getImageData are faster with the willReadFrequently attribute set + // to true" warnings in the console, it makes hitDetection extremely + // slow in Chrome when there are many features on the map this.hitDetectionContext_ = createCanvasContext2D( contextSize, contextSize, - undefined, - {willReadFrequently: false}, ); } const context = this.hitDetectionContext_;