Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MapLayers Widget] Map Layers widget breaks in 2d Viewport #1113

Open
afraj-attar opened this issue Dec 6, 2024 · 2 comments
Open

[MapLayers Widget] Map Layers widget breaks in 2d Viewport #1113

afraj-attar opened this issue Dec 6, 2024 · 2 comments

Comments

@afraj-attar
Copy link

When switching from 3d viewport to 2d viewport using the changeView and trying to click on the settings button in the Map layers widget breaks the widget.

20241206-1207-48.2026521.mp4

Expected Behaviour:
The Map layers widget should be disabled in 2d Viewer.

Current Behaviour:
The Map layers widget is enabled in the 2d Viewer.

Proposed Solution:
Along with subscribing to the useActiveViewport hook. We should also subscribe to the onChangeView listener.

Image

Version: 5.4.4
Version of iTwin.js: 4.8.0
Operating system: Windows
Browser: Chrome 131.0.6778.86

@afraj-attar afraj-attar changed the title [Map Layers Widget] Map Layers widget breaks in 2d Viewport [MapLayers Widget] Map Layers widget breaks in 2d Viewport Dec 6, 2024
@aruniverse
Copy link
Member

Shouldn't this be the responsibility of a the parent application who is providing/adding the map-layer-widget?

@jason-crow
Copy link
Contributor

I think after investigating a bit that the best approach is to mimic what property grid did with their handling of hiding their widget when the selection set is empty (found here)

which is to say the handling of this shouldn't be in the widget, but it should be in the UiItemsProvider in a wrapper of the widget provided therein because it should be the standard handling within the AppUi system that all consumers of the widget using AppUi would want to reuse

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants