Skip to content

Commit 74a0ae4

Browse files
committed
fix: cross origin image requests
1 parent 857e76c commit 74a0ae4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/components/layer.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ function Layer({ optimizedRendering, zIndex = 0, resolution, visible = true, aut
207207

208208
const images = React.useMemo(() => {
209209
const backgroundImage = new Image();
210+
backgroundImage.crossOrigin = "Anonymous";
210211
return { backgroundImage };
211212
}, []);
212213

@@ -226,6 +227,7 @@ function Layer({ optimizedRendering, zIndex = 0, resolution, visible = true, aut
226227
if (!backgroundImage) return;
227228
if (!CACHED_IMAGES.has(backgroundImage)) {
228229
const image = new Image();
230+
image.crossOrigin = "Anonymous";
229231
image.onload = () => {
230232
if (!mountedRef.current) return;
231233
setShouldRenderKey((shouldRenderKey) => {

0 commit comments

Comments
 (0)