Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue or Feature... #16

Open
ghost opened this issue Mar 6, 2013 · 4 comments
Open

Issue or Feature... #16

ghost opened this issue Mar 6, 2013 · 4 comments

Comments

@ghost
Copy link

ghost commented Mar 6, 2013

Hello,

I am using OCMapView in an App and it is wonderful!!! But I do have a question about the way the cluster is determined. In regionDidChangeAnimated I call doClustering but as I move the map around the screen the pins sometime change location slightly with the region. By region I am referring to the yellow circle around the clustered area. Without looking too much into the source, I was guessing that this is due to the fact that the long and lat of the pin pin which marks the circle is changing.

Is this the way it should work, or can this be corrected by possibly sorting the longs and lats in the region and then the one used for the pin would be the same each time?

This would of course not make a difference if the map was zoomed but it may help when moved.

Anyway, maybe it is just something I am doing wrong but in any case OCMapView is great!!

@BotiKis
Copy link
Owner

BotiKis commented Mar 6, 2013

Hello there,

Yes, this is the way it works by default.
This happens because only annotation in the visible area are calculated to increase performance.
You can turn it of by enabling the clusterInvisibleViews property. On newer devices (iphone 4s and up) this should be alright for some thousand annotations.

Thank you and you are welcome. :]

@ghost
Copy link
Author

ghost commented Mar 6, 2013

Great, I will try that property since I only have around 200 annotations.

Also, can you tell me more about the clusterSize property? I don't really understand what that is doing. I set it to 0.2 in my app, but it seems to operate funny.

Thanks again,
Tony

On Mar 6, 2013, at 2:02 PM, "Botond Kis" notifications@github.com wrote:

Hello there,

Yes, this is the way it works by default.

This happens because only annotation in the visible area are calculated to increase performance.
You can turn it of by enabling the clusterInvisibleViews property. On newer devices (iphone 4s and up) this should be alright for some thousand annotations.

Thank you and you are welcome. :]


Reply to this email directly or view it on GitHub.

@rokemoon
Copy link

rokemoon commented Mar 6, 2013

After enabling clusterInvisibleViews app falled in
MKMapView : ; insertionNodeForItem(objc_object, MKQuadTrieNode_)

Call stack looks like this:
#0 0x000f54a0 in contains(objc_object, MKQuadTrieNode_) () <<<<<< here falled down
#4 0x000c7653 in -MKMapView addAnnotations:
#5 0x00009692 in -[OCMapView doClustering] at /Users/rokemoon/Downloads/OCMapView-master 2/OCMapView/OCMapView.m:177
#6 0x000055b3 in -[OClusterMapView_SampleViewController mapView:regionDidChangeAnimated:] at /Users/rokemoon/Downloads/OCMapView-master 2/OClusterMapView+Sample/OClusterMapView_SampleViewController.m:285
#7 0x000c06b6 in -MKMapView _didChangeRegionMidstream:

Number of annotations 5000, but sometimes it's falling when I press "add 100 random".
With 1000 the same bahaviour.

For testing I'm using your example, enabling clusterInvisibleViews here:

  • (void)viewDidLoad
    {
    [super viewDidLoad];
    mapView.delegate = self;
    mapView.clusterSize = kDEFAULTCLUSTERSIZE;
    mapView.clusterInvisibleViews = YES;
    labelNumberOfAnnotations.text = @"Number of Annotations: 0";
    }

Falles when zooming map.
Maybe I'm doing it wrong?

@rokemoon
Copy link

rokemoon commented Mar 6, 2013

Have this bug with disabled clusterInvisibleViews, but annotations count were 9000.
For replying this bug you should zoom and move map, in a few minutes it's falls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants