Version 6 brings a major change of how data is handled to OpenSeadragon. In general, the v6 changes (as drastic as they might seem) bring back system-wide data compatibility and address issues introduced in v5. You should familiarize yourself with the new system of data handling. Below is a list of things that the new system deprecates:
Tile data properties like image,
getImage, getCanvasContext, context2D, cacheImageRecord,
are deprecated and might not even work as expected
element, style, context2D are deprecated; you can use tile-invalidated
event to access these inside the cache item when HTMLDrawer is being used
tile-drawing event is deprecated, since data modification logic can
perform asynchronous operations, and this event was performed synchronously just before drawing
a particular element
TileSource-driven data management is deprecated (like createTileCache), since not the tile source, but the
core system decides how, when and what to do with the data; if you've overridden downloadTileStart
you need to newly provide what type of the data you submit to the system
Example usage of new way of data modification:
viewer.addHandler('tile-invalidated', async e => {
const data = await e.getData('context2d');
if (e.outdated()) return;
e.setData(myValue, 'context2d');
});
viewer.requestInvalidate().then(() => console.log("Viewport updated!"));
Cool, right?