blob: be60c3c7874663d9ce039758251b2407d080a870 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
#import "MGLRendererConfiguration.h"
#import "MGLOfflineStorage_Private.h"
#if TARGET_OS_IPHONE
#import <UIKit/UIKit.h>
#else
#import <AppKit/AppKit.h>
#endif
@implementation MGLRendererConfiguration
+ (instancetype)currentConfiguration {
return [[self alloc] init];
}
- (mbgl::DefaultFileSource *)fileSource {
return [MGLOfflineStorage sharedOfflineStorage].mbglFileSource;
}
- (mbgl::GLContextMode)contextMode {
return mbgl::GLContextMode::Unique;
}
- (const float)scaleFactor {
#if TARGET_OS_IPHONE
return [UIScreen instancesRespondToSelector:@selector(nativeScale)] ? [[UIScreen mainScreen] nativeScale] : [[UIScreen mainScreen] scale];
#else
return [NSScreen mainScreen].backingScaleFactor;
#endif
}
- (mbgl::optional<std::string>)cacheDir {
return mbgl::optional<std::string>();
}
- (mbgl::optional<std::string>)localFontFamilyName {
NSString *fontFamilyName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"MGLIdeographFontFamilyName"];
return fontFamilyName ? std::string([fontFamilyName UTF8String]) : mbgl::optional<std::string>();
}
@end
|