Skip to content

Fix Leaflet IIIF image viewer#299

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

Fix Leaflet IIIF image viewer#299
ewlarson merged 1 commit into
developfrom
feature/leaflet-iiif-image-viewer

Conversation

@ewlarson

@ewlarson ewlarson commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Route iiif_image resources through the Leaflet viewer instead of synthesizing a Mirador manifest.
  • Replace the plugin-dependent IIIF path with a local IIIF Image API tile layer modeled after the abcdefgeo implementation.
  • Fetch info.json, compute native zoom, build L.CRS.Simple image bounds from pixel dimensions, constrain panning with padded max bounds, and refit on layout changes.
  • Avoid adding a basemap/geosearch path for IIIF image viewers, preventing stray basemap imagery tile requests.
  • Explicitly import the Leaflet fullscreen plugin and keep fullscreen/opacity controls available for IIIF images.

Why

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

Impact

Image-service-only IIIF resources can render as bounded image maps with predictable zoom and pan behavior, while 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 20:50
@ewlarson ewlarson merged commit 5567961 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