Comments (14)
Hi – did you implement both mapView:(MKMapView *)mapView viewForAnnotation:
and mapClusterController:willReuseMapClusterAnnotation:
? The former is called when the annotation view is created and the latter when the annotation view is reused. In both cases, you'll have to properly updated your annotation views.
Also, make sure you only add annotations to the cluster manager and never to the map view directly
from cchmapclustercontroller.
Yes, both of then are implemented. I also did this:
self.mapClusterController.cellSize = CGFloat(self.mapView.frame.width / 6)
To conform to "The actual cell size used for clustering will be adjusted so that the map's width is a multiple of the cell size. This avoids realignment of cells when panning across the 180th meridian."
This is also happening in the example, sometimes zooming on a stack makes the cluster bigger (it shouldn't, since we are zooming, we may except the stack to be smaller) and zooming out makes a cluster smaller, when notifications should be added. The grid shown when isDebugingEnabled = true also shows strange movements, it seems that the alignment is changing
from cchmapclustercontroller.
I made a new video about this issue: Please pay attention to the random grid movement, which sometimes sets different stacks:
https://www.youtube.com/watch?v=_3k_LN9C65M&feature=youtu.be
from cchmapclustercontroller.
Hmm – have you compared this to the demo project in this repo? Does the sample in this repo show the same problem? Maybe you need to provide a sample project that reproduces this issue so I can debug the problem
from cchmapclustercontroller.
Hello,
I have the same problem and would like to have a solution for this issue as well.
from cchmapclustercontroller.
So I made an example project :
Please go to Ukraine and you should see two stacks of photos, zoom as much as possible on one of those stacks and slowly zoom out, you will see that the two photos are always clustered/unclustered. It is easier to see on a real device.
Here's a video on how to reproduce : https://youtu.be/qo_9DAKU_KI
from cchmapclustercontroller.
I can also reproduce the problem with the example that comes with the repo. This is a new problem – it looks like iOS 10 changed something so that the rect alignment used for the cluster cells doesn't work any more.
@dernise, @alexsteinerde can you have a look for a possible solution? I won#t be able to work on this for the next week or two
from cchmapclustercontroller.
Is there any news on this?
from cchmapclustercontroller.
Sorry, but I don't have time at the moment to look into this. Do you have an idea how to fix this?
Thanks
from cchmapclustercontroller.
Any news on this?
from cchmapclustercontroller.
from cchmapclustercontroller.
@BenSS If I may ask, which maintained solution did you use instead?
from cchmapclustercontroller.
Same problem here, tried the Apple Solution from iOS 11 but it's terribly slow with a lot of markers. I believe it works with graphical collision and needs to render all the markers before clustering, so your solution is 1000 times better. Any chance you could improve this?
@BenSS Which solution did you use?
from cchmapclustercontroller.
@tobias-r The original fix/PR I didn't really have time to clean up was make sure the added views were removed. At the time they were left hanging around, so you could end up with hundreds stacked on top of each other.
We moved to Kingpin for iOS10, and using the built-in MapKit clustering for iOS 11+.
from cchmapclustercontroller.
Related Issues (20)
- Annotation views occasionally disappear while panning/zooming HOT 2
- willReuseMapClusterAnnotation does not work in Swift HOT 6
- showAnnotations:animated: adds the default pin instead of custom Annotation Views HOT 1
- Using own custom MKAnnotation subclass for uniqueLocations HOT 4
- Two markers at exact same location HOT 1
- How to get the instance of CCHMapClusterAnnotation? HOT 4
- Crash due to usage of KVO HOT 5
- Annotations and clusters get removed randomly when using MKMapTypeHybridFlyover HOT 7
- Cannot refer to custom subclass of MKAnnotation in viewForAnnotation HOT 3
- Cannot tap on Annotation View
- Can't see annotation while too zoomed out HOT 4
- Annotation coordinate is not properly updated HOT 2
- Displaying different annotation views HOT 1
- Make the representation of ClusterAnnotationView unchanged when zooming in or out HOT 5
- changing the annotation view when isUnique changes HOT 2
- Getting wrong annotation count on click of cluster in swift 3 HOT 1
- TV OS? HOT 1
- Removing Annotations doesn't work correctly HOT 6
- Is it possible for clusters to have sub clusters?
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 cchmapclustercontroller.