Skip to content

Commit

Permalink
fix(3dtiles): fix layer opacity and visibility change for 3d tiles pnts
Browse files Browse the repository at this point in the history
  • Loading branch information
jailln authored and mgermerie committed Dec 15, 2022
1 parent e1dbd63 commit 059fe5e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Provider/3dTilesProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as THREE from 'three';
import B3dmParser from 'Parser/B3dmParser';
import PntsParser from 'Parser/PntsParser';
import Fetcher from 'Provider/Fetcher';
import ReferLayerProperties from 'Layer/ReferencingLayerProperties';
import utf8Decoder from 'Utils/Utf8Decoder';

function b3dmToMesh(data, layer, url) {
Expand Down Expand Up @@ -29,6 +30,10 @@ function pntsParse(data, layer) {
layer.material.clone() :
new THREE.PointsMaterial({ size: 0.05, vertexColors: true });

// refer material properties in the layer so when layers opacity and visibility is updated, the material is
// automatically updated
ReferLayerProperties(material, layer);

// creation points with geometry and material
const points = new THREE.Points(result.point.geometry, material);

Expand Down

0 comments on commit 059fe5e

Please sign in to comment.