Class: Workspace

bu.Workspace

The workspace is the core component of BlomUrbex API. It manages a collection of several bu.Viewer arranged in a bu.Layout.

var workspace = new bu.Workspace({
    layout: {
        name: 'Dual view',
        views: [
            {
                column: 0, 
                viewer: new bu.ortho.OpenLayersViewer({
                    center: [0, 0],
                    zoom: 1
                    layers: [
                        "OSM"
                    ],
                    baselayer: bu.Orientation.ORTHO
                 })
            },
            {
                column: 1,
                viewer: new bu.street.MarzipanoViewer({
                    swfPath: 'swf/marzipano.swf'
                })
            }
      ]
  },
  target: 'workspace'
});

The above snippet creates a workspace inside a div element with id 'workspace' and initializes it with a dual-view layout in two columns using an ortho view for the first column and a street view for the second column.

The constructor places a viewport container (with CSS class name bu-workspace-viewport) in the target element (see getViewerContainer()), and then several containers inside the viewport, one per each different value of column property (with a CSS class name bu-workspace-container) and finally several subcontainers inside the previous ones, one per each view with same column value (with a CSS class name bu-workspace-subcontainer). This simple but powerful method allow the creation of complex layouts.

Constructor

new Workspace(options)

Parameters:
Name Type Description
options bu.WorkspaceOptions

Workspace options.

Source:

Extends

  • ol.Object

Methods

disposeInternal()

Source:

getLayout() → {bu.Layout}

Get the layout using bu.ViewType in the definition.

Source:
Returns:

The current layout.

Type
bu.Layout

getTarget() → {Element|string|undefined}

Get the target in which the workspace is rendered. Note that this returns what is entered as an option or in setTarget: if that was an element, it returns an element; if a string, it returns that.

Source:
Returns:

The Element or id of the Element that the workspace is rendered in.

Type
Element | string | undefined

getTargetElement() → {Element}

Get the DOM element into which this workspace is rendered. In contrast to getTarget this method always return an Element, or null if the workspace has no target.

Source:
Returns:

The element that the workspace is rendered in.

Type
Element

setTarget(target)

Set the target element to render this workspace into.

Parameters:
Name Type Description
target Element | string | undefined

The Element or id of the Element that the workspace is rendered in.

Source: