Public
Back
Version 22
11/13/2024
import { IIIFBuilder } from "npm:@iiif/builder"
const token = "55854654d771f0861fd9e1df2957e9a61f0346c67b6cafe51ef102981f1cac826ee45479e2622b6e50956717c5171f6c4444e94d3f568efed13f51d1b287e7ab"
const apiUrl = "https://data.4tu.nl/v2/account/articles/"
const datasetUuid = "d1ec74b6-f295-4c70-aced-4b4770cbcce4"
async function fetchJson (url: string, auth: boolean = false) {
const headers = new Headers()
if (auth) {
headers.append("Authorization", `token ${token}`)
}
return await fetch(url, {headers}).then(resp => resp.json())
}
function createManifest (imageEndpoints: string[]) {
builder.createManifest(id, (manifest) => {
manifest.addLabel(label, "en");
for (const [index, item] of parsedUrls.entries()) {
manifest.createCanvas(id + "/canvas/" + index, (canvas) => {
const api = checkImageApiVersion(item["@context"]);
const imageId = api === 3 ? item.id : item["@id"];
canvas.height = item.height;
canvas.width = item.width;
canvas.createAnnotation(imageId, {
id: imageId,
type: "Annotation",
motivation: "painting",
body: {
id:
api === 3
? imageId + "/full/max/0/default.jpg"
: api === 2
? imageId + "/full/full/0/default.jpg"
: imageId + "/full/full/0/native.jpg",
type: "Image",
format: "image/jpeg",
sammeltassen-iiif44tu.web.val.run
Updated: November 14, 2024