Introduction
Leaflet-IIIF-GeoJSON is a new tool which can be used alongside Jack Reed's Leaflet-IIIF plug-in to help you add annotations to a IIIF image.
Leaflet-IIIF is a plug-in which allows you to use and view IIIF images using the Leaflet mapping library. Leaflet-IIIF-GeoJSON combines Leaflet-IIIF with Leaflet-Draw to create an easy way to highlight areas on a IIIF image and to then append an annotation to the highlighted area.
You can see the kind of annotated IIIF images which can be created with Leaflet-IIIF-GeoJSON on this simple Feast of the Gods demo (using a IIIF manifest of a painting in the National Gallery of Art) and on this annotated Medieval Map of Britain (using a IIIF manifest from Corpus Christi College).
Demo
You can see and play with Leaflet-IIIF-GeoJSON here. On this app you can draw areas directly onto the painting Ginevra de' Benci by Leonardo da Vinci. After adding a polygon, a polyline, a rectangle or a marker to the painting you are prompted to 'Add Text'. This will be the text that appears when someone clicks on the selected areas you have drawn on the picture.
Once you have finished drawing on the painting and adding annotations you can press on the green 'Export GeoJSON' button. This will save a geoJSON file containing the data of all your drawn polygon shapes and annotations. This geoJSON file can now be used alongside the Leaflet-IIIF plug-in to create an interactive version of the painting (or of any other IIIF image).
Getting Started
- Open Leaflet-IIIF-GeoJSON
- Enter your own image by pointing the URL to your own IIIF manifest. For example the link https://leaflet-iiif-geojson-drafting.glitch.me/?manifest=https://www.nga.gov/api/v1/iiif/presentation/manifest.json?cultObj:id=41624 will open Leaflet-IIIF-GeoJSON with another painting
- Draw on the painting and add your annotations
- Save your polygons and annotations by pressing on the 'Export GeoJSON' button.
Using Your Saved GeoJSON with Leaflet-IIIF
If you want to use your saved geoJSON file with Leaflet-IIIF then you can refer to the page Using GeoJSON with Leaflet in the Leaflet documentation. Alternatively you can just clone my Glitch page Leaflet-IIIF-Annotation. Once you have opened Leaflet-IIIF-Annotation:
- Click on 'Settings' and select the option to 'Remix this Project'.
- Open 'app.js' and change the variable 'manifestUrl' to the URL of your IIIF manifest -
No comments:
Post a Comment