Skip to content

Commit a58fb0a

Browse files
committed
fix map.viewMatrix
1 parent b904a48 commit a58fb0a

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
@@ -334,8 +334,7 @@ Map.include(/** @lends Map.prototype */{
334334
*/
335335
_calcMatrices: function () {
336336
// closure matrixes to reuse
337-
const m0 = createMat4(),
338-
m1 = createMat4();
337+
const m1 = createMat4();
339338
return function () {
340339
//必须先删除缓存的常用值,否则后面计算常用值时,会循环引用造成错误
341340
delete this._mapRes;
@@ -363,7 +362,7 @@ Map.include(/** @lends Map.prototype */{
363362
this.projMatrix = projMatrix;
364363

365364
// view matrix
366-
this.viewMatrix = mat4.invert(m0, worldMatrix);
365+
this.viewMatrix = mat4.invert(this.viewMatrix || createMat4(), worldMatrix);
367366
// matrix for world point => screen point
368367
this.projViewMatrix = mat4.multiply(this.projViewMatrix || createMat4(), projMatrix, this.viewMatrix);
369368
this._calcCascadeMatrixes();

0 commit comments

Comments
 (0)