Wie ich aus der Dokumentation Real Subclussing nur von MKMapView verstanden. Ist es möglich, Realm-Clustering mit GoogleMaps zu verwenden, oder sollte ich nach einem anderen SDK suchen?Real Clustering GMSMapView ios
Antwort
Im Moment ist ABFRealmMapView entworfen, um mit MKMapView
zu arbeiten, aber es könnte erweitert werden, um mit Google Maps SDK zu arbeiten.
Die interne Komponente, die das Clustering tatsächlich durchführt, ist: ABFLocationFetchedResultsController. Auf diese Weise können Sie eine ABFLocationFetchRequest
erstellen, die die Kartensuche beschreibt, und dann diese Objekte holen, entweder mit aktiviertem Clustering oder nicht. Sie könnten kopieren, wie die Klasse ABFRealmMapView tatsächlich ABFLocationFetchedResultsController
verwendet und diese in eine Unterklasse der Google-Kartenansicht portiert.
Der Import-Code ist in der refreshMapView
Methode, die automatisch aufgerufen wird (wenn autorefresh
aktiviert ist) in Reaktion auf die Karte bewegt wird:
- (void)refreshMapView
{
@synchronized(self) {
[self.mapQueue cancelAllOperations];
MKCoordinateRegion currentRegion = self.region;
ABFLocationFetchRequest *fetchRequest =
[ABFLocationFetchRequest locationFetchRequestWithEntityName:self.entityName
inRealm:self.realm
latitudeKeyPath:self.latitudeKeyPath
longitudeKeyPath:self.longitudeKeyPath
forRegion:currentRegion];
if (self.basePredicate) {
NSCompoundPredicate *compPred =
[NSCompoundPredicate andPredicateWithSubpredicates:@[fetchRequest.predicate,self.basePredicate]];
fetchRequest.predicate = compPred;
}
[self.fetchResultsController updateLocationFetchRequest:fetchRequest
titleKeyPath:self.titleKeyPath
subtitleKeyPath:self.subtitleKeyPath];
typeof(self) __weak weakSelf = self;
NSBlockOperation *refreshOperation = [[NSBlockOperation alloc] init];
NSBlockOperation __weak *weakOp = refreshOperation;
MKMapRect visibleMapRect = self.visibleMapRect;
ABFZoomLevel currentZoomLevel = ABFZoomLevelForVisibleMapRect(visibleMapRect);
if (self.clusterAnnotations &&
currentZoomLevel <= self.maxZoomLevelForClustering) {
MKZoomScale zoomScale = MKZoomScaleForMapView(self);
[refreshOperation addExecutionBlock:^{
if (![weakOp isCancelled]) {
[weakSelf.fetchResultsController performClusteringFetchForVisibleMapRect:visibleMapRect
zoomScale:zoomScale];
[weakSelf addAnnotationsToMapView:weakSelf.fetchResultsController.annotations];
[weakSelf registerChangeNotification:weakSelf.autoRefresh];
}
}];
}
else {
[refreshOperation addExecutionBlock:^{
if (![weakOp isCancelled]) {
[weakSelf.fetchResultsController performFetch];
[weakSelf addAnnotationsToMapView:weakSelf.fetchResultsController.annotations];
[weakSelf registerChangeNotification:weakSelf.autoRefresh];
}
}];
}
[self.mapQueue addOperation:refreshOperation];
}
}
- 1. Google iOS SDK GMSMapView Klasse deallokierten
- 2. GMSMapView animateToCameraPosition vergrößern - Animation verkleinern
- 3. iOS 10 GMSMapView zeigt mein Standortsymbol mit weißem Hintergrund
- 4. GMSMapView (google map) GMSGeometryContainsLocation-Methode stürzt in iOS ab?
- 5. Google Maps iOS SDK gelegentlich Absturz beim Zerstören von GMSMapView
- 6. GMSMapView nichts zeigt
- 7. EXC_BAD_ACCESS mit GMSMapView
- 8. Animieren von GMSMapView
- 9. Speicherleck in GMSMapView
- 10. Entfernen Sie alle GMSMarker von GMSMapView?
- 11. Spectral Clustering vs hierarchische Clustering
- 12. FFTW Real-to-Real-Transformation schreitet Array
- 13. GMSMapView nicht besetzt volle Grenzen
- 14. GMSMapView basierend auf Kompass drehen
- 15. "Instrumente beim Start abgestürzt" Appium auf iOS Real Device?
- 16. Serverseitiges Clustering?
- 17. Markov Clustering
- 18. spektrale Clustering
- 19. Effektives Clustering einer Ähnlichkeitsmatrix
- 20. Wie bekomme ich Koordinatenzentrum von gmsmapview in iphone
- 21. So entfernen Sie GMSPolygon aus GMSMapView
- 22. GMSMapview aktuellen Standort Marker nicht kommen
- 23. Google Maps iOS SDK - Hinzufügen von UIView/UIButton über eine GMSMapView
- 24. Real-World-Jython-Anwendungen
- 25. DWORD zu REAL Umwandlung
- 26. get real g.co url
- 27. konvertieren NominalDiffTime zu Real
- 28. Twilio Real Time Recording
- 29. Server Real Path
- 30. Real-World QVT