`

iOS Apple内部对MKUserLocation去除偏移的方法(私有api)

    博客分类:
  • ios
 
阅读更多

找到Apple内部对MKUserLocation去除偏移的方法。 

[MKLocationManager _applyChinaLocationShift:(CLLocation*)arg] 

这个方法返回去除偏移后的CLLocation*。 

@interface MKLocationManager 
- (CLLocation*)_applyChinaLocationShift:(CLLocation*)arg; 
- (BOOL)chinaShiftEnabled; 
+ (id)sharedLocationManager; 
@end 

CLLocationManager's Delegate: 

- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation 
{ 
if ([[MKLocationManager sharedLocationManager] chinaShiftEnabled]) { 
newLocation = [[MKLocationManager sharedLocationManager] _applyChinaLocationShift:newLocation]; 
if (newLocation == nil) return; 
} 
}
 



分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics