refactor source

This commit is contained in:
thinkinggis 2019-06-18 20:10:10 +08:00
parent 19ff35a71a
commit 42fa9363a3
4 changed files with 6 additions and 6 deletions

View File

@ -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;
}

View File

@ -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) {

View File

@ -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(() => {

View File

@ -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;