Options
All
  • Public
  • Public/Protected
  • All
Menu
description

A customized toolbar.

For example:

Example 1:

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 });

Example 2:

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]
);

Example 3:

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();

Hierarchy

  • Toolbar

Index

Constructors

Properties

activateMenuId?: string
menuList: Map<string, ToolbarMenu> = ...

Methods

  • addMenu(menuId: string, config: ToolbarMenuConfig, insertPosition?: [number, number]): void
  • description

    Add a custmized menu to toolbar.

    memberof

    Toolbar

    Parameters

    Returns void

  • clearActive(): void
  • Returns void

  • destroy(): void
  • Returns void

  • hide(): void
  • Returns void

  • keydown(e: KeyboardEvent): void
  • Parameters

    • e: KeyboardEvent

    Returns void

  • refresh(): void
  • description

    Update the whole toolbar element with the current configuration.

    memberof

    Toolbar

    Returns void

  • setActive(menuId: string, active: boolean): void
  • Parameters

    • menuId: string
    • active: boolean

    Returns void

  • show(): void
  • Returns void

  • description

    Modify the menu configuration and update the toolbar.

    memberof

    Toolbar

    Parameters

    Returns void

  • description

    Modify the menu configuration and update the toolbar.

    memberof

    Toolbar

    Parameters

    Returns void

Generated using TypeDoc