mirror of https://gitee.com/antv-l7/antv-l7
refactor source
This commit is contained in:
parent
d3744aa252
commit
a15593bc12
|
@ -1,4 +1,4 @@
|
||||||
import * as THREE from '../../core/three';
|
|
||||||
import Material from './material';
|
import Material from './material';
|
||||||
import { getModule } from '../../util/shaderModule';
|
import { getModule } from '../../util/shaderModule';
|
||||||
export default class PointMaterial extends Material {
|
export default class PointMaterial extends Material {
|
||||||
|
@ -26,7 +26,7 @@ export default class PointMaterial extends Material {
|
||||||
this.vertexShader = vs;
|
this.vertexShader = vs;
|
||||||
this.fragmentShader = fs;
|
this.fragmentShader = fs;
|
||||||
this.transparent = true;
|
this.transparent = true;
|
||||||
if (!this.uniforms.shape) { this.blending = THREE.AdditiveBlending; }
|
// if (!this.uniforms.shape) { this.blending = THREE.AdditiveBlending; }
|
||||||
if (this.uniforms.u_texture) {
|
if (this.uniforms.u_texture) {
|
||||||
this.defines.TEXCOORD_0 = true;
|
this.defines.TEXCOORD_0 = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,8 +90,8 @@ export default class TileLayer extends Layer {
|
||||||
const zoom = Math.floor(this.scene.getZoom()) - 1;
|
const zoom = Math.floor(this.scene.getZoom()) - 1;
|
||||||
const minZoom = this.get('minZoom');
|
const minZoom = this.get('minZoom');
|
||||||
const maxZoom = this.get('maxZoom');
|
const maxZoom = this.get('maxZoom');
|
||||||
const minSourceZoom = this.get('minSourceZoom');
|
const minSourceZoom = this.tileSource.get('minSourceZoom');
|
||||||
const maxSourceZoom = this.get('maxSourceZoom');
|
const maxSourceZoom = this.tileSource.get('maxSourceZoom');
|
||||||
const currentZoom = this.scene.getZoom();
|
const currentZoom = this.scene.getZoom();
|
||||||
this.tileZoom = zoom > maxSourceZoom ? maxSourceZoom : zoom;
|
this.tileZoom = zoom > maxSourceZoom ? maxSourceZoom : zoom;
|
||||||
if (currentZoom < minZoom || currentZoom >= maxZoom || currentZoom < minSourceZoom) {
|
if (currentZoom < minZoom || currentZoom >= maxZoom || currentZoom < minSourceZoom) {
|
||||||
|
|
|
@ -55,7 +55,7 @@ export default class VectorTile extends Tile {
|
||||||
context.disable(context.STENCIL_TEST);
|
context.disable(context.STENCIL_TEST);
|
||||||
};
|
};
|
||||||
this._object3D.add(this.mesh);
|
this._object3D.add(this.mesh);
|
||||||
} else {
|
} else { // 如果是热力图
|
||||||
this._object3D = this.mesh;
|
this._object3D = this.mesh;
|
||||||
}
|
}
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|
|
@ -78,7 +78,7 @@ export default class TileSource extends Source {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
tileDestroy(tile) {
|
tileDestroy(tile) {
|
||||||
if (!tile || !tile.data || tile.loading) {
|
if (!tile || !tile.data || tile.loading || !tile.data.data.dataArray) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const tileData = tile.data;
|
const tileData = tile.data;
|
||||||
|
|
Loading…
Reference in New Issue