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

public quadTree object - setQuadTree: method #24

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jacogasp
Copy link

quadTree.h header now public.
Method setQuadTree: for clusterManager to specify which quadTree it should use.

How to use:
create a quadTree object and fill it with an annotationsArray

var quadTree = CKQuadTree()
quadTree = CKQuadTree(annotations: annotationsArray)

Then, instead to set the clusterManager annotations, set the quadTree

let algorithm = CKNonHierarchicalDistanceBasedAlgorithm()
algorithm.cellSize = 300
mapView.clusterManager.algorithm = algorithm
mapView.clusterManager.marginFactor = 1
mapView.clusterManager.setQuadTree(quadTree)

Use the clusterManager as usual, but query the quadTree to get annotations in a certain area

let annotationsInRect = quadTree.annotations(in: rect)

@maxep maxep force-pushed the master branch 2 times, most recently from e984a66 to 13aa7ca Compare July 1, 2019 13:23
@jacogasp
Copy link
Author

Hello @maxep,
I see you tried to push this branch two time.

At this point, this branch is open since two years. What are the plans for it?

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

Successfully merging this pull request may close these issues.

1 participant