Skip to content

Fix IIIF Leaflet CRS bounds#300

Merged
ewlarson merged 1 commit into
developfrom
feature/leaflet-iiif-crs-simple
Jun 18, 2026
Merged

Fix IIIF Leaflet CRS bounds#300
ewlarson merged 1 commit into
developfrom
feature/leaflet-iiif-crs-simple

Conversation

@ewlarson

Copy link
Copy Markdown
Contributor

Summary

  • Replace the plugin-dependent IIIF Image API path with a local Leaflet tile layer modeled after the abcdefgeo implementation.
  • Fetch info.json, compute native zoom, build L.CRS.Simple image bounds from pixel dimensions, and constrain panning with padded max bounds.
  • Avoid the basemap/geosearch path for IIIF image viewers so image maps do not trigger stray basemap tile requests.
  • Explicitly import the Leaflet fullscreen plugin and keep fullscreen/opacity controls available for IIIF images.
  • Add focused coverage for CRS.Simple bounds, tile URL generation, clipped edge tiles, and blank out-of-image tiles.

Why

IIIF Image API resources need Leaflet's simple image coordinate space, not geospatial basemap coordinates. The previous fix selected CRS.Simple, but it still relied on the leaflet-iiif plugin lifecycle and did not compute image bounds from info.json before fitting/constraining the map. That left rough pan/zoom behavior and impossible tile requests.

Impact

Image-service-only IIIF resources render as bounded image maps with predictable zoom and pan behavior. IIIF Presentation manifests continue to use Mirador, and normal geospatial Leaflet resources continue through the GeoBlacklight path.

Validation

  • npm test -- run src/__tests__/geoblacklight/leaflet_viewer_controller.test.js src/__tests__/components/resource/ResourceViewer.test.tsx
  • npm run build

@ewlarson ewlarson marked this pull request as ready for review June 18, 2026 22:16
@ewlarson ewlarson merged commit 384c668 into develop Jun 18, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant