Open rsimon opened 11 years ago
Note: for OpenLayers, the best strategy would be to change the way the Canvas is added to the map: Annotorious should not create another wrapping DIV, but attach the canvas directly to the original map DIV.
As reported by @gergely-ujvari, the same issue applies to normal images that are resized dynamically. It should be possible though to attach a Window resize listener, and recalculate image pixel width on resize. Only needs a good test case & example page.
Rainer, this may be a good example page too: http://ajw.asahi.com/article/0311disaster/fukushima/AJ201311030016
If I create an annotation when the image is small, like so: http://image3.dokku.hypothes.is/a/LqyVp8eRTPe4qK9tQtFxZg
And then click the "expand" icon at the upper right of image, then the selector does not refer correctly to the same part of the image.
I'm using the image annotator available via the bookmarklet at the bottom of our test server here: http://image3.dokku.hypothes.is/
Hi Dan,
wow - that's a pretty tricky example & I'm surprised this works this well at all. I couldn't figure out what exactly happens on that page (lack of time). But apparently, clicking the "expand" button "transplants" the image DOM element from one DIV into another.
But it seems to pick up the surrounding Annotorious wrapper correctly, so the main issue is indeed the image resizing. Some thoughts:
Note: changes to the DOM can be monitored (on most browsers?) it seems! See:
http://www.quirksmode.org/js/events/DOMtree.html http://davidwalsh.name/dom-events-javascript
I.e. a possible fix could therefore be to attach a DOM Tree Event listener, and reset Annotorious whenever the DOM is modified - or, ideally, only the subtree(s) containing the annotated image(s) - if it is possible to determine this.
Continuing the discussion in Issue #86, since it is actually becoming quite distinct from the original scope of the original (OpenLayers-related) issue.
Last commit fixes this issue to the extent required for Release 0.7!
Via @klokantech: "[...] while testing I have realised Annotorious is not able to handle resize of the DIV with the map - which is quite bad for our fullscreen layouts."
Root cause is that the HTML
The second part is likely not part of release 0.7!