iTwin / viewer-components-react

Components built on iTwin.js for usability in an iTwin.js based Viewer.
MIT License
24 stars 33 forks source link

Measure tools widget always loads but is blank. #184

Closed deanmarcussen closed 2 years ago

deanmarcussen commented 2 years ago

After upgrading to v3 the Measurements widget seems to always autoload, as a widget, but blank with nothing on it.

image

I forced upgraded to the implicit reference to 0.3.0 with no change.

Currently calling this as a workaround when the view is created, as I don't especially want the widget

UiItemsManager.unregister("MeasureToolsUiItemsProvider");
aruniverse commented 2 years ago

Hey Dean,

The widget is empty until you make an actual measurement and select it, at which point it will display the properties of the measurement. We'll look into only displaying it when a measurement is selected.

cc @bsteinbk , we should discuss how we want to handle these use cases

deanmarcussen commented 2 years ago

Cool, for my case, we prefer not to have the widget, we have too many custom ones already :)

I wasn’t sure if it was supposed to be part of the features set, as the timeline component moved to that arrangement and disappeared for a while until I discovered that.

also the readme says it still needs to be initialized, so maybe needs a tweak?

aruniverse commented 2 years ago

You can disable the widget along with the measure-tools by setting the defaultUiConfig prop to:

const defaultUiConfig: ItwinViewerUi = {
  contentManipulationTools: {
    verticalItems: {
      measureTools: false
    }
  }
};

The readme describes how to use the pkg individually. We add it to the itwin-viewer by default and initialize measure-tools in there, so it doesn't exactly apply

NancyMcCallB commented 2 years ago

@aruniverse The MeasureTools has to be responsible for hiding or showing based on contents. Here's an example in our providers test: https://github.com/iTwin/itwinjs-core/blob/master/test-apps/ui-items-providers-test/src/ui/widgets/SelectedElementDataWidget.tsx

aruniverse commented 2 years ago

@deanmarcussen , this should be fixed in the v0.7.0 of the measure-tools-react pkg

deanmarcussen commented 2 years ago

Thanks I'll try and get the upgrade to all out this week.