Upgrade to Pro — share decks privately, control downloads, hide ads and more …

iOS 11 MapKit Annotation Clustering

denkeni
April 12, 2018

iOS 11 MapKit Annotation Clustering

denkeni

April 12, 2018
Tweet

More Decks by denkeni

Other Decks in Technology

Transcript

  1. iOS 11 MapKit Annotation Clustering ᪴襊妿涢藳 by @denkeni

  2. None
  3. With Clustering1 Looks cleaner2. 2 App Store: CafeFreelance - ૡ֢߅珹記

    1 https://github.com/Nandalu/NDLAnnotationClustering
  4. With 2 types of Clustering Overlapping looks not so good...

  5. iOS 11 Annotation Clustering IS OUT!!!

  6. clusteringIdentifier3 An identifier that determines whether the annotation view participates

    in clustering. var clusteringIdentifier: String? { get set } The default value of this property is nil, which prevents the annotation view from being clustered with other annotation views. Setting the property to a non nil value it to participate in clustering. 3 Documentation > MapKit > MKAnnotationView > clusteringIdentifier
  7. None
  8. final class AnnotaionView : MKMarkerAnnotationView { override init(annotation: MKAnnotation?, reuseIdentifier:

    String?) { super.init(annotation: annotation, reuseIdentifier: reuseIdentifier) clusteringIdentifier = "AnnotaionView" } } DID NOT WORK (But seems to work now, at latest version)
  9. Working code4 final class AnnotaionView : MKMarkerAnnotationView { override var

    annotation: MKAnnotation? { willSet { clusteringIdentifier = "AnnotaionView" } } } 4 What's New in MapKit, WWDC 2017 - Session 237
  10. On iOS 11.1 Crash rdar://35381219

  11. None
  12. On iOS 11.2 Crash rdar://36131654

  13. None
  14. Summary: — Use MapKit Annotation Clustering on iOS 11.3 or

    later — Question, or help5? 5 https://github.com/Nandalu/Housing