Open jacogasp opened 7 years ago
quadTree.h header now public. Method setQuadTree: for clusterManager to specify which quadTree it should use.
quadTree.h
setQuadTree:
clusterManager
How to use: create a quadTree object and fill it with an annotationsArray
quadTree
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)
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?
quadTree.h
header now public. MethodsetQuadTree:
forclusterManager
to specify which quadTree it should use.How to use: create a
quadTree
object and fill it with anannotationsArray
Then, instead to set the
clusterManager
annotations, set thequadTree
Use the
clusterManager
as usual, but query thequadTree
to get annotations in a certain area