gunterhager / annotationclustering Goto Github PK
View Code? Open in Web Editor NEWFramework that clusters annotations on MKMapView. (Deprecated)
License: MIT License
Framework that clusters annotations on MKMapView. (Deprecated)
License: MIT License
I have problem when trying to add same coordinates many time but in example show only 440 cluster.
To re produce the bug :
in Example/ViewController.swift
line 29: let numberOfLocations = 1000
line 52: a.coordinate = CLLocationCoordinate2D(latitude: 15.415599822998047, longitude: 101.57099914550781)
and then compile and run.
Hi, this is a really nice plugin. Everything seems to work except for the AnnotationClusterViewOptions. The code below worked back when i used the FBAnnotationClusteringSwift but can't figure out why it isn't working here.
Here's a snippet from my viewForAnnotation
method that handles the annotation cluster
case let cluster as AnnotationCluster:
reuseId = "Cluster"
if let clusterView = mapView.dequeueReusableAnnotationViewWithIdentifier(reuseId) as? AnnotationClusterView {
clusterView.reuseWithAnnotation(cluster)
return clusterView
} else {
let options = AnnotationClusterViewOptions(smallClusterImage: "cluster_small", mediumClusterImage: "cluster_medium", largeClusterImage: "cluster_large")
let clusterView = AnnotationClusterView(annotation: cluster, reuseIdentifier: reuseId, options: options)
return clusterView
}
Thanks!
Hi!
Really cool clustering you have implemented. However, I'm looking for a way to remove all annotations from the cluster before I add new ones in order to avoid duplicates.
I tried to implement this by adding this in QuadTree.swift
func removeAllAnnotations(){
rootNode.removeAllAnnotations()
}
And this seems to work... kinda, but not if I call it when adding annotations.
public func addAnnotations(annotations:[MKAnnotation]) {
lock.lock()
removeAllAnnotations()
for annotation in annotations {
tree.addAnnotation(annotation)
}
lock.unlock()
}
func removeAllAnnotations(){
tree.removeAllAnnotations()
}
I still get duplicates this way. And even if I add the removeAllAnnotations()
call to after the tree.addAnnotation(annotation)
call I still get plenty of annotations in my map.
Any idea how to best implement this? I basically just want to remove all clustered annotations before adding new ones.
removeAnnotation
would find the given annotation leaf in the quadtree and remove it.
This would make it possible to
removeAnnotation
& addAnnotation
It would be great to have animations when a couple of pins are being clustered into a single cluster pin or when a cluster pin gets exploded into a couple of pins.
This might be of interest, too:
CCHMapClusterController
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.