Files
MapLibreParticleLab/platform/macos/app/LocationCoordinate2DTransformer.m
Bart Louwers e4a4b9ec67 macOS Metal + AppKit app (#2205)
Co-authored-by: mwilsnd <mwilsnd@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-04-02 01:52:19 +02:00

32 lines
638 B
Objective-C

#import "LocationCoordinate2DTransformer.h"
#import <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