xeokit/xeokit-bim-viewer

Fix disabling of measurements

xeolabs opened this issue · 1 comments

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

this._enableMeasurements = (cfg.enableMeasurements !== false);

it is also correctly used to reduce the toolbar template here

toolbarElement.innerHTML = createToolbarTemplate({enableMeasurements: this._enableMeasurements});

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

this._measureDistanceTool = new MeasureDistanceTool(this, {
buttonElement: toolbarElement.querySelector(".xeokit-measure-distance"),
active: false
});
this._measureAngleTool = new MeasureAngleTool(this, {
buttonElement: toolbarElement.querySelector(".xeokit-measure-angle"),
active: false
});

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?