Class: WorkspaceManager

Mapspace.action. WorkspaceManager


new WorkspaceManager( [options])

Parameters:
Name Type Argument Description
options Mapspace.action.WorkspaceManagerOptions <optional>

Options.

Source:
mapspace/actions/workspacemanager.js

Extends

Members


<nullable> control :Mapspace.control.Control

The control this action is attached to.

Inherited From:
Source:
mapspace/actions/action.js

<nullable> viewer :Mapspace.Viewer

This is the viewer this action will be tied to.

Inherited From:
Source:
mapspace/actions/action.js

Methods


getCurrentWorkspace()

Returns the current workspace, if any.

Source:
mapspace/actions/workspacemanager.js
Returns:
Type
Mapspace.Workspace

getDefaultSyncOptions(numOrthos, layoutDef, viewType, index, masterIndex)

Returns the default syncronization options for a viewer.

The criteria is as follows:

  • If whe have just one Mapspace.ortho.Viewer or Mapspace.global.Viewer, then we use default syncronization options between that viewer and the rest.
  • If there is more than one Mapspace.ortho.Viewer then first of them is set as 'master'. Only 'master' to other viewers syncronization is enabled. If there is not 'master', then no syncronization is set.

To determine default syncronization settings we use definitions stored in Mapspace.DefaultSyncTypesForViewType object.

Parameters:
Name Type Description
numOrthos number

Number of ortho viewers.

layoutDef object

Object with the definition of the workspace.

viewType Mapspace.ViewType

Type of current viewer.

index number

Index position of current viewer.

masterIndex number

Index position of master viewer.

Source:
mapspace/actions/workspacemanager.js
Returns:

Object with syncronization setup.

Type
Array.<Mapspace.SyncProperties>

getDefaultSyncProperties(viewType, syncedViewType, index)

Returns a default Mapspace.SyncProperties object for the given parameters.

This function uses the global enum Mapspace.DefaultSyncTypesForViewType to construct the properties object.

Parameters:
Name Type Description
viewType Mapspace.ViewType

View type of the viewer that inits the synchronization.

syncedViewType Mapspace.ViewType

View type of the viewer synchronized.

index number

Index of the synced viewer.

Source:
mapspace/actions/workspacemanager.js
Returns:
Type
Mapspace.SyncProperties

initialize(loadMode, workspaceName, presetName, initOptions)

Resets the list of current workspaces for the user in the associated control, adds all the available workspaces in the control, and initializes the workspace.

Parameters:
Name Type Description
loadMode Mapspace.WorkspaceLoadMode

Mode for deciding which workspace to load.

  • BYNAME: a workspaceName is expected and if it is undefined then does nothing.
  • MOSTUPDATED: if workspaceName exists first tries to load it and if fails tries to load the most updated workspace.
  • DEFAULT: if workspaceName exists first tries to load it and if it fails tries to load the workspace called Mapspace.DEFAULT_WORKSPACE.
workspaceName string | undefined

The name of the workspace to load or undefined to use the param loadMode.

presetName string | undefined

The name of the view preset to use or undefined to use the current layoutVisibilities property of the workspace.

initOptions Mapspace.ViewerLocationOptions | undefined

An optional collection of initial options to set to all the viewers of the workspace to load.

Source:
mapspace/actions/workspacemanager.js

is2DViewer()

Return true if current viewer of the action is a 2D viewer.

Inherited From:
Source:
mapspace/actions/action.js
Returns:
Type
boolean

is3DViewer()

Return true if current viewer of the action is a 3D viewer.

Inherited From:
Source:
mapspace/actions/action.js
Returns:
Type
boolean

isGlobalViewer()

Return true if current viewer of the action is a Mapspace.global.Viewer.

Inherited From:
Source:
mapspace/actions/action.js
Returns:
Type
boolean

isObliqueViewer()

Return true if current viewer of the action is a Mapspace.oblique.Viewer.

Inherited From:
Source:
mapspace/actions/action.js
Returns:
Type
boolean

isObliqueViewerVisible()

Return true if current viewer of the action is a Mapspace.oblique.Viewer or a Mapspace.global.Viewer in Oblique mode.

Inherited From:
Source:
mapspace/actions/action.js
Returns:
Type
boolean

isOrthoViewer()

Return true if current viewer of the action is a Mapspace.ortho.Viewer.

Inherited From:
Source:
mapspace/actions/action.js
Returns:
Type
boolean

isOrthoViewerVisible()

Return true if current viewer of the action is a Mapspace.ortho.Viewer or a Mapspace.global.Viewer in Ortho mode.

Inherited From:
Source:
mapspace/actions/action.js
Returns:
Type
boolean

isProfile3dViewer()

Return true if current viewer of the action is a Mapspace.profile3d.Viewer.

Inherited From:
Source:
mapspace/actions/action.js
Returns:
Type
boolean

isStreetViewer()

Return true if current viewer of the action is a Mapspace.street.Viewer.

Inherited From:
Source:
mapspace/actions/action.js
Returns:
Type
boolean

isTableViewer()

Return true if current viewer of the action is a Mapspace.table.Viewer.

Inherited From:
Source:
mapspace/actions/action.js
Returns:
Type
boolean

isThreedViewer()

Return true if current viewer of the action is a Mapspace.threed.Viewer.

Inherited From:
Source:
mapspace/actions/action.js
Returns:
Type
boolean