annotorious-v1 icon indicating copy to clipboard operation
annotorious-v1 copied to clipboard

Mobile support for OpenLayers

Open moschlar opened this issue 10 years ago • 2 comments

I just noticed that Annotorious does not show the annotation when tapping on it for an OpenLayers map, but it does for a plain image. I suppose its due to the fact that annotorious.mediatypes.openlayers.Viewer.prototype.getAnnotationsAt et al are not yet implemented - or are there other problems regarding touch and OpenLayers? If not, I would try to implement that quickly.

moschlar avatar Sep 11 '15 13:09 moschlar

To be honest, I didn't look into mobile-compatibility with OpenLayers at all. There's definitely hidden potential for Yak-shaving for anyone looking into it, I'd say. Implementing getAnnotationsAt is probably the key to making existing annotations 'clickable'. But enabling touch-based creation of annotations would be another matter.

I think there is one (or two?) forks out there where people have looked into touch-support more generally. One day I hope I can take some time to re-consolidate these bits into the main codebase. But at the moment I don't have the time to give Annotorious the attention it deserves :-(

rsimon avatar Sep 14 '15 10:09 rsimon

Ok, so I started shaving: I "implemented" (a.k.a. copy-pasted and slighty adapted the code from image.viewer.js) getAnnotationsAt for openlayers.Viewer. Sadly, this doesn't seem to be sufficient already.

From glancing at the other initialization/listener code, it seems that there are quite some differences in the event handler attachment code between the two viewers...

I'll be experimenting further in my branch https://github.com/moschlar/annotorious/tree/openlayers-touch, if you have any hints or ideas, I'd be more than happy about it. I'm neither good at Closure, nor at JavaScript in general...

moschlar avatar Sep 15 '15 11:09 moschlar