Adds an EngineEvent listener to this instance.
The EngineEvent type to listen to.
The object or callback function that should receive events.
Create a new ReaderViewAnnotation in this layer using the specified locator.
The locator to specifying the target of the ReaderViewAnnotation.
Custom data to store with the ReaderViewAnnotation. Can later be retrieved by calling ReaderViewAnnotation.getCustomData()
Create multiple ReaderViewAnnotations in this layer from a list of locators.
The list of locators, specifying the targets of the ReaderViewAnnotations.
Removes and destroys all ReaderViewAnnotation instances added to this layer.
Destroys a ReaderViewAnnotation created by this layer. Throws an error if the ReaderViewAnnotation was not created with this layer.
Get all ReaderViewAnnotations created in this layer.
Get the default options used for ReaderViewAnnotations in this layer.
Get all EngineEvent listeners for the specified type that has been added to this instance.
Get the options for this annotation layer.
Get the name of this annotation layer.
Get the associated IView instance.
If this annotation layer has been destroyed. All methods are no-ops if the layer is destroyed.
If this annotation layer is currently visible. A newly created layer is visible by default.
Removes an EngineEvent listener that was previously added to this instance.
The EngineEvent type to remove.
The object or callback function to remove.
Set default options for annotations. These default options applies for all ReaderViewAnnotations that have no options assigned to them.
Set options for this annotation layer.
Set if this annotation layer should be visible or not. A newly created ReaderViewAnnotationLayer is visible by default.
Generated using TypeDoc
Annotation layers allow you to render content on top of the publication content. This can for example be used to highlight search results, or highlight items from a publication's Table of Contents.
You can create a new annotation layer using ReaderView.createAnnotationLayer('someName');
Each annotation layer will create an overlay element on top of each page in the ReaderView. Added annotations will render as rectangles into these overlay elements.
The ReaderViewAnnotationLayer DOM structure is as follows:
Additionally, the ReaderViewAnnotationLayer element (
<div class="colibrio-reader-view-annotation-layer">
) will also have one of the following classes when displayed in a spread:colibrio-reader-view-annotation-layer--left-spread
if the element is in the left spread slot.colibrio-reader-view-annotation-layer--right-spread
if the element is in the right spread slot.For example, to style a
<div class="colibrio-reader-view-annotation-container">
element depending on which side of the spread it is rendered on:layer.setDefaultAnnotationOptions({ containerClassName: 'my-container-class' })
.Use ReaderViewAnnotationLayer.setOptions() to set the desired CSS styles for overlay elements. Use ReaderViewAnnotationLayer.setDefaultAnnotationOptions() or ReaderViewAnnotation.setOptions() to set the desired CSS styles for the rendered annotation rectangles.
There is no styling on these elements by default, (except positioning styles).
It is recommended to use "mix-blend-mode" with for example "multiply" in the layerStyle to display text highlights. For example:
Use 'opacity' instead of 'mix-blend-mode' if the latter is not supported by the browser. You can check browser support by using
RuntimePlatform.isCssDeclarationSupported('mix-blend-mode', 'multiply')