Skip to content

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