An open-source, web-based viewer for zoomable images, implemented in pure JavaScript.
var tileSources = [];
var tileSource = new OpenSeadragon.TileSource({ url: ... });
tileSource.overlay = ...;
tileSources.push(tileSource);
OpenSeadragon({
...,
tileSources: [
{
tileSource: ...,
overlay: ...
},
{
tileSource: ...,
overlay: ...
}
]
});
Serializing overlay placement is something that I am planning on doing and seems like it would be a common requirement. I don’t know about current uses. Couldn’t you just assign the indicated values to the placement objects, as in:
18, 36, 24, 12, 10, 9, 11, 21, 22 for CENTER through LEFT and then add functions to the placement object, as in isLeft(placement), isHorizontallyCentered(placement), isRight(... These functions could use a simple bitwise and to return the desired binary result.
That way you can easily serialze the overlay placement value and also get your binary values. You could also put a quick check for the old values before the “bitwise and” so that those functions could also handle the old values 0-8.
LEFT = placementMask.isLeft + placementMask.isVerticalCenter
placement | | LEFT
to placement === undefined ? LEFT : placement
.