MarkupSheet2DCollection
Index
Properties
publicreadonlyattachedTo
publicreadonlyobservable
Accessors
publicchangeCount
Number of objects in layer not marked with state Unchanged.
Returns number
publicconflictCount
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
true
if a layer exists and if saveAndMerge or loadAndMerge has been called successfully at least once.Returns boolean
publicobjects
Get the objects currently in the layer
Returns IterableIterator<Readonly<MergableObjectWithState<MarkupEntityBase>>>
publicpermission
true
if user has permission to update the layer.Returns Permissions
publicversion
Get the version of the currently loaded layer. [-1] if no layer has yet been loaded.
Returns number
Methods
[iterator]
Returns IterableIterator<MarkupSheet2D>
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 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
Get a markup sheet based on id.
Parameters
entityOrId: string | Pick<MarkupEntityBase, id>
Returns undefined | MergableObjectWithState<MarkupEntityBase>
The markup sheet if it exists, undefined if no markup sheet of that id exists.
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
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 > 0 then save was not successfull.
sheets
Parameters
states: MergableObjectState[] = []
Array of states used to filter out sheets, default is [MergableObjectState.Added, MergableObjectState.Modified, MergableObjectState.Unchanged].
Returns IterableIterator<MarkupSheet2D>
Collection of all the MarkupSheet2D instances that have been created locally and loaded via the markup API.