bplmaps / argo-astro

Migration of the ARGO project into Astro framework; will become deploy repo for ARGO when complete
0 stars 0 forks source link

Georeferencing module should fetch to see if annotation already exists #64

Closed garrettdashnelson closed 5 months ago

garrettdashnelson commented 5 months ago

The georeferencing component that appears on map collection pages (/src/components/Maps/Allmaps.vue) is used to link the collection to the Allmaps platform for user georeferencing of maps.

Currently, this is a static component which simply gives the user an outbound link to Allmaps Editor.

What it should do is perform a fetch at load time to see if the map has already been georeferenced. This query is performed by sending the first 16 characters of the Manifest's SHA-1 hash to https://annotations.allmaps.org/manifests/{hashedManifest}

If that returns a 200, then there's already georeferencing data present. This should update the button link text from "Georeference this map" to "Improve georeferencing on this map". It should also add a button with text "View this georeferenced map" that links to Allmaps Viewer at `https://editor.allmaps.org/#/collection?url=${encodeURIComponent(this.manifestId)}

Example

This map: https://argo-astro-dev.netlify.app/maps/commonwealth:6t053q82w/

Manifest canonical ID is: https://ark.digitalcommonwealth.org/ark:/50959/6t053q82w/manifest

SHA-1 hash is: b566c3f72134329df18c0230f37fd7643cf0fb49

Annotation query with first 16 chars of hash is: https://annotations.allmaps.org/manifests/b566c3f72134329d

That returns a 200, so the component should change the existing button text to "Improve georeferencing on this map" and add another button linking to https://viewer.allmaps.org/?url=https%3A%2F%2Fark.digitalcommonwealth.org%2Fark%3A%2F50959%2F6t053q82w%2Fmanifest

garrettdashnelson commented 5 months ago

@alexandergknoll I hope I explained this clearly but I'm so close to it that I could easily be missing what context is needed. LMK if this doesn't make sense.