summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLStyleLayer.mm.ejs
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2016-09-25 12:37:45 -0700
committerMinh Nguyễn <mxn@1ec5.org>2016-10-17 11:47:22 -0700
commit9652028915af6602626939e0b0075333c34bfbfe (patch)
tree0b299507c1339dcb1f947a496dcd375095f9bc4b /platform/darwin/src/MGLStyleLayer.mm.ejs
parent0c8a3feffa94a9594bcaa77fdc18d11a3c482ff5 (diff)
downloadqtlocation-mapboxgl-9652028915af6602626939e0b0075333c34bfbfe.tar.gz
[ios, macos] Expand changes to entire API
Diffstat (limited to 'platform/darwin/src/MGLStyleLayer.mm.ejs')
-rw-r--r--platform/darwin/src/MGLStyleLayer.mm.ejs22
1 files changed, 13 insertions, 9 deletions
diff --git a/platform/darwin/src/MGLStyleLayer.mm.ejs b/platform/darwin/src/MGLStyleLayer.mm.ejs
index 8d3bba9958..3678e9ec52 100644
--- a/platform/darwin/src/MGLStyleLayer.mm.ejs
+++ b/platform/darwin/src/MGLStyleLayer.mm.ejs
@@ -9,7 +9,7 @@
#import "MGLSource.h"
#import "NSPredicate+MGLAdditions.h"
#import "MGLStyleLayer_Private.h"
-#import "MGLStyleAttributeValue.h"
+#import "MGLStyleValue_Private.h"
#import "MGL<%- camelize(type) %>StyleLayer.h"
#include <mbgl/style/layers/<%- type %>_layer.hpp>
@@ -67,12 +67,14 @@
#pragma mark - Accessing the Layout Attributes
<% for (const property of layoutProperties) { -%>
-- (void)set<%- camelize(property.name) %>:(<%- propertyType(property, true, type) %>)<%- objCName(property) %> {
- <%- setterImplementation(property, type) %>
+- (void)set<%- camelize(property.name) %>:(MGLStyleValue<<%- propertyType(property, true) %>> *)<%- objCName(property) %> {
+ auto mbglValue = MGLStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toPropertyValue(<%- objCName(property) %>);
+ self.layer->set<%- camelize(property.name) %>(mbglValue);
}
-- (<%- propertyType(property, false, type) %>)<%- objCName(property) %> {
- <%- getterImplementation(property, type) %>
+- (MGLStyleValue<<%- propertyType(property, true) %>> *)<%- objCName(property) %> {
+ auto propertyValue = self.layer->get<%- camelize(property.name) %>() ?: self.layer->getDefault<%- camelize(property.name) %>();
+ return MGLStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toStyleValue(propertyValue);
}
<% } -%>
@@ -81,12 +83,14 @@
#pragma mark - Accessing the Paint Attributes
<% for (const property of paintProperties) { -%>
-- (void)set<%- camelize(property.name) %>:(<%- propertyType(property, true, type) %>)<%- objCName(property) %> {
- <%- setterImplementation(property, type) %>
+- (void)set<%- camelize(property.name) %>:(MGLStyleValue<<%- propertyType(property, true) %>> *)<%- objCName(property) %> {
+ auto mbglValue = MGLStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toPropertyValue(<%- objCName(property) %>);
+ self.layer->set<%- camelize(property.name) %>(mbglValue);
}
-- (<%- propertyType(property, false, type) %>)<%- objCName(property) %> {
- <%- getterImplementation(property, type) %>
+- (MGLStyleValue<<%- propertyType(property, true) %>> *)<%- objCName(property) %> {
+ auto propertyValue = self.layer->get<%- camelize(property.name) %>() ?: self.layer->getDefault<%- camelize(property.name) %>();
+ return MGLStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toStyleValue(propertyValue);
}
<% } -%>