Skip to content

Commit a85e314

Browse files
committed
fix: fix LayerAbstractRenderer resizeCanvas and compatibility with ThreeLayer
1 parent e4acdd4 commit a85e314

File tree

4 files changed

+4
-338
lines changed

4 files changed

+4
-338
lines changed

packages/fusion.gl/src/values/UniformAttr.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ import { include } from "../Utils";
33

44
const nonNaNArray = [];
55

6-
let warned = false;
7-
86
include(GLContext.prototype, {
97
bindAttribLocation(program, index, name) {
108
return this._gl.bindAttribLocation(program, index, name);
@@ -134,10 +132,7 @@ include(GLContext.prototype, {
134132
},
135133
uniformMatrix4fv(location, transpose, value) {
136134
if (!location) {
137-
if (!warned) {
138-
console.warn('UniformLocation invalid, null value encountered in browser:', navigator.userAgent);
139-
warned = true;
140-
}
135+
console.warn('UniformLocation invalid, null value encountered in browser:', navigator.userAgent);
141136
return;
142137
}
143138
value = this._checkMatrix4fvNaN(value);

packages/gl/src/layer/GroupGLLayerRenderer.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,8 @@ class GroupGLLayerRenderer extends CanvasCompatible(LayerAbstractRenderer) {
499499
this.regl = regl;
500500
this.reglGL = reglGL;
501501
this.gl = gl;
502+
// 为老的webgl插件提供兼容性
503+
this.canvas.gl = this.gl;
502504
this._jitter = [0, 0];
503505
const graphics = regl || device;
504506
this._groundPainter = new GroundPainter(graphics, this.layer);

packages/maptalks/src/renderer/layer/LayerAbstractRenderer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,7 @@ class LayerAbstractRenderer extends Class {
455455
this.initContext();
456456
} else if (isMapCanvasRenderer) {
457457
this.clearContext();
458+
this.resizeCanvas();
458459
}
459460
this.prepareContext();
460461
delete this._maskExtent;

0 commit comments

Comments
 (0)