xeokit / xeokit-bim-viewer

A browser-based BIM viewer, built on the xeokit SDK
https://xeokit.github.io/xeokit-bim-viewer
Other
413 stars 359 forks source link

Fix disabling of measurements #181

Closed xeolabs closed 6 months ago

xeolabs commented 6 months ago

From user:

I want to disable measurements. There is a flag I can set when initiating the viewer, it is called enableMeasurements. It is correctly interpreted here

https://github.com/xeokit/xeokit-bim-viewer/blob/0d94309049d721005a7b72ddb85bfabb8e84e47b/src/BIMViewer.js#L256

it is also correctly used to reduce the toolbar template here

https://github.com/xeokit/xeokit-bim-viewer/blob/0d94309049d721005a7b72ddb85bfabb8e84e47b/src/BIMViewer.js#L274

But later in the constructor, it is not used to restrict the initialisation of the measurement tools here

https://github.com/xeokit/xeokit-bim-viewer/blob/0d94309049d721005a7b72ddb85bfabb8e84e47b/src/BIMViewer.js#L417-L425

Instead, the querySelector returns an undefined, the buttonElement is undefined and the constructor throws an exception.

Can we fix that soonish, so that we can use the new version of the viewer but without the measurement tools, until we found a solution to prevent the overflow?

xeolabs commented 6 months ago

Fixed in https://github.com/xeokit/xeokit-bim-viewer/releases/tag/v2.5.1-beta-26