collectiveaccess / pawtucket2

Pawtucket Improved
GNU General Public License v3.0
85 stars 76 forks source link

Image Viewer Needs Touch Support #35

Closed miqrogroove closed 2 years ago

miqrogroove commented 2 years ago

Is there an updated version of the included image viewer? It works great with a mouse and keyboard, but on my touch screen I can't pan or pinch zoom at all.

collectiveaccess commented 2 years ago

That's the current version.

miqrogroove commented 2 years ago

Part of the problem is the Image Overview feature is broken. It doesn't work right with a mouse or touch screen in any browser I've tried. This leaves mouse panning as the only means of navigation. If the tile viewer isn't going to get updates then I hope that part can be replaced with something newer.

I see the NGA site is using Mirador for its "Archival" category. Touch works with that one, for example. However, it doesn't seem to have a default implementation here. Using viewer = Mirador doesn't work out of the box.

collectiveaccess commented 2 years ago

Really? How exactly is it broken? It does what it's supposed to via mouse clicks in Chrome/Safari/Firefox.

miqrogroove commented 2 years ago

To be fair, the Image Overview works at some zoom levels and not others. For example, go here and zoom in about 25%

https://kress.nga.gov/Detail/objects/3483

When full out or full in it does work. But with the slider about 25% to 33% from the left, that overview thing is not working the same way. It will show the rectangle in the correct spot, but it won't pan to the correct position where I click.

collectiveaccess commented 2 years ago

Oh I see the issue now. Thanks for finding this. We're not scaling coordinates when we pan, which doesn't make much of a difference at closer magnifications, but blows up when pulled out a bit.

miqrogroove commented 2 years ago

I copied this file to my server and refreshed in Chrome https://raw.githubusercontent.com/collectiveaccess/pawtucket2/develop/assets/jquery/jquery-tileviewer/jquery.tileviewer.js

Seems to be much better, however around 50% zoom I'm unable to pan to the bottom or right edges. Should I open a new issue?

miqrogroove commented 2 years ago

Nevermind, I found the correct math for this. I will open a new PR for you.

miqrogroove commented 2 years ago

See #39

miqrogroove commented 2 years ago

All of the above problems still exist in v1.7.16. See #46 for the scrolling patch to master.