bodleian / archiox-mirador-plugin

An experimental plugin to display depth information captured with Lucida or Selene scanners from FactumARTE. However, the plug-in can present any normal map/albedo map combination produced from any technique.
MIT License
1 stars 0 forks source link

Maps are determined by service index #29

Closed BeebBenjamin closed 2 years ago

BeebBenjamin commented 2 years ago

The static manifest used to develop the plug-in was wrong. Therefore we need to use something more reliable than index position in services to get the normal and albedo maps etc.

Instead of using index position e.g. 0, 1, 2 etc we should get it by type e.g. ImageService3.

function getMap(annotationBodies, mapType) {
    let map;
    annotationBodies.forEach(function(element) {
        const service = element.getService('http://iiif.io/api/annex/services/lightingmap');
        if (service !== null) {
            if(service.__jsonld.mapType === mapType){
                element.__jsonld.service.forEach(function(service){
                    if(service.type === "ImageService3") {
                        map = service['id'];
                    }
                });
            }
        }
    });
    return map;
}
BeebBenjamin commented 2 years ago

This is fixed on QA.