Viewer: CameraController.setCameraView, how to get the second signature of this overload?

Hello,
I would like to implement such a line to toggle to plan view :

cameraController.setCameraView(CanonicalView.top, true, 0);

But the CameraController.setCameraView function overloads three signatures. I have the feeling my code wants me to implement types of the first one, and therefore indicates this error on CanonicalView : Cannot find name ‘CanonicalView’.ts(2304)

How could i specify to use the second signature?

Thanks,
Raphaël

Hi @RaphaelVouilloz

As per the documentation, CanonicalView is not an enum but a type union. This means that you need to simply do

cameraController.setCameraView('top', true, 0);

Cheers

1 Like

Perfect it works, thank @alex

1 Like