From 42fa9363a3f5fce4f9647a837c2d09fe94926867 Mon Sep 17 00:00:00 2001 From: thinkinggis Date: Tue, 18 Jun 2019 20:10:10 +0800 Subject: [PATCH] refactor source --- src/geom/material/pointMaterial.js | 4 ++-- src/layer/tile/tileLayer.js | 4 ++-- src/layer/tile/vectorTile.js | 2 +- src/source/tileSource.js | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/geom/material/pointMaterial.js b/src/geom/material/pointMaterial.js index 8f848190f0..c4bd19bc0b 100644 --- a/src/geom/material/pointMaterial.js +++ b/src/geom/material/pointMaterial.js @@ -1,4 +1,4 @@ -import * as THREE from '../../core/three'; + import Material from './material'; import { getModule } from '../../util/shaderModule'; export default class PointMaterial extends Material { @@ -26,7 +26,7 @@ export default class PointMaterial extends Material { this.vertexShader = vs; this.fragmentShader = fs; this.transparent = true; - if (!this.uniforms.shape) { this.blending = THREE.AdditiveBlending; } + // if (!this.uniforms.shape) { this.blending = THREE.AdditiveBlending; } if (this.uniforms.u_texture) { this.defines.TEXCOORD_0 = true; } diff --git a/src/layer/tile/tileLayer.js b/src/layer/tile/tileLayer.js index 9b46575721..867429d6a3 100644 --- a/src/layer/tile/tileLayer.js +++ b/src/layer/tile/tileLayer.js @@ -90,8 +90,8 @@ export default class TileLayer extends Layer { const zoom = Math.floor(this.scene.getZoom()) - 1; const minZoom = this.get('minZoom'); const maxZoom = this.get('maxZoom'); - const minSourceZoom = this.get('minSourceZoom'); - const maxSourceZoom = this.get('maxSourceZoom'); + const minSourceZoom = this.tileSource.get('minSourceZoom'); + const maxSourceZoom = this.tileSource.get('maxSourceZoom'); const currentZoom = this.scene.getZoom(); this.tileZoom = zoom > maxSourceZoom ? maxSourceZoom : zoom; if (currentZoom < minZoom || currentZoom >= maxZoom || currentZoom < minSourceZoom) { diff --git a/src/layer/tile/vectorTile.js b/src/layer/tile/vectorTile.js index 6508081caf..0f3d9d6564 100644 --- a/src/layer/tile/vectorTile.js +++ b/src/layer/tile/vectorTile.js @@ -55,7 +55,7 @@ export default class VectorTile extends Tile { context.disable(context.STENCIL_TEST); }; this._object3D.add(this.mesh); - } else { + } else { // 如果是热力图 this._object3D = this.mesh; } setTimeout(() => { diff --git a/src/source/tileSource.js b/src/source/tileSource.js index 1c85a7c26b..24488e982f 100644 --- a/src/source/tileSource.js +++ b/src/source/tileSource.js @@ -78,7 +78,7 @@ export default class TileSource extends Source { }); } tileDestroy(tile) { - if (!tile || !tile.data || tile.loading) { + if (!tile || !tile.data || tile.loading || !tile.data.data.dataArray) { return; } const tileData = tile.data;