Closed kolmar1991 closed 1 year ago
Hi @kolmar1991
viewer.zoomTo()
and the viewer will zoom to the full extent of the modelHi Martin, Thank you very much for the response and sorry for my delay.
this.viewer.on('loaded', event => { this.viewer.zoomTo(74810); })
I'm getting following error:
Error: Orthographic view height has to be a positive number at t.set (xbim-viewer.min.bundle.js:1) at Function.t.findView (xbim-viewer.min.bundle.js:1) at t.zoomTo (xbim-viewer.min.bundle.js:1)
If I invoke zoomTo later (e.g. using button) it works perfect. In previous version xViewer it worked fine.
loaded
event is probably fired before camera properties are initialised from the model values. I'll try to have a look at it, but it won't be immediate as I have too many other things to do. But it should be an easy one to find and fix. The loaded
event is fired here and the exception is being thrown here.
Any contributions are most welcome.
Thank you Martin. I don't feel a javascript expert however I will try to look at it if I find time in the next weekend.
Hi @martin1cerny , I wasn't able to fix the issue. However, I was able to find a workaround which might be helpful while looking for a bug. Calling 'viewer.zoomTo()' and then calling 'viewer.zoomTo(4329)' doesn't cause any exception and it zooms the element perfectly.
You may want to set more optional arguments to speed up your initial navigation:
viewer.zoomTo(4329, undefined, false, false);
This will disable animation for the initial navigation and will not try to figure out the best visibility angle for the view. Which is where it fails now, because some values are not properly initialised before the first draw.
Hi! I'm trying to update xbim library in my project. I have a couple minor problems.
New one:
Old one:
Best regards!