Git Product home page Git Product logo

Comments (6)

pcsantana avatar pcsantana commented on May 27, 2024

Hi,
I found out! Just return "false" in:

  • (BOOL)mapView:(TSClusterMapView *)mapView shouldForceSplitClusterAnnotation:(ADClusterAnnotation *)clusterAnnotation;

    Thank you!!

from tsclustermapview.

pcsantana avatar pcsantana commented on May 27, 2024

Hi,

If possible I would to suggest a little modification. If there are a lot of places very close to each other, with another places with exactly the same coordinates, the algorithm not call the method below:

-(BOOL)mapView:(TSClusterMapView *)mapView shouldForceSplitClusterAnnotation:(ADClusterAnnotation *)clusterAnnotation;

Debugging the code, I find out the reason. Because the method is only called when the groupedRounded annotations count is equal to 1:

//...TSClusterMapView class, in "splitClusterToOriginal:clusterAnnotation" method
NSDictionary *groupedRoundedLatLonAnnotations = [TSClusterOperation groupAnnotationsByLocationValue:[NSSet setWithArray:clusterAnnotation.cluster.originalAnnotations]];

//Here the condition
if (groupedRoundedLatLonAnnotations.allKeys.count == 1) {
    if ([_clusterDelegate respondsToSelector:@selector(mapView:shouldForceSplitClusterAnnotation:)]) {
        if (![_clusterDelegate mapView:self shouldForceSplitClusterAnnotation:clusterAnnotation]) {
            return;
        }
    }
}

Maybe this condition can be parameterized (count value). In my case, for example, I don't need this condition.
Please correct me if I am wrong.

Thank you very much!

from tsclustermapview.

ashare80 avatar ashare80 commented on May 27, 2024

@pcsantana Hmm yeah I guess the idea there was that if they weren't close enough to get grouped together into 1 single shared coordinate it should always split.

I think we can just get rid of that if statement of that solves your problem?

from tsclustermapview.

pcsantana avatar pcsantana commented on May 27, 2024

Yes @ashare80, I commented the if statement and it solved my problem

from tsclustermapview.

ashare80 avatar ashare80 commented on May 27, 2024

@pcsantana ok cool next version will remove it

from tsclustermapview.

pcsantana avatar pcsantana commented on May 27, 2024

Thank you! :)

from tsclustermapview.

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.