@@ -39,38 +39,50 @@ - (instancetype)initWithIdentifier:(NSString *)identifier source:(MGLSource *)so
39
39
if (self = [super initWithIdentifier: identifier source: source]) {
40
40
auto layer = std::make_unique<mbgl::style::CircleLayer>(identifier.UTF8String , source.identifier .UTF8String );
41
41
_pendingLayer = std::move (layer);
42
- _rawLayer = _pendingLayer.get ();
42
+ self. rawLayer = _pendingLayer.get ();
43
43
}
44
44
return self;
45
45
}
46
+
47
+ - (mbgl::style::CircleLayer *)rawLayer
48
+ {
49
+ return (mbgl::style::CircleLayer *)super.rawLayer ;
50
+ }
51
+
52
+ - (void )setRawLayer : (mbgl::style::CircleLayer *)rawLayer
53
+ {
54
+ super.rawLayer = rawLayer;
55
+ }
56
+
46
57
- (NSString *)sourceLayerIdentifier
47
58
{
48
59
MGLAssertStyleLayerIsValid ();
49
60
50
- auto layerID = _rawLayer ->getSourceLayer ();
61
+ auto layerID = self. rawLayer ->getSourceLayer ();
51
62
return layerID.empty () ? nil : @(layerID.c_str ());
52
63
}
53
64
54
65
- (void )setSourceLayerIdentifier : (NSString *)sourceLayerIdentifier
55
66
{
56
67
MGLAssertStyleLayerIsValid ();
57
68
58
- _rawLayer ->setSourceLayer (sourceLayerIdentifier.UTF8String ?: " " );
69
+ self. rawLayer ->setSourceLayer (sourceLayerIdentifier.UTF8String ?: " " );
59
70
}
60
71
61
72
- (void )setPredicate : (NSPredicate *)predicate
62
73
{
63
74
MGLAssertStyleLayerIsValid ();
64
75
65
- _rawLayer ->setFilter (predicate.mgl_filter );
76
+ self. rawLayer ->setFilter (predicate.mgl_filter );
66
77
}
67
78
68
79
- (NSPredicate *)predicate
69
80
{
70
81
MGLAssertStyleLayerIsValid ();
71
82
72
- return [NSPredicate mgl_predicateWithFilter: _rawLayer ->getFilter ()];
83
+ return [NSPredicate mgl_predicateWithFilter: self .rawLayer ->getFilter ()];
73
84
}
85
+
74
86
#pragma mark - Adding to and removing from a map view
75
87
76
88
- (void )addToMapView : (MGLMapView *)mapView belowLayer : (MGLStyleLayer *)otherLayer
@@ -92,7 +104,7 @@ - (void)addToMapView:(MGLMapView *)mapView belowLayer:(MGLStyleLayer *)otherLaye
92
104
- (void )removeFromMapView : (MGLMapView *)mapView
93
105
{
94
106
_pendingLayer = nullptr ;
95
- _rawLayer = nullptr ;
107
+ self. rawLayer = nullptr ;
96
108
97
109
auto removedLayer = mapView.mbglMap ->removeLayer (self.identifier .UTF8String );
98
110
if (!removedLayer) {
@@ -107,7 +119,7 @@ - (void)removeFromMapView:(MGLMapView *)mapView
107
119
removedLayer.release ();
108
120
109
121
_pendingLayer = std::unique_ptr<mbgl::style::CircleLayer>(layer);
110
- _rawLayer = _pendingLayer.get ();
122
+ self. rawLayer = _pendingLayer.get ();
111
123
}
112
124
113
125
#pragma mark - Accessing the Paint Attributes
@@ -116,97 +128,97 @@ - (void)setCircleBlur:(MGLStyleValue<NSNumber *> *)circleBlur {
116
128
MGLAssertStyleLayerIsValid ();
117
129
118
130
auto mbglValue = MGLStyleValueTransformer<float , NSNumber *>().toPropertyValue (circleBlur);
119
- _rawLayer ->setCircleBlur (mbglValue);
131
+ self. rawLayer ->setCircleBlur (mbglValue);
120
132
}
121
133
122
134
- (MGLStyleValue<NSNumber *> *)circleBlur {
123
135
MGLAssertStyleLayerIsValid ();
124
136
125
- auto propertyValue = _rawLayer ->getCircleBlur () ?: _rawLayer ->getDefaultCircleBlur ();
137
+ auto propertyValue = self. rawLayer ->getCircleBlur () ?: self. rawLayer ->getDefaultCircleBlur ();
126
138
return MGLStyleValueTransformer<float , NSNumber *>().toStyleValue (propertyValue);
127
139
}
128
140
129
141
- (void )setCircleColor : (MGLStyleValue<MGLColor *> *)circleColor {
130
142
MGLAssertStyleLayerIsValid ();
131
143
132
144
auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue (circleColor);
133
- _rawLayer ->setCircleColor (mbglValue);
145
+ self. rawLayer ->setCircleColor (mbglValue);
134
146
}
135
147
136
148
- (MGLStyleValue<MGLColor *> *)circleColor {
137
149
MGLAssertStyleLayerIsValid ();
138
150
139
- auto propertyValue = _rawLayer ->getCircleColor () ?: _rawLayer ->getDefaultCircleColor ();
151
+ auto propertyValue = self. rawLayer ->getCircleColor () ?: self. rawLayer ->getDefaultCircleColor ();
140
152
return MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toStyleValue (propertyValue);
141
153
}
142
154
143
155
- (void )setCircleOpacity : (MGLStyleValue<NSNumber *> *)circleOpacity {
144
156
MGLAssertStyleLayerIsValid ();
145
157
146
158
auto mbglValue = MGLStyleValueTransformer<float , NSNumber *>().toPropertyValue (circleOpacity);
147
- _rawLayer ->setCircleOpacity (mbglValue);
159
+ self. rawLayer ->setCircleOpacity (mbglValue);
148
160
}
149
161
150
162
- (MGLStyleValue<NSNumber *> *)circleOpacity {
151
163
MGLAssertStyleLayerIsValid ();
152
164
153
- auto propertyValue = _rawLayer ->getCircleOpacity () ?: _rawLayer ->getDefaultCircleOpacity ();
165
+ auto propertyValue = self. rawLayer ->getCircleOpacity () ?: self. rawLayer ->getDefaultCircleOpacity ();
154
166
return MGLStyleValueTransformer<float , NSNumber *>().toStyleValue (propertyValue);
155
167
}
156
168
157
169
- (void )setCirclePitchScale : (MGLStyleValue<NSValue *> *)circlePitchScale {
158
170
MGLAssertStyleLayerIsValid ();
159
171
160
172
auto mbglValue = MGLStyleValueTransformer<mbgl::style::CirclePitchScaleType, NSValue *, mbgl::style::CirclePitchScaleType, MGLCirclePitchScale>().toEnumPropertyValue (circlePitchScale);
161
- _rawLayer ->setCirclePitchScale (mbglValue);
173
+ self. rawLayer ->setCirclePitchScale (mbglValue);
162
174
}
163
175
164
176
- (MGLStyleValue<NSValue *> *)circlePitchScale {
165
177
MGLAssertStyleLayerIsValid ();
166
178
167
- auto propertyValue = _rawLayer ->getCirclePitchScale () ?: _rawLayer ->getDefaultCirclePitchScale ();
179
+ auto propertyValue = self. rawLayer ->getCirclePitchScale () ?: self. rawLayer ->getDefaultCirclePitchScale ();
168
180
return MGLStyleValueTransformer<mbgl::style::CirclePitchScaleType, NSValue *, mbgl::style::CirclePitchScaleType, MGLCirclePitchScale>().toEnumStyleValue (propertyValue);
169
181
}
170
182
171
183
- (void )setCircleRadius : (MGLStyleValue<NSNumber *> *)circleRadius {
172
184
MGLAssertStyleLayerIsValid ();
173
185
174
186
auto mbglValue = MGLStyleValueTransformer<float , NSNumber *>().toPropertyValue (circleRadius);
175
- _rawLayer ->setCircleRadius (mbglValue);
187
+ self. rawLayer ->setCircleRadius (mbglValue);
176
188
}
177
189
178
190
- (MGLStyleValue<NSNumber *> *)circleRadius {
179
191
MGLAssertStyleLayerIsValid ();
180
192
181
- auto propertyValue = _rawLayer ->getCircleRadius () ?: _rawLayer ->getDefaultCircleRadius ();
193
+ auto propertyValue = self. rawLayer ->getCircleRadius () ?: self. rawLayer ->getDefaultCircleRadius ();
182
194
return MGLStyleValueTransformer<float , NSNumber *>().toStyleValue (propertyValue);
183
195
}
184
196
185
197
- (void )setCircleTranslate : (MGLStyleValue<NSValue *> *)circleTranslate {
186
198
MGLAssertStyleLayerIsValid ();
187
199
188
200
auto mbglValue = MGLStyleValueTransformer<std::array<float , 2 >, NSValue *>().toPropertyValue (circleTranslate);
189
- _rawLayer ->setCircleTranslate (mbglValue);
201
+ self. rawLayer ->setCircleTranslate (mbglValue);
190
202
}
191
203
192
204
- (MGLStyleValue<NSValue *> *)circleTranslate {
193
205
MGLAssertStyleLayerIsValid ();
194
206
195
- auto propertyValue = _rawLayer ->getCircleTranslate () ?: _rawLayer ->getDefaultCircleTranslate ();
207
+ auto propertyValue = self. rawLayer ->getCircleTranslate () ?: self. rawLayer ->getDefaultCircleTranslate ();
196
208
return MGLStyleValueTransformer<std::array<float , 2 >, NSValue *>().toStyleValue (propertyValue);
197
209
}
198
210
199
211
- (void )setCircleTranslateAnchor : (MGLStyleValue<NSValue *> *)circleTranslateAnchor {
200
212
MGLAssertStyleLayerIsValid ();
201
213
202
214
auto mbglValue = MGLStyleValueTransformer<mbgl::style::TranslateAnchorType, NSValue *, mbgl::style::TranslateAnchorType, MGLCircleTranslateAnchor>().toEnumPropertyValue (circleTranslateAnchor);
203
- _rawLayer ->setCircleTranslateAnchor (mbglValue);
215
+ self. rawLayer ->setCircleTranslateAnchor (mbglValue);
204
216
}
205
217
206
218
- (MGLStyleValue<NSValue *> *)circleTranslateAnchor {
207
219
MGLAssertStyleLayerIsValid ();
208
220
209
- auto propertyValue = _rawLayer ->getCircleTranslateAnchor () ?: _rawLayer ->getDefaultCircleTranslateAnchor ();
221
+ auto propertyValue = self. rawLayer ->getCircleTranslateAnchor () ?: self. rawLayer ->getDefaultCircleTranslateAnchor ();
210
222
return MGLStyleValueTransformer<mbgl::style::TranslateAnchorType, NSValue *, mbgl::style::TranslateAnchorType, MGLCircleTranslateAnchor>().toEnumStyleValue (propertyValue);
211
223
}
212
224
0 commit comments