GithubHelp home page GithubHelp logo

Comments (9)

rsimon avatar rsimon commented on July 17, 2024 1

Good point. Maybe a clearAnnotations method would be nice.

As far as functionality is concerned: you should get the same effect by setting setAnnotations([]). The empty array should replace the existing annotations if I remember correctly. But I'll double check...

from annotorious-openseadragon.

rsimon avatar rsimon commented on July 17, 2024 1

Yikes. I'm realizing that API-wise, the OpenSeadragon plugin lags further behind the standard version as I thought.

  • getAnnotations was indeed broken. I just fixed this in the master branch.
  • setAnnotations did not remove existing annotations. I fixed this, too. You can now use setAnnotations to clear the annotation layer, and it's also ok to call it without argument. I.e. both this works:
anno.setAnnotations([]);

anno.setAnnotations();

from annotorious-openseadragon.

rsimon avatar rsimon commented on July 17, 2024

Also thanks, I'll check about getAnnotations.

from annotorious-openseadragon.

rsimon avatar rsimon commented on July 17, 2024

P.S. I think in terms of API semantics, calling setAnnotations with empty or no argument feels sufficient, and there's maybe no need for an extra clearAnnotations method. But I'm happy to hear dissenting opinions :-)

from annotorious-openseadragon.

rsimon avatar rsimon commented on July 17, 2024

P.P.S: that webview client looks awesome! Looking forward to trying this out myself once you've published it.

from annotorious-openseadragon.

atomotic avatar atomotic commented on July 17, 2024

fixing getAnnotations() has solved the problem, i've not looked deeply the code but i don't need to setAnnotations[] empty

a quick demo: https://docuver.se/tmp/annotorius.app.mp4
(i'll fix some things on building and packaging and i will publish)

from annotorious-openseadragon.

rsimon avatar rsimon commented on July 17, 2024

Fantastic! Both using getAnnotations and then looping through the annotations using removeAnnotation will work. Although, technically, a call to setAnnotations() will be marginally faster, if you are being super-picky about it ;-)

from annotorious-openseadragon.

atomotic avatar atomotic commented on July 17, 2024

sorry, i explain better: after your fix of yesterday i don't need anymore to remove the previous annotations on canvas change.
https://github.com/atomotic/annotorius-desktop/blob/master/public/index.html#L34-L43

i published here https://github.com/atomotic/annotorius-desktop
is very very raw and incomplete, i spent on this just a couple of hours

from annotorious-openseadragon.

rsimon avatar rsimon commented on July 17, 2024

Ah - of course! Because setAnnotations now properly resets as it should. Thanks for the link! I'll try to install & test drive myself tonight :-)

from annotorious-openseadragon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.