Files
MapLibreParticleLab/platform/macos/app/LocationCoordinate2DTransformer.m
mwilsnd 20d9e1028c Platform flattening overhaul (#1393)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Bart Louwers <bart@emeel.net>
2023-07-26 17:50:34 +02:00

32 lines
645 B
Objective-C

#import "LocationCoordinate2DTransformer.h"
#import <Mapbox/Mapbox.h>
@implementation LocationCoordinate2DTransformer {
MLNCoordinateFormatter *_coordinateFormatter;
}
+ (Class)transformedValueClass {
return [NSString class];
}
+ (BOOL)allowsReverseTransformation {
return NO;
}
- (instancetype)init {
if (self = [super init]) {
_coordinateFormatter = [[MLNCoordinateFormatter alloc] init];
}
return self;
}
- (id)transformedValue:(id)value {
if (![value isKindOfClass:[NSValue class]]) {
return nil;
}
return [_coordinateFormatter stringForObjectValue:value].capitalizedString;
}
@end