NMAUint64 distance = [NMANavigationManager sharedNavigationManager].distanceToDestination;
はokです。それでは、自分で距離を計算してください。以下はメトリックシステムの例です
- (NSString *)distanceToMetricStringFromLongValue:(NMAUint64)value {
NSString *distanceText = @"";
if (value < 250) {
NMAUint64 distance = (NMAUint64)round(value/5.0) * 5;
if (showZeroDistance || distance > 0) {
distanceText = [NSString stringWithFormat:@"%lld m", distance];
}
} else if (value < 500) {
NMAUint64 distance = (NMAUint64)round(value/10.0) * 10;
if (showZeroDistance || distance > 0) {
distanceText = [NSString stringWithFormat:@"%lld m", distance];
}
} else if (value < 1000) {
NMAUint64 distance = (NMAUint64)round(value/50.0) * 50;
distanceText = [NSString stringWithFormat:@"%lld m", distance];
} else {
double distance = value/1000.0;
if (distance >= 10.0) {
distanceText = [NSString stringWithFormat:@"%0.0f km", round(distance)];
} else {
distanceText = [NSString stringWithFormat:@"%0.1f km", distance];
}
}
}