Reputation: 636
I'm having a problem loading dzi tiles in a very basic setup in ASP.NET Core 3.1. I have used the same setup previously in ASP.NET websites running on IIS, where the same dzi tiles work just fine.
<body style="width: 100%; height: 100%;">
<div id="seadragon1" role="application" aria-label="seadragon viewer" style="width:100%; height: 100%">
</div>
<script src="~/js/openseadragon-2.4.2.js"></script>
<script>
var seadragon = OpenSeadragon({
id: 'seadragon1',
prefixUrl: '/img/',
tileSources: '/media/sample.dzi'
});
</script>
</body>
The .dzi file is passed to the OpenSeadragon object as a relative url, and is fetched successfully. All the nav images are fetched successfully, though no nav buttons ever appear. However, only a single image tile is ever fetched: /media/sample/sample_files/0/0_0.jpg
. No errors appear in the console. The canvas gets all set up okay, it's just completely empty. There's no indication as to why no further tiles are fetched - there is just no attempt to fetch them. If I manually attempt to reach any of the tiles in the browser (e.g. /media/sample/sample_files/10/0_0.jpg
) they are available and load okay. I.e. the tile images are there and can be served.
When I pass the same dzi file and tiles to the same setup in an older ASP.NET website running on IIS, everything works fine. The html and javascript in both scenarios are literally the same. The fundamental difference between the two scenarios is that asp.net core is running on the built-in Kestrel server, not IIS. I am flummoxed as to why that would make any difference to OpenSeadragon's behaviour.
To be thorough, I published the asp.net core site to an IIS server. Technically, IIS proxies to Kestrel on the server but that's as much as I can close the gap between an asp.net core website and an older style asp.net website based on the .net framework.
And... same problem. Here is the published site for reference: https://andi2.andornot.com/seadragon?dzi=/media/seadragon/sample.dzi.
Any educated guess as to what's going on would be helpful.
Upvotes: 0
Views: 333
Reputation: 636
Turns out the problem is the 100% height, which comes out to a height of 0. If the seadragon container has no height, no content is loaded. Setting the height to 100vh made openseadragon work as expected.
Upvotes: 1