hulab / ClusterKit

An iOS map clustering framework targeting MapKit, Google Maps and Mapbox.
MIT License
512 stars 86 forks source link

Working with annotations downloaded from server on region change? #83

Closed gerchicov-bp closed 3 years ago

gerchicov-bp commented 4 years ago

You are perfect! In the example you precreated a local list of points and don't change it. But what if you have an infinite number of points and server sends you a limited annotation info based on the selected region?

alexsteinerde commented 4 years ago

You can use the delegate method func mapView(_: MKMapView, regionDidChangeAnimated _: Bool) the protocol MKMapViewDelegate provides as I understand your question correctly. Inside of the function you can then make the network request to load more pins.

maxep commented 3 years ago

Yes, you can request new annotations and use the CKClusterManager.addAnnotations(_:)