Class: Tile

OpenSeadragon.Tile

new Tile(level, x, y, bounds, exists, url, context2D, loadWithAjax, ajaxHeaders)

Parameters:
Name Type Description
level Number The zoom level this tile belongs to.
x Number The vector component 'x'.
y Number The vector component 'y'.
bounds OpenSeadragon.Point Where this tile fits, in normalized coordinates.
exists Boolean Is this tile a part of a sparse image? ( Also has this tile failed to load? )
url String The URL of this tile's image.
context2D CanvasRenderingContext2D The context2D of this tile if it is provided directly by the tile source.
loadWithAjax Boolean Whether this tile image should be loaded with an AJAX request .
ajaxHeaders Object The headers to send with this tile's AJAX request (if applicable).
Source:

Members

ajaxHeaders :Object

The headers to be used in requesting this tile's image. Only used if loadWithAjax is set to true.
Type:
  • Object
Source:

beingDrawn :Boolean

Whether this tile is currently being drawn.
Type:
  • Boolean
Source:

blendStart :Number

The start time of this tile's blending.
Type:
  • Number
Source:

bounds :OpenSeadragon.Rect

Where this tile fits, in normalized coordinates
Type:
Source:

cacheKey :String

The unique cache key for this tile.
Type:
  • String
Source:

context2D :CanvasRenderingContext2D

The context2D of this tile if it is provided directly by the tile source.
Type:
  • CanvasRenderingContext2D
Source:

element :Element

The HTML div element for this tile
Type:
  • Element
Source:

exists :Boolean

Is this tile a part of a sparse image? Also has this tile failed to load?
Type:
  • Boolean
Source:

image :Object

The Image object for this tile.
Type:
  • Object
Source:

imgElement :Element

The HTML img element for this tile.
Type:
  • Element
Source:

lastTouchTime :Number

Timestamp the tile was last touched.
Type:
  • Number
Source:

level :Number

The zoom level this tile belongs to.
Type:
  • Number
Source:

loaded :Boolean

Is this tile loaded?
Type:
  • Boolean
Source:

loading :Boolean

Is this tile loading?
Type:
  • Boolean
Source:

loadWithAjax :Boolean

Whether to load this tile's image with an AJAX request.
Type:
  • Boolean
Source:

opacity :Number

The current opacity this tile should be.
Type:
  • Number
Source:

position :OpenSeadragon.Point

This tile's position on screen, in pixels.
Type:
Source:

size :OpenSeadragon.Point

This tile's size on screen, in pixels.
Type:
Source:

style :String

The alias of this.element.style.
Type:
  • String
Source:

url :String

The URL of this tile's image.
Type:
  • String
Source:

visibility :Number

The visibility score of this tile.
Type:
  • Number
Source:

x :Number

The vector component 'x'.
Type:
  • Number
Source:

y :Number

The vector component 'y'.
Type:
  • Number
Source:

Methods

drawCanvas(context, drawingHandler, scaleopt, translateopt)

Renders the tile in a canvas-based context.
Parameters:
Name Type Attributes Default Description
context Canvas
drawingHandler function Method for firing the drawing event. drawingHandler({context, tile, rendered}) where rendered is the context with the pre-drawn image.
scale Number <optional>
1 Apply a scale to position and size
translate OpenSeadragon.Point <optional>
A translation vector
Source:

drawHTML(container)

Renders the tile in an html container.
Parameters:
Name Type Description
container Element
Source:

getScaleForEdgeSmoothing() → {Float}

Get the ratio between current and original size.
Source:
Returns:
Type
Float

getTranslationForEdgeSmoothing(scaleopt) → {OpenSeadragon.Point}

Get a translation vector that when applied to the tile position produces integer coordinates. Needed to avoid swimming and twitching.
Parameters:
Name Type Attributes Default Description
scale Number <optional>
1 Scale to be applied to position.
Source:
Returns:
Type
OpenSeadragon.Point

toString() → {String}

Provides a string representation of this tiles level and (x,y) components.
Source:
Returns:
Type
String

unload()

Removes tile from its container.
Source: