Skip to content

Commit

Permalink
clean(Widget) C3DTiles widget clean
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinMachado committed Sep 12, 2023
1 parent 21da06d commit be4af8c
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions packages/browser/src/Widget/C3DTiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@ export class C3DTiles extends itownsWidget.Widget {
constructor(view, options) {
super(view, options, DEFAULT_OPTIONS);

/** @type {itowns.PlanarView} */
this.view = view;

/** @type {THREE.Box3Helper} */
this.displayedBBFeature = new THREE.Box3Helper(new THREE.Box3());
this.displayedBBFeature.visible = false;
view.scene.add(this.displayedBBFeature);

// cant click through the widget
this.domElement.onclick = (event) => event.stopImmediatePropagation();
Expand Down Expand Up @@ -138,9 +137,7 @@ export class C3DTiles extends itownsWidget.Widget {
while (this.c3DTFeatureInfoContainer.firstChild)
this.c3DTFeatureInfoContainer.firstChild.remove();

if (this.displayedBBFeature.parent)
this.displayedBBFeature.parent.remove(this.displayedBBFeature);

this.displayedBBFeature.visible = !!c3DTFeature;
this.c3DTFeatureInfoContainer.hidden = !c3DTFeature;

if (!c3DTFeature) return;
Expand Down Expand Up @@ -178,8 +175,6 @@ export class C3DTiles extends itownsWidget.Widget {
layer.computeWorldBox3(c3DTFeature, this.displayedBBFeature.box);
this.displayedBBFeature.updateMatrixWorld();

this.view.scene.add(this.displayedBBFeature);

// feature info
this.c3DTFeatureInfoContainer.appendChild(
createObjectDomElement(
Expand Down

0 comments on commit be4af8c

Please sign in to comment.