Skip to main content

MarkupSheet2DCollection

Collection of all the MarkupSheet2D instances that have been created locally and loaded via the markup API.

Index

Properties

publicreadonlyattachedTo

publicreadonlyobservable

observable: Observable<MarkupLayerEvent2D>

Accessors

publicchangeCount

  • get changeCount(): number
  • Number of objects in layer not marked with state Unchanged.


    Returns number

publicconflictCount

  • get conflictCount(): number
  • Number of objects with conflicts in the layer. A conflict occurs if there is a mismatch between the local and the remote representation of the layer. Conflicts can only occur when saveAndMerge or loadAndMerge is called.


    Returns number

publicisLoaded

  • get isLoaded(): boolean
  • true if a layer exists and if saveAndMerge or loadAndMerge has been called successfully at least once.


    Returns boolean

publicobjects

publicpermission

  • true if user has permission to update the layer.


    Returns Permissions

publicversion

  • get version(): number
  • Get the version of the currently loaded layer. [-1] if no layer has yet been loaded.


    Returns number

Methods

[iterator]

addSheet

  • Creates a new markup sheet and adds it to the layer api.


    Parameters

    • id: string

      The id for the new sheet (has to be unique).

    • optionalproperties: Map<string, MarkupProperty>

      Properties for the sheet.

    Returns MarkupSheet2D

    The new markup sheet.

clear

  • clear(): void
  • Clear the layer.


    Returns void

publicconflicts

  • Conflicts in the layer. A conflict occurs if there is a mismatch between the local and the remote representation of a object in the layer. Conflicts can only occur when saveAndMerge or loadAndMerge is called.


    Returns Readonly<MergableObjectWithState<MarkupEntityBase>>[]

get

publicloadAndMerge

  • Loads all existing (remote) objects from the backend and attempts to merge them into objects. This may result in conflicts between the local and the remote objects. A typical example is if the same object has been modified locally but also remotely (in the backend.)


    Returns Promise<number | LayerFailure>

publicsaveAndMergeSheets

  • saveAndMergeSheets(overwrite?: boolean): Promise<number | LayerFailure>
  • Save the sheets using the layer api.


    Parameters

    • overwrite: boolean = false

      If true then the last version will be overwritten.

    Returns Promise<number | LayerFailure>

    Number of conflicts, if &gt; 0 then save was not successfull.

sheets

  • @example
    // Loops all modified sheets in this collection.
    for(const modifiedSheets of collection.sheets([MergableObjectState.Modified])) {
    ...
    }

    Parameters

    • states: MergableObjectState[] = []

      Array of states used to filter out sheets, default is [MergableObjectState.Added, MergableObjectState.Modified, MergableObjectState.Unchanged].

    Returns IterableIterator<MarkupSheet2D>