MapBox比较两组RMAnnotations

时间:2015-05-24 23:45:46

标签: ios mapkit mapbox rmannotation

我尝试使用以下代码比较两组RMAnnotations(适用于iOS的MapBox SDK中使用的注释):

 NSMutableSet *before = [NSMutableSet setWithArray:self.mapboxView.annotations];

if(self.mapboxView.userLocation)
    [before removeObject:[self.mapboxView userLocation]];

NSSet *after = [NSSet setWithArray:annotations];

NSMutableSet *toKeep = [NSMutableSet setWithSet:before];
[toKeep intersectSet:after];
NSLog(@"to keep %lu", (unsigned long)toKeep.count);

NSMutableSet *toAdd = [NSMutableSet setWithSet:after];
[toAdd minusSet:toKeep];
NSLog(@"to add %lu", toAdd.count);

MKMapKit中MKAnnotations的效果很好,但在MapBox中没有效果。有人会知道为什么会这样吗?

谢谢!

0 个答案:

没有答案