Code Monkey home page Code Monkey logo

Comments (11)

maxep avatar maxep commented on September 4, 2024 2

Thanks for the report @roccx , I've also noticed that flickering on iOS11
I havent found a solution yet.

from clusterkit.

thibauddavid avatar thibauddavid commented on September 4, 2024 2

I had the similar problem, and after some research, it happens that ClusterKit reloads each annotations on each pan, rotation etc.
I began to debug the lib, but didn't found any problem in the algorithm which could cause this bug.
As some said above, the underlying problem is that annotation adding are delayed in MKMapView compared to annotation removal (even if they are added before other get removed.)

In my case, the issue was mainly visible because I have several type of annotationViews, on which I update the image depending on type of annotation to display.
As annotationViews got reused, same pin could be reconfigured from a previous recycled pin (with a different image), causing a glitch on each reload.

My workaround consists in having 1 reuseIdentifier per annotation type (including CKCluster), thus configuring my annotationViews only after instantiating them.
As a result, my annotationViews are 100% stable, without any glitch.

Hope that helps !

from clusterkit.

maxep avatar maxep commented on September 4, 2024 2

I've released a new version : 0.3.0 including breaking changes answering this issue.
The clusters' updates and animations are now more efficient and as @thibauddavid described, making a good use of the reusable annotation view is a good practice.

Please check the CHANGELOG

from clusterkit.

jacogasp avatar jacogasp commented on September 4, 2024 1

I'm using custom annotations views with an animation during the update and running iOS11.
Everything works perfectly but the animation occurs also for clusters/annotations that don't change during the update.
For me it seems like that during mapView(_:, regionDidChangeAnimated:) all the annotations are rebuilt even the ones that should not be updated. Could the flickering related to this?

from clusterkit.

lennartstein avatar lennartstein commented on September 4, 2024 1

I did some debugging and I can say, that the flickering just happens when zooming not when moving the map to west/east/north/south. mapView(_:, regionDidChangeAnimated:) just rebuilt the annotations when zooming and moving the map. When moving without zooming it doesn't happen. Maybe there is some issue with the zooming?

from clusterkit.

mrylmz avatar mrylmz commented on September 4, 2024

I think the issue is that every annotation is replaced by new ones as @jacogasp says. Isn't there a way to filter annotations by -isEqual(_:) or -hash?

from clusterkit.

mrylmz avatar mrylmz commented on September 4, 2024

It seems like MKMapView is delaying the rendering process of new annotations in some way. Yes I think the annotations are all rebuild because the algorithm instance is getting replaced on zoom.

I think a solution for that problem would be to manage the annotations in a more smarter way or just delay the removal of the old annotations by 2 or 3 frames.

from clusterkit.

jacogasp avatar jacogasp commented on September 4, 2024

@frgmt the refresh occurs to me also panning the map without zooming.

from clusterkit.

maxep avatar maxep commented on September 4, 2024

The issue appears everytime the clusters are updated, on zoom or significant pan. As @roccx suggested, adding an annotation to MKMapView seems to be delayed. The idea would be to update the clusters (replace, expand, collapse) more efficiely. The update is made in the private method updateMapRect:animated:, the implementation should be rethink.

from clusterkit.

kkvinokk avatar kkvinokk commented on September 4, 2024

@maxep is anyone working on the solution for this issue? Please let us know when this is fixed.

In the time being is there any good alternative to fix this issue?

from clusterkit.

thibauddavid avatar thibauddavid commented on September 4, 2024

Just read new algorithm, seems much more efficient 🔥

from clusterkit.

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.