Uncaught TypeError
bcail opened this issue · 7 comments
I'm getting a TypeError on some objects with leaflet-IIIF (other objects are fine). Here are the details:
-
item with the issue: https://repository.library.brown.edu/viewers/image/leaflet/bdr:597184 (corresponding IIIF info: https://repository.library.brown.edu/iiif/image/bdr:597184/info.json)
-
item without the issue: https://repository.library.brown.edu/viewers/image/leaflet/bdr:214709 (corresponding IIIF info: https://repository.library.brown.edu/iiif/image/bdr:214709/info.json)
-
stacktrace:
Uncaught TypeError: Cannot read property 'y' of undefined
at e._fitBounds (https://repository.library.brown.edu/viewers/assets/leaflet-iiif/leaflet-iiif.js:94:71)
at Object. (https://repository.library.brown.edu/viewers/assets/leaflet-iiif/leaflet-iiif.js:70:15)
at i (https://code.jquery.com/jquery-1.12.4.min.js:2:27449)
at Object.fireWith [as resolveWith] (https://code.jquery.com/jquery-1.12.4.min.js:2:28213)
at Object.e.(anonymous function) [as resolve] (https://code.jquery.com/jquery-1.12.4.min.js:2:29192)
at Object. (https://repository.library.brown.edu/viewers/assets/leaflet-iiif/leaflet-iiif.js:167:29)
at i (https://code.jquery.com/jquery-1.12.4.min.js:2:27449)
at Object.fireWith [as resolveWith] (https://code.jquery.com/jquery-1.12.4.min.js:2:28213)
at y (https://code.jquery.com/jquery-1.12.4.min.js:4:22721)
at XMLHttpRequest.c (https://code.jquery.com/jquery-1.12.4.min.js:4:26925)
Thanks for reporting @bcail . I'm looking into it.
@bcail The issue seems to stem from the fact that https://repository.library.brown.edu/iiif/image/bdr:597184/info.json is reporting a potentially conflicting tileSize
.
There is also a bug in Leaflet-IIIF where an explicit tileSize
declaration is not being honored. A PR is coming soon to fix this.
Thanks, @mejackreed, for fixing the issue & pointing out the issue with our IIIF info.
@mejackreed thanks for the release as well. Unfortunately, I'm still getting the same error (on line 94, in the _fitBounds function). Is that supposed to be working now?
@bcail you will need to specify an explicit tileSize
when instantiating the layer since your width/height is most likely incompatible with the info.json "tile" section: https://jsfiddle.net/mejackreed/r3cfaej8/
thanks.