Class: Overlay

OpenSeadragon.Overlay

Provides a way to float an HTML element on top of the viewer element.

Constructor

new Overlay(options)

Parameters:
Name Type Description
options Object
Properties
Name Type Attributes Default Description
element Element
location OpenSeadragon.Point | OpenSeadragon.Rect The location of the overlay on the image. If a OpenSeadragon.Point is specified, the overlay will be located at this location with respect to the placement option. If a OpenSeadragon.Rect is specified, the overlay will be placed at this location with the corresponding width and height and placement TOP_LEFT.
placement OpenSeadragon.Placement <optional>
OpenSeadragon.Placement.TOP_LEFT Defines what part of the overlay should be at the specified options.location
onDraw OpenSeadragon.Overlay.OnDrawCallback <optional>
checkResize Boolean <optional>
true Set to false to avoid to check the size of the overlay every time it is drawn in the directions which are not scaled. It will improve performances but will cause a misalignment if the overlay size changes.
width Number <optional>
The width of the overlay in viewport coordinates. If specified, the width of the overlay will be adjusted when the zoom changes.
height Number <optional>
The height of the overlay in viewport coordinates. If specified, the height of the overlay will be adjusted when the zoom changes.
rotationMode Boolean <optional>
OpenSeadragon.OverlayRotationMode.EXACT How to handle the rotation of the viewport.
Source:

Methods

adjust(position, size)

Internal function to adjust the position of an overlay depending on it size and placement.
Parameters:
Name Type Description
position OpenSeadragon.Point
size OpenSeadragon.Point
Source:

destroy()

Source:

drawHTML(container)

Parameters:
Name Type Description
container Element
Source:

getBounds(viewport) → {OpenSeadragon.Rect}

Returns the current bounds of the overlay in viewport coordinates
Parameters:
Name Type Description
viewport OpenSeadragon.Viewport the viewport
Source:
Returns:
overlay bounds
Type
OpenSeadragon.Rect

update(location, placement)

Changes the overlay settings.
Parameters:
Name Type Description
location OpenSeadragon.Point | OpenSeadragon.Rect | Object If an object is specified, the options are the same than the constructor except for the element which can not be changed.
placement OpenSeadragon.Placement
Source:

Type Definitions

OnDrawCallback(position, size, element)

onDraw callback signature used by OpenSeadragon.Overlay.
Parameters:
Name Type Description
position OpenSeadragon.Point
size OpenSeadragon.Point
element Element
Source: