Class OpenSeadragon.Drawer

Class Summary
Constructor Attributes Constructor Name and Description
 
OpenSeadragon.Drawer(source, viewport, element)

Method Summary

Class Detail

OpenSeadragon.Drawer(source, viewport, element)
Parameters:
{OpenSeadragon.TileSource} source
- Reference to Viewer tile source.
{OpenSeadragon.Viewport} viewport
- Reference to Viewer viewport.
{Element} element
- Reference to Viewer 'canvas'.

Field Detail

{Element|Canvas} canvas
- TODO
{Object} config
- Reference to Viewer config.
{Element} container
- Reference to Viewer 'canvas'.
{CanvasContext} context
- TODO
{Object} coverage
- A '3d' dictionary [level][x][y] --> Boolean.
{Number} downloading
- How many images are currently being loaded in parallel.
{Element} element
- DEPRECATED Alias for container.
{Array} lastDrawn
- An unordered list of Tiles drawn last frame.
{Number} lastResetTime
- Last time for which the drawer was reset.
{Boolean} midUpdate
- Is the drawer currently updating the viewport?
{Number} normHeight
- Ratio of zoomable image height to width.
{Array} overlays
- An unordered list of Overlays added.
- Reference to Viewer tile source.
{Array} tilesLoaded
- An unordered list of Tiles with loaded images.
{Object} tilesMatrix
- A '3d' dictionary [level][x][y] --> Tile.
{Boolean} updateAgain
- Does the drawer need to update the viewort again?
- Reference to Viewer viewport.

Method Detail

  • addOverlay(element, location, placement)
    Adds an html element as an overlay to the current viewport. Useful for highlighting words or areas of interest on an image or other zoomable interface.
    Parameters:
    {Element|String} element
    - A reference to an element or an id for the element which will overlayed.
    {OpenSeadragon.Point|OpenSeadragon.Rect} location
    - The point or rectangle which will be overlayed.
    {OpenSeadragon.OverlayPlacement} placement
    - The position of the viewport which the location coordinates will be treated as relative to.
  • clearOverlays()
    Removes all currently configured Overlays from this Drawer and schedules and update.
  • {Boolean} loadImage(src, callback)
    Used internally to load images when required. May also be used to preload a set of images so the browser will have them available in the local cache to optimize user experience in certain cases. Because the number of parallel image loads is configurable, if too many images are currently being loaded, the request will be ignored. Since by default drawer.imageLoaderLimit is 0, the native browser parallel image loading policy will be used.
    Parameters:
    {String} src
    - The url of the image to load.
    {Function} callback
    - The function that will be called with the Image object as the only parameter, whether on 'load' or on 'abort'. For now this means the callback is expected to distinguish between error and success conditions by inspecting the Image object.
    Returns:
    {Boolean} loading - Wheter the request was submitted or ignored based on OpenSeadragon.DEFAULT_SETTINGS.imageLoaderLimit.
  • {Boolean} needsUpdate()
    Returns whether the Drawer is scheduled for an update at the soonest possible opportunity.
    Returns:
    {Boolean} - Whether the Drawer is scheduled for an update at the soonest possible opportunity.
  • {Number} numTilesLoaded()
    Returns the total number of tiles that have been loaded by this Drawer.
    Returns:
    {Number} - The total number of tiles that have been loaded by this Drawer.
  • removeOverlay(element)
    Removes and overlay identified by the reference element or element id and schedules and update.
    Parameters:
    {Element|String} element
    - A reference to the element or an element id which represent the ovelay content to be removed.
  • reset()
    Clears all tiles and triggers an update on the next call to Drawer.prototype.update().
  • update()
    Forces the Drawer to update.
  • updateOverlay(location, placement, placement)
    Updates the overlay represented by the reference to the element or element id moving it to the new location, relative to the new placement.
    Parameters:
    {OpenSeadragon.Point|OpenSeadragon.Rect} location
    - The point or rectangle which will be overlayed.
    {OpenSeadragon.OverlayPlacement} placement
    - The position of the viewport which the location coordinates will be treated as relative to.
    placement