blob: 80f803815c273c412ebb608a65da65567987c8ba (
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.
#import "MGLBaseStyleLayer_Private.hpp"
#import "MGLStyleLayer_Private.hpp"
#import "MGLStyleAttributeValue.h"
#import "MGLBackgroundStyleLayer.h"
#include <mbgl/style/layers/background_layer.hpp>
@interface MGLBackgroundStyleLayer ()
@property (nonatomic) mbgl::style::BackgroundLayer *layer;
@property (nonatomic, readwrite) NSString *layerIdentifier;
@property (nonatomic, readwrite) NSString *sourceIdentifier;
@end
@implementation MGLBackgroundStyleLayer
@synthesize mapView;
- (instancetype)initWithLayerIdentifier:(NSString *)layerIdentifier sourceIdentifier:(NSString *)sourceIdentifier {
if (self = [super init]) {
_layerIdentifier = layerIdentifier;
_sourceIdentifier = sourceIdentifier;
_layer = new mbgl::style::BackgroundLayer(layerIdentifier.UTF8String);
}
return self;
}
#pragma mark - Accessing the Paint Attributes
- (void)setBackgroundColor:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)backgroundColor {
self.layer->setBackgroundColor(backgroundColor.mbgl_colorPropertyValue);
[self update];
}
- (id <MGLStyleAttributeValue>)backgroundColor {
return [MGLStyleAttribute mbgl_colorPropertyValueWith:self.layer->getBackgroundColor()];
}
- (void)setBackgroundPattern:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)backgroundPattern {
self.layer->setBackgroundPattern(backgroundPattern.mbgl_stringPropertyValue);
[self update];
}
- (id <MGLStyleAttributeValue>)backgroundPattern {
return [MGLStyleAttribute mbgl_stringPropertyValueWith:self.layer->getBackgroundPattern()];
}
- (void)setBackgroundOpacity:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)backgroundOpacity {
self.layer->setBackgroundOpacity(backgroundOpacity.mbgl_floatPropertyValue);
[self update];
}
- (id <MGLStyleAttributeValue>)backgroundOpacity {
return [MGLStyleAttribute mbgl_numberPropertyValueWith:self.layer->getBackgroundOpacity()];
}
@end
|