Constructor
| Name |
Type |
Description |
context |
|
OpenSeadragon instance |
- Source:
Methods
(async) createImagePreview(bgSpec, width, height) → {Promise.<(Image|HTMLImageElement)>}
Create Image Object for a desired background.
This method must be used to generate the image previews shown in menus - otherwise they are not accurate.
| Name |
Type |
Default |
Description |
bgSpec |
BackgroundItem
|
StandaloneBackgroundItem
|
|
bg config |
width |
|
250
|
|
height |
|
250
|
|
- Source:
Type
Promise.<(Image|HTMLImageElement)>
focus(params)
| Name |
Type |
Description |
params |
|
Object that defines the focus
Properties
| Name |
Type |
Description |
bounds |
|
OpenSeadragon.Rect, in viewport coordinates;
both elements below must be defined if bounds are undefined |
point |
|
OpenSeadragon.Point center of focus |
zoomLevel |
|
Number, zoom level |
animationTime |
|
| params.duration (optional) |
springStiffness |
|
| params.transition (optional) |
immediately |
|
focus immediately if true (optional) |
preferSameZoom |
|
optional, default: keep the user's viewport as close as possible if false,
or keep the same zoom level if true; note this value is ignored if appropriate data not present |
|
- Source:
link(context, mapper)
Link the viewer to context-sharing navigation link: all viewers of the same context
will follow the same navigation path.
| Name |
Type |
Default |
Description |
context |
any
|
0
|
sync context - in which sync session you operate |
mapper |
function
|
|
custom sync logics instead of the default one, usually
you want to call applyViewportState(...) method with your computed viewport state values |
- Source:
(async) navigatorThumbnail(config, size, timeout) → {Promise.<CanvasRenderingContext2D>}
Create thumbnail screenshot
TODO FIX THIS - VIEWER REFERENCE is too BIG to capture a thumbnail - we should download manually just a proportion of the image,
right now we force the whole tiled image load, which depends on the screen size and is not optimal (especially if navigator is not defined)
| Name |
Type |
Attributes |
Default |
Description |
config |
BackgroundItem
|
StandaloneBackgroundItem
|
|
|
bg config |
size |
OpenSeadragon.Point
|
|
|
the output size |
timeout |
number
|
|
30000
|
|
size.preserveAspectRatio |
boolean
|
<optional>
|
true
|
|
- Source:
Type
Promise.<CanvasRenderingContext2D>
(async) retrieveLabel(config) → {Promise.<Image>}
Retrieve label
| Name |
Type |
Description |
config |
BackgroundItem
|
StandaloneBackgroundItem
|
bg config |
- Source:
Type
Promise.<Image>
screenshot(toImage, size, focusopt) → {CanvasRenderingContext2D|Image}
Create viewport screenshot
| Name |
Type |
Attributes |
Description |
toImage |
boolean
|
|
true if element should be created, otherwise Context2D |
size |
OpenSeadragon.Point
|
object
|
|
the output size |
focus |
OpenSeadragon.Rect
|
object
|
undefined
|
<optional>
|
screenshot
focus area (screen coordinates), by default thw whole viewport |
- Source:
Type
CanvasRenderingContext2D
|
Image
unlink(context)
Unlink the viewer from context-sharing navigation link.
| Name |
Type |
Default |
Description |
context |
|
0
|
|
- Source:
(static) destroyLink(context)
Destroy the context-sharing navigation link for all viewers.
| Name |
Type |
Default |
Description |
context |
|
0
|
|
- Source:
(static) link(self, context, mapper)
Link the viewer to context-sharing navigation link: all viewers of the same context
will follow the same navigation path.
| Name |
Type |
Default |
Description |
self |
OpenSeadragon.Viewer
|
|
|
context |
any
|
0
|
sync context - in which sync session you operate |
mapper |
function
|
|
custom sync logics instead of the default one |
- Source:
(static) unlink(self, context)
Unlink the viewer from context-sharing navigation link.
| Name |
Type |
Default |
Description |
self |
OpenSeadragon.Viewer
|
|
|
context |
|
0
|
|
- Source: