Closed MaeseppTarvo closed 7 years ago
Whoever is struggling with this in the future:
NSObject
and CKAnnotation
class Annotation: NSObject, CKAnnotation{
weak var cluster: CKCluster?
var coordinate: CLLocationCoordinate2D
var name: String!
init(coordinate: CLLocationCoordinate2D, name: String){
self.coordinate = coordinate
self.name = name
}
}
Make array: var annotations:[Annotations] = []
Append the annotations array and then assign this array to clusterManager self.mapView.clusterManager.annotations = self.annotations
Hey! I am trying to use this with Swift and GoogleMap. But the documentation is pretty small and it is hard for me to read Objective-c so I pretty much read comments. My problem is that how to add my GMSMarker as annotations into
clusterManager
since it is of typeCKAnnotation
?I have Custom marker that inherits from
GMSMArker
.This is what I am trying to do:
In
markerFor cluster: CKCluster
I did like this:What should I do?