Comments (11)
Thanks for the report @roccx , I've also noticed that flickering on iOS11
I havent found a solution yet.
from clusterkit.
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.
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.
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.
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.
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.
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.
@frgmt the refresh occurs to me also panning the map without zooming.
from clusterkit.
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.
@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.
Just read new algorithm, seems much more efficient 🔥
from clusterkit.
Related Issues (20)
- [CKCluster retain]: message sent to deallocated instance HOT 3
- ClusterKit incompatible with with MGLAnnotations? HOT 5
- Use `clusterManager` in MGLMapView extensions (Carthage & 0.4.0) HOT 2
- clustering for Mapbox not working HOT 1
- How to animate the position of a marker/cluster with Mapbox? HOT 2
- Link to Clusterkit Wiki is wrong HOT 1
- GMSMapView is freezing when call updateClusters with 900+ markers
- Annotation and cluster views are actually re-created when scrolling the map but not re-used (Mapbox) HOT 5
- Waiting for Mapbox 5.0 support , thanks! HOT 1
- Swift Package Manager HOT 1
- Annotation below 3d building HOT 1
- Always error when cluster annotations in mapbox (The error also occurs in the swift + mapbox example) HOT 1
- iOS 13 issues
- Working with annotations downloaded from server on region change? HOT 2
- Value of type 'MGLMapView' has no member 'clusterManager' HOT 1
- GMSMapView+ClusterKit.swift
- mapView(_:didTap:) crashes randomly HOT 1
- Stuttering on Mapbox since iOS14 HOT 2
- Update to 6.3 HOT 1
- Cannot find type 'CKAnnotation' in scope HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clusterkit.