Code Monkey home page Code Monkey logo

Comments (14)

choefele avatar choefele commented on August 15, 2024

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.

maxencehenneron avatar maxencehenneron commented on August 15, 2024

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.

maxencehenneron avatar maxencehenneron commented on August 15, 2024

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.

choefele avatar choefele commented on August 15, 2024

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.

alexsteinerde avatar alexsteinerde commented on August 15, 2024

Hello,
I have the same problem and would like to have a solution for this issue as well.

from cchmapclustercontroller.

maxencehenneron avatar maxencehenneron commented on August 15, 2024

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.

CCHMapClusterProblem.zip

Here's a video on how to reproduce : https://youtu.be/qo_9DAKU_KI

from cchmapclustercontroller.

choefele avatar choefele commented on August 15, 2024

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.

Preen avatar Preen commented on August 15, 2024

Is there any news on this?

from cchmapclustercontroller.

choefele avatar choefele commented on August 15, 2024

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.

tobias-r avatar tobias-r commented on August 15, 2024

Any news on this?

from cchmapclustercontroller.

BenSS avatar BenSS commented on August 15, 2024

from cchmapclustercontroller.

mxcl avatar mxcl commented on August 15, 2024

@BenSS If I may ask, which maintained solution did you use instead?

from cchmapclustercontroller.

tobias-r avatar tobias-r commented on August 15, 2024

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.

BenSS avatar BenSS commented on August 15, 2024

@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)

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.