Skip to content

Commit 65ad8ee

Browse files
committed
fix bug of map.viewMatrix
1 parent 2d2f436 commit 65ad8ee

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/map/Map.Camera.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -371,8 +371,7 @@ Map.include(/** @lends Map.prototype */{
371371
*/
372372
_calcMatrices: function () {
373373
// closure matrixes to reuse
374-
const m0 = createMat4(),
375-
m1 = createMat4();
374+
const m1 = createMat4();
376375
return function () {
377376
//必须先删除缓存的常用值,否则后面计算常用值时,会循环引用造成错误
378377
delete this._mapRes;
@@ -400,7 +399,7 @@ Map.include(/** @lends Map.prototype */{
400399
this.projMatrix = projMatrix;
401400

402401
// view matrix
403-
this.viewMatrix = mat4.invert(m0, worldMatrix);
402+
this.viewMatrix = mat4.invert(this.viewMatrix || createMat4(), worldMatrix);
404403
// matrix for world point => screen point
405404
this.projViewMatrix = mat4.multiply(this.projViewMatrix || createMat4(), projMatrix, this.viewMatrix);
406405
this._calcCascadeMatrixes();

0 commit comments

Comments
 (0)