Skip to content

NgtsHTML seems to ignore LOD (NgtsDetailed) #78

@ericleib

Description

@ericleib

It seems that when I put HTML inside an LOD with NgtsHTML, this HTML is always displayed, regardless of the distance.

For example, the following component displays a cube and an HTML element inside an LOD. The cube appears and disappears as expected when I zoom in and out. However, this has no effect on the visibility of the HTML element.

@Component({
  selector: 'app-test',
  template: `
    <ngts-detailed [distances]="[0, 5, 20]">
      <ngt-group/>
      <ngt-group>
        <ngt-mesh>
          <ngt-box-geometry />
          <ngt-mesh-basic-material />
        </ngt-mesh>
        <ngts-html [options]="{ position: [1,1,1] }">
          <div htmlContent>Hello world</div>
        </ngts-html>
      </ngt-group>
      <ngt-group/>
    </ngts-detailed>
  `,
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
  imports: [NgtsDetailed, NgtsHTML],
})
export class Test {}

I'd be happy to contribute a PR to solve this if you could point me in the right direction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions