new Tile(level, x, y, bounds, exists, url, context2Dopt, loadWithAjax, ajaxHeaders, sourceBounds, postData, cacheKey)
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
level |
Number | The zoom level this tile belongs to. | |
x |
Number | The vector component 'x'. | |
y |
Number | The vector component 'y'. | |
bounds |
OpenSeadragon.Rect | 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 | function | The URL of this tile's image or a function that returns a url. | |
context2D |
CanvasRenderingContext2D |
<optional> |
The context2D of this tile if it * is provided directly by the tile source. Deprecated: use Tile::addCache(...) instead. |
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). | |
sourceBounds |
OpenSeadragon.Rect | The portion of the tile to use as the source of the drawing operation, in pixels. Note that this only works when drawing with canvas; when drawing with HTML the entire tile is always used. | |
postData |
String | HTTP POST data (usually but not necessarily in k=v&k2=v2... form, see TileSource::getTilePostData) or null | |
cacheKey |
String | key to act as a tile cache, must be unique for tiles with unique image data |
- 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:
cacheImageRecord :OpenSeadragon.CacheRecord
The default cache for this tile.
Type:
- Deprecated:
- Yes
- Source:
cacheImageRecord
The default cache for this tile.
- Deprecated:
- Yes
- Source:
context2D :CanvasRenderingContext2D
The context2D of this tile if it is provided directly by the tile source.
Type:
- CanvasRenderingContext2D
- Source:
context2D :CanvasRenderingContext2D
The context2D of this tile if it is provided directly by the tile source.
Type:
- CanvasRenderingContext2D
- Deprecated:
- Yes
- Source:
context2D
The context2D of this tile if it is provided directly by the tile source.
- Deprecated:
- Yes
- Source:
element :Element
The HTML div element for this tile
Type:
- Element
- Deprecated:
- Yes
- Source:
exists :Boolean
Is this tile a part of a sparse image? Also has this tile failed to load?
Type:
- Boolean
- Source:
flipped :Boolean
Whether to flip the tile when rendering.
Type:
- Boolean
- Source:
hasTransparency :Boolean
The transparency indicator of this tile.
Type:
- Boolean
- Source:
image :Object
The Image object for this tile.
Type:
- Object
- Deprecated:
- Yes
- Source:
imgElement :Element
The HTML img element for this tile.
Type:
- Element
- Deprecated:
- Yes
- Source:
isBottomMost :Boolean
Whether this tile is in the bottom-most row for its level.
Type:
- Boolean
- Source:
isRightMost :Boolean
Whether this tile is in the right-most column for its level.
Type:
- Boolean
- 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:
positionedBounds :OpenSeadragon.Rect
Where this tile fits, in normalized coordinates, after positioning
Type:
- Source:
postData :String
Post parameters for this tile. For example, it can be an URL-encoded string
in k1=v1&k2=v2... format, or a JSON, or a FormData instance... or null if no POST request used
Type:
- String
- Source:
size :OpenSeadragon.Point
This tile's size on screen, in pixels.
Type:
- Source:
sourceBounds :OpenSeadragon.Rect
The portion of the tile to use as the source of the drawing operation, in pixels. Note that
this property is ignored with HTML drawer where the whole tile is always drawn.
Type:
- Source:
style :String
The alias of this.element.style.
Type:
- String
- Deprecated:
- Yes
- Source:
url :String
The URL of this tile's image.
Type:
- String
- Deprecated:
- Yes
- 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
equals(tile)
Check if two tiles are data-equal
Parameters:
| Name | Type | Description |
|---|---|---|
tile |
OpenSeadragon.Tile |
- Source:
getCacheSize() → {number}
Get the number of caches available to this tile
- Source:
Returns:
number of caches
- Type
- number
getCanvasContext() → {CanvasRenderingContext2D|undefined}
Get the CanvasRenderingContext2D instance for tile image data drawn
onto Canvas if enabled and available
- Deprecated:
- Yes
- Source:
Returns:
- Type
- CanvasRenderingContext2D | undefined
getImage() → (nullable) {Image}
Get the Image object for this tile.
- Deprecated:
- Yes
- Source:
Returns:
- Type
- Image
getScaleForEdgeSmoothing() → {number}
Get the ratio between current and original size.
- Deprecated:
- Yes
- Source:
Returns:
- Type
- number
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
getUrl() → {String}
Get the url string for this tile.
- Source:
Returns:
- Type
- String
toString() → {String}
Provides a string representation of this tiles level and (x,y)
components.
- Source:
Returns:
- Type
- String
unload(eraseopt)
Removes tile from the system: it will still be present in the
OSD memory, but marked as loaded=false, and its data will be erased if erase set to true.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
erase |
boolean |
<optional> |
false |
- Source: