A customized toolbar.
For example:
Using updateMenu to modify the toolbar configuration
const toolbar = this.viewer.toolbar; toolbar.updateMenu(ToolbarMenuId.Viewpoint, { onActive: this.handleActive }); toolbar.updateMenu(ToolbarMenuId.Annotation, { visible: false });
Using addMenu to add a new menu to the toolbar with specific position.
const toolbar = this.viewer.toolbar; toolbar.addMenu( "newMenu", { icon: { default: "icon-new" }, menuName: "New menu item", controller: BimTreeController }, [2, 5] );
Modify the configuration in to custmize the toolbar directly, and then refresh the whole toolbar.
const toolbar = this.viewer.toolbar; const toolbarGroupConfig = [ [ToolbarMenuId.OrthoMode, ToolbarMenuId.FullScreen], [ToolbarMenuId.Measure, ToolbarMenuId.Section], [ToolbarMenuId.BimTree, ToolbarMenuId.Viewpoint, ToolbarMenuId.Annotation, ToolbarMenuId.Property], [ToolbarMenuId.Setting, "newMenu"], ]; toolbar.toolbarGroupConfig = toolbarGroupConfig; toolbar.refresh();
Add a custmized menu to toolbar.
Toolbar
Update the whole toolbar element with the current configuration.
Modify the menu configuration and update the toolbar.
Generated using TypeDoc
A customized toolbar.
For example:
Example 1:
Using updateMenu to modify the toolbar configuration
Example 2:
Using addMenu to add a new menu to the toolbar with specific position.
Example 3:
Modify the configuration in to custmize the toolbar directly, and then refresh the whole toolbar.