0

我在使用 Openseadragon 时遇到了一些问题:这是我的查看器代码:

    <div id="viewer"></div>
 <script>
     var viewer = OpenSeadragon({
       preserveViewport: true,
       visibilityRatio: 1,
       defaultZoomLevel: 0,
       id: "viewer",
       sequenceMode: true,
       tileSources:  {
            type:'image',
            url:"https://api.digitale-sammlungen.de/iiif/presentation/v2/bsb10200197/canvas/1/view"},
       showFullPageControl: false,
       showHomeControl: false,
       prefixUrl: "https://cdn.jsdelivr.net/npm/openseadragon@2.4/build/openseadragon/images/"
     });
 </script>  

如您所见,我有一个来自德国巴伐利亚国家图书馆的 tileSource。每当我直接在浏览器中访问 url 时,图像都会按预期打开,但是,当我在查看器中时会收到错误

无法打开 [object Object]:在https://api.digitale-sammlungen.de/iiif/presentation/v2/bsb10200197/canvas/1/view加载图像时出错

谁能告诉我我做错了什么?

一切顺利,并在此先感谢

4

1 回答 1

1

您想在这里使用 IIIF tilesources 吗?如果是这样,您将需要为 tileSource 而不是画布使用IIIF 图像信息url。我也会删除type: 'image'.

    <div id="viewer"></div>
 <script>
     var viewer = OpenSeadragon({
       preserveViewport: true,
       visibilityRatio: 1,
       defaultZoomLevel: 0,
       id: "viewer",
       sequenceMode: true,
       tileSources:  {
            url:"https://api.digitale-sammlungen.de/iiif/image/v2/bsb10200197_00001/info.json"},
       showFullPageControl: false,
       showHomeControl: false,
       prefixUrl: "https://cdn.jsdelivr.net/npm/openseadragon@2.4/build/openseadragon/images/"
     });
 </script>
于 2020-11-20T13:47:04.683 回答