d-i-t-a/R2D2BC

navigation using cfi

Closed this issue · 5 comments

Hi, I see that the D2Reader has a goTo function which takes a locator object and uses it to navigate the reader. But there is a problem in this approach.
On different screen sizes, the value for progression changes. This makes it an unreliable way of sharing reader location with other users.

I was wondering if there is a way to navigate the reader using cfi, as a cfi value should be same for any given screen size.

reader.goTo takes in a locator argument which is described here:
image
and the Locations type:
image
I see that there is a fragment identifier here. I have tried calling the goTo function with a generated cfi from the readium-cfi-js library as a string in the fragment identifier, but it does not seem to work.
I simply want to create an annotation, get its cfi and then navigate the reader to that annotation using cfi.
Is there no simple way of achieving this?

@MuhammadPen R2D2BC uses a custom way to navigate using progression There is no way to navigate the reader using cfi unfortunately

@MuhammadPen R2D2BC uses a custom way to navigate using progression There is no way to navigate the reader using cfi unfortunately

@aferditamuriqi this seems like quite a limitation. Is this correct?

Here is how I'm using the navigate function:

try {
      await reader?.goTo({
        href: pageName,
        locations: { fragment: fragment },
      });
    } catch (error) {
      console.error(error);
    }

Here is my fragment:
epubcfi(/6/8!/4/2[pgepubid00003]/8/1:24)

Nothing happens when I call the above goTo method and I dont get any errors either.

@MuhammadPen R2D2BC uses a custom way to navigate using progression There is no way to navigate the reader using cfi unfortunately

This is incorrect, R2D2BC does not use a custom way but the Readium way to navigate . It uses a locator and CFI is not part of R2 !

@aferditamuriqi Can you please explain what is the fragment property inside the locator? I though it was cfi, but as you said readium v2 does not support cfi. so what does this fragment identifier mean?
image