From ed30f1566da388234d28f514f4f0923f23d9fd9c Mon Sep 17 00:00:00 2001 From: Fabian Guerra Date: Tue, 13 Jun 2017 19:49:20 -0400 Subject: [PATCH] [ios, macos] Add the auto-generation script for MGLLight.mm --- .../darwin/scripts/generate-style-code.js | 19 +-- .../scripts/style-spec-overrides-v8.json | 1 + platform/darwin/src/MGLLight.h | 113 ++++++++++++++---- platform/darwin/src/MGLLight.h.ejs | 97 +++++---------- platform/darwin/src/MGLLight.mm | 35 +++--- platform/darwin/src/MGLLight.mm.ejs | 99 +++++++-------- 6 files changed, 192 insertions(+), 172 deletions(-) diff --git a/platform/darwin/scripts/generate-style-code.js b/platform/darwin/scripts/generate-style-code.js index dde41cc239c..38e1a4bfebc 100644 --- a/platform/darwin/scripts/generate-style-code.js +++ b/platform/darwin/scripts/generate-style-code.js @@ -220,7 +220,6 @@ global.testHelperMessage = function (property, layerType, isFunction) { }; global.propertyDoc = function (propertyName, property, layerType, kind) { - console.log(propertyName + " : " + property + " : " + layerType + " : " + kind) // Match references to other property names & values. // Requires the format 'When `foo` is set to `bar`,'. let doc = property.doc.replace(/`([^`]+?)` is set to `([^`]+?)`/g, function (m, peerPropertyName, propertyValue, offset, str) { @@ -257,7 +256,7 @@ global.propertyDoc = function (propertyName, property, layerType, kind) { if (kind !== 'enum') { if ('default' in property) { doc += `\n\nThe default value of this property is ${propertyDefault(property, layerType)}.`; - if (!property.required) { + if (!property.required && kind != 'light') { doc += ' Set this property to `nil` to reset it to the default value.'; } } @@ -419,6 +418,7 @@ global.propertyType = function (property) { return 'NSArray *'; case 'padding': return 'NSValue *'; + case 'position': case 'offset': case 'translate': return 'NSValue *'; @@ -458,6 +458,8 @@ global.valueTransformerArguments = function (property) { return ['std::vector', objCType, 'std::string']; case 'padding': return ['std::array', objCType]; + case 'position': + return ['mbgl::style::Position', objCType]; case 'offset': case 'translate': return ['std::array', objCType]; @@ -520,15 +522,15 @@ global.setSourceLayer = function() { return `_layer->setSourceLayer(sourceLayer.UTF8String);` }; -const lightProperties = Object.keys(spec[`light`]).reduce((memo, name) => { - var property = spec[`light`][name]; +const lightProperties = Object.keys(spec['light']).reduce((memo, name) => { + var property = spec['light'][name]; property.name = name; property['light-property'] = true; memo.push(property); return memo; }, []); -console.log(lightProperties); +const lightDoc = spec[`light-cocoa-doc`]; const layerH = ejs.compile(fs.readFileSync('platform/darwin/src/MGLStyleLayer.h.ejs', 'utf8'), { strict: true }); const layerM = ejs.compile(fs.readFileSync('platform/darwin/src/MGLStyleLayer.mm.ejs', 'utf8'), { strict: true}); @@ -539,9 +541,8 @@ const templatesMD = ejs.compile(fs.readFileSync('platform/darwin/docs/guides/Til const lightH = ejs.compile(fs.readFileSync('platform/darwin/src/MGLLight.h.ejs', 'utf8'), {strict: true});; const lightM = ejs.compile(fs.readFileSync('platform/darwin/src/MGLLight.mm.ejs', 'utf8'), {strict: true});; -fs.writeFileSync(`platform/darwin/src/MGLLight.h`, lightH({ properties: lightProperties, })); -fs.writeFileSync(`platform/darwin/src/MGLLight.mm`, lightM({ properties: lightProperties, })); - +fs.writeFileSync(`platform/darwin/src/MGLLight.h`, duplicatePlatformDecls(lightH({ properties: lightProperties, doc: lightDoc}))); +fs.writeFileSync(`platform/darwin/src/MGLLight.mm`, lightM({ properties: lightProperties, doc: lightDoc})); const layers = _(spec.layer.type.values).map((value, layerType) => { @@ -558,7 +559,7 @@ const layers = _(spec.layer.type.values).map((value, layerType) => { memo.push(spec[`paint_${layerType}`][name]); return memo; }, []); -console.log(spec.layer.type.values[layerType].doc) + return { doc: spec.layer.type.values[layerType].doc, type: layerType, diff --git a/platform/darwin/scripts/style-spec-overrides-v8.json b/platform/darwin/scripts/style-spec-overrides-v8.json index a594ef2957e..58d3870c267 100644 --- a/platform/darwin/scripts/style-spec-overrides-v8.json +++ b/platform/darwin/scripts/style-spec-overrides-v8.json @@ -1,4 +1,5 @@ { + "light-cocoa-doc": "An `MGLLight` object represents the light source for extruded geometries in `MGLStyle`.", "layer": { "type": { "values": { diff --git a/platform/darwin/src/MGLLight.h b/platform/darwin/src/MGLLight.h index 5991f365cf9..7dc9a7e2ca2 100644 --- a/platform/darwin/src/MGLLight.h +++ b/platform/darwin/src/MGLLight.h @@ -8,13 +8,19 @@ NS_ASSUME_NONNULL_BEGIN - -/** Options to specify extruded geometries are lit relative to the map or viewport. */ +/** + Whether extruded geometries are lit relative to the map or viewport. + */ typedef NS_ENUM(NSUInteger, MGLLightAnchor) { - /** The position of the light source is aligned to the rotation of the map. */ + /** + The position of the light source is aligned to the rotation of the map. + */ MGLLightAnchorMap, - /** The position of the light source is aligned to the rotation of the viewport. */ - MGLLightAnchorViewport + /** + The position of the light source is aligned to the rotation of the + viewport. + */ + MGLLightAnchorViewport, }; /** @@ -57,8 +63,17 @@ MGL_EXPORT @interface MGLLight : NSObject /** - `anchor` Whether extruded geometries are lit relative to the map or viewport. + Whether extruded geometries are lit relative to the map or viewport. + + The default value of this property is an `MGLStyleValue` object containing an + `NSValue` object containing `MGLAnchorViewport`. + You can set this property to an instance of: + + * `MGLConstantStyleValue` + * `MGLCameraStyleFunction` with an interpolation mode of + `MGLInterpolationModeInterval` + This property corresponds to the anchor light property in the Mapbox Style Specification. @@ -66,14 +81,25 @@ MGL_EXPORT @property (nonatomic) MGLStyleValue *anchor; /** - Values describing animated transitions to `anchor` property. - */ -@property (nonatomic) MGLTransition anchorTransition; - - -/** - Position of the light source relative to lit (extruded) geometries. + Position of the light source relative to lit (extruded) geometries, in [r + radial coordinate, a azimuthal angle, p polar angle] where r indicates the + distance from the center of the base of an object to its light, a indicates the + position of the light relative to 0° (0° when `light.anchor` is set to + `MGLLight.anchorViewport` corresponds to the top of the viewport, or 0° when + `light.anchor` is set to `MGLLight.anchorMap` corresponds to due north, and + degrees proceed clockwise), and p indicates the height of the light (from 0°, + directly above, to 180°, directly below). + + The default value of this property is an `MGLStyleValue` object containing the + array `1.15`, `210`, `30`. + + You can set this property to an instance of: + * `MGLConstantStyleValue` + * `MGLCameraStyleFunction` with an interpolation mode of: + * `MGLInterpolationModeExponential` + * `MGLInterpolationModeInterval` + This property corresponds to the position light property in the Mapbox Style Specification. @@ -81,48 +107,87 @@ MGL_EXPORT @property (nonatomic) MGLStyleValue *position; /** - Values describing animated transitions to `position` property. - */ -@property (nonatomic) MGLTransition positionTransiton; + The transition affecting any changes to this layer’s `position` property. + This property corresponds to the `position-transition` property in the style JSON file format. +*/ +@property (nonatomic) MGLTransition positionTransition; #if TARGET_OS_IPHONE /** Color tint for lighting extruded geometries. + The default value of this property is an `MGLStyleValue` object containing + `UIColor.whiteColor`. + + You can set this property to an instance of: + + * `MGLConstantStyleValue` + * `MGLCameraStyleFunction` with an interpolation mode of: + * `MGLInterpolationModeExponential` + * `MGLInterpolationModeInterval` + This property corresponds to the color light property in the Mapbox Style Specification. */ @property (nonatomic) MGLStyleValue *color; #else - /** Color tint for lighting extruded geometries. + + The default value of this property is an `MGLStyleValue` object containing + `NSColor.whiteColor`. + + You can set this property to an instance of: + + * `MGLConstantStyleValue` + * `MGLCameraStyleFunction` with an interpolation mode of: + * `MGLInterpolationModeExponential` + * `MGLInterpolationModeInterval` + + This property corresponds to the color + light property in the Mapbox Style Specification. */ @property (nonatomic) MGLStyleValue *color; #endif /** - Values describing animated transitions to `color` property. - */ -@property (nonatomic) MGLTransition colorTransiton; + The transition affecting any changes to this layer’s `color` property. + This property corresponds to the `color-transition` property in the style JSON file format. +*/ +@property (nonatomic) MGLTransition colorTransition; /** - Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast. + Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as + more extreme contrast. + + The default value of this property is an `MGLStyleValue` object containing an + `NSNumber` object containing the float `0.5`. + + You can set this property to an instance of: + * `MGLConstantStyleValue` + * `MGLCameraStyleFunction` with an interpolation mode of: + * `MGLInterpolationModeExponential` + * `MGLInterpolationModeInterval` + This property corresponds to the intensity light property in the Mapbox Style Specification. */ -@property(nonatomic) MGLStyleValue *intensity; +@property (nonatomic) MGLStyleValue *intensity; /** - Values describing animated transitions to `intensity` property. - */ + The transition affecting any changes to this layer’s `intensity` property. + + This property corresponds to the `intensity-transition` property in the style JSON file format. +*/ @property (nonatomic) MGLTransition intensityTransition; + @end NS_ASSUME_NONNULL_END diff --git a/platform/darwin/src/MGLLight.h.ejs b/platform/darwin/src/MGLLight.h.ejs index e1bfc29fe1d..26ecefc3af6 100644 --- a/platform/darwin/src/MGLLight.h.ejs +++ b/platform/darwin/src/MGLLight.h.ejs @@ -13,14 +13,21 @@ NS_ASSUME_NONNULL_BEGIN - -/** Options to specify extruded geometries are lit relative to the map or viewport. */ -typedef NS_ENUM(NSUInteger, MGLLightAnchor) { - /** The position of the light source is aligned to the rotation of the map. */ - MGLLightAnchorMap, - /** The position of the light source is aligned to the rotation of the viewport. */ - MGLLightAnchorViewport +<% for (const property of properties) { -%> +<% if (property.type == "enum") { -%> +/** +<%- propertyDoc(property.name, property, type, 'enum').wrap(80, 1) %> + */ +typedef NS_ENUM(NSUInteger, MGLLight<%- camelize(property.name) %>) { +<% for (const value in property.values) { -%> + /** +<%- propertyDoc(property.name, property.values[value], type, 'enum').wrap(80, 4+1) %> + */ + MGLLightAnchor<%- camelize(value) %>, +<% } -%> }; +<% } -%> +<% } -%> /** A structure containing information about the position of the light source @@ -46,7 +53,7 @@ typedef struct MGLSphericalPosition { @return Returns a `MGLSphericalPosition` struct containing the position attributes. */ -NS_INLINE MGLSphericalPosition MGLSphericalPositionMake(CLLocationDistance radial, CLLocationDirection azimuthal, CLLocationDirection polar) { +NS_INLINE MGLSphericalPosition MGLSphericalPositionMake(CGFloat radial, CLLocationDirection azimuthal, CLLocationDirection polar) { MGLSphericalPosition position; position.radial = radial; position.azimuthal = azimuthal; @@ -56,77 +63,37 @@ NS_INLINE MGLSphericalPosition MGLSphericalPositionMake(CLLocationDistance radia } /** - An `MGLLight` object represents the light source for extruded geometries in `MGLStyle`. + <%- doc %> */ MGL_EXPORT @interface MGLLight : NSObject +<% if (properties.length) { -%> +<% for (const property of properties) { -%> /** - `anchor` Whether extruded geometries are lit relative to the map or viewport. - - This property corresponds to the anchor - light property in the Mapbox Style Specification. - */ -@property (nonatomic) MGLStyleValue *anchor; - -/** - Values describing animated transitions to `anchor` property. - */ -@property (nonatomic) MGLTransition anchorTransition; - - -/** - Position of the light source relative to lit (extruded) geometries. - - This property corresponds to the position - light property in the Mapbox Style Specification. - */ -@property (nonatomic) MGLStyleValue *position; - -/** - Values describing animated transitions to `position` property. - */ -@property (nonatomic) MGLTransition positionTransiton; +<%- propertyDoc(property.name, property, type, 'light').wrap(80, 1) %> - -#if TARGET_OS_IPHONE -/** - Color tint for lighting extruded geometries. - This property corresponds to the color + href="https://www.mapbox.com/mapbox-gl-js/style-spec/#light-<%- originalPropertyName(property) %>"><%- originalPropertyName(property) %> light property in the Mapbox Style Specification. */ -@property (nonatomic) MGLStyleValue *color; -#else +@property (nonatomic<% if (property.getter) { %>, getter=<%- objCGetter(property) -%><% } %>) MGLStyleValue<<%- propertyType(property, true) %>> *<%- camelizeWithLeadingLowercase(property.name) %>; +<% if (property.transition) { -%> /** - Color tint for lighting extruded geometries. - */ -@property (nonatomic) MGLStyleValue *color; -#endif + The transition affecting any changes to this layer’s `<%- camelizeWithLeadingLowercase(property.name) %>` property. -/** - Values describing animated transitions to `color` property. - */ -@property (nonatomic) MGLTransition colorTransiton; + This property corresponds to the `<%- originalPropertyName(property) %>-transition` property in the style JSON file format. +*/ +@property (nonatomic) MGLTransition <%- camelizeWithLeadingLowercase(property.name) %>Transition; +<% } -%> +<% if (property.original) { -%> +@property (nonatomic<% if (!property.required) { %>, null_resettable<% } %>) MGLStyleValue<<%- propertyType(property, true) %>> *<%- camelizeWithLeadingLowercase(originalPropertyName(property)) %> __attribute__((unavailable("Use <%- camelizeWithLeadingLowercase(property.name) %> instead."))); -/** - Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast. - - This property corresponds to the intensity - light property in the Mapbox Style Specification. - */ -@property(nonatomic) MGLStyleValue *intensity; - -/** - Values describing animated transitions to `intensity` property. - */ -@property (nonatomic) MGLTransition intensityTransition; +<% } -%> +<% } -%> +<% } -%> @end diff --git a/platform/darwin/src/MGLLight.mm b/platform/darwin/src/MGLLight.mm index 92eb78b9745..c83ef127a6c 100644 --- a/platform/darwin/src/MGLLight.mm +++ b/platform/darwin/src/MGLLight.mm @@ -51,11 +51,9 @@ - (instancetype)initWithMBGLLight:(const mbgl::style::Light *)mbglLight } else { anchorStyleValue = MGLStyleValueTransformer().toEnumStyleValue(anchor); } - + _anchor = anchorStyleValue; - - _anchorTransition = MGLTransitionFromOptions(mbglLight->getAnchorTransition()); - + auto positionValue = mbglLight->getPosition(); if (positionValue.isUndefined()) { _position = MGLStyleValueTransformer().toStyleValue(mbglLight->getDefaultPosition()); @@ -63,8 +61,8 @@ - (instancetype)initWithMBGLLight:(const mbgl::style::Light *)mbglLight _position = MGLStyleValueTransformer().toStyleValue(positionValue); } - _positionTransiton = MGLTransitionFromOptions(mbglLight->getPositionTransition()); - + _positionTransition = MGLTransitionFromOptions(mbglLight->getPositionTransition()); + auto colorValue = mbglLight->getColor(); if (colorValue.isUndefined()) { _color = MGLStyleValueTransformer().toStyleValue(mbglLight->getDefaultColor()); @@ -72,8 +70,8 @@ - (instancetype)initWithMBGLLight:(const mbgl::style::Light *)mbglLight _color = MGLStyleValueTransformer().toStyleValue(colorValue); } - _colorTransiton = MGLTransitionFromOptions(mbglLight->getColorTransition()); - + _colorTransition = MGLTransitionFromOptions(mbglLight->getColorTransition()); + auto intensityValue = mbglLight->getIntensity(); if (intensityValue.isUndefined()) { _intensity = MGLStyleValueTransformer().toStyleValue(mbglLight->getDefaultIntensity()); @@ -82,6 +80,7 @@ - (instancetype)initWithMBGLLight:(const mbgl::style::Light *)mbglLight } _intensityTransition = MGLTransitionFromOptions(mbglLight->getIntensityTransition()); + } return self; @@ -90,26 +89,24 @@ - (instancetype)initWithMBGLLight:(const mbgl::style::Light *)mbglLight - (mbgl::style::Light)mbglLight { mbgl::style::Light mbglLight; - auto anchor = MGLStyleValueTransformer().toEnumPropertyValue(self.anchor); mbglLight.setAnchor(anchor); - - mbglLight.setAnchorTransition(MGLOptionsFromTransition(self.anchorTransition)); - + auto position = MGLStyleValueTransformer().toInterpolatablePropertyValue(self.position); mbglLight.setPosition(position); - - mbglLight.setPositionTransition(MGLOptionsFromTransition(self.positionTransiton)); - + + mbglLight.setPositionTransition(MGLOptionsFromTransition(self.positionTransition)); + auto color = MGLStyleValueTransformer().toInterpolatablePropertyValue(self.color); mbglLight.setColor(color); - - mbglLight.setColorTransition(MGLOptionsFromTransition(self.colorTransiton)); - + + mbglLight.setColorTransition(MGLOptionsFromTransition(self.colorTransition)); + auto intensity = MGLStyleValueTransformer().toInterpolatablePropertyValue(self.intensity); mbglLight.setIntensity(intensity); - + mbglLight.setIntensityTransition(MGLOptionsFromTransition(self.intensityTransition)); + return mbglLight; } diff --git a/platform/darwin/src/MGLLight.mm.ejs b/platform/darwin/src/MGLLight.mm.ejs index d9469564840..0d0da124c8e 100644 --- a/platform/darwin/src/MGLLight.mm.ejs +++ b/platform/darwin/src/MGLLight.mm.ejs @@ -51,45 +51,37 @@ NS_INLINE mbgl::style::TransitionOptions MGLOptionsFromTransition(MGLTransition - (instancetype)initWithMBGLLight:(const mbgl::style::Light *)mbglLight { if (self = [super init]) { - auto anchor = mbglLight->getAnchor(); - MGLStyleValue *anchorStyleValue; - if (anchor.isUndefined()) { - mbgl::style::PropertyValue defaultAnchor = mbglLight->getDefaultAnchor(); - anchorStyleValue = MGLStyleValueTransformer().toEnumStyleValue(defaultAnchor); - } else { - anchorStyleValue = MGLStyleValueTransformer().toEnumStyleValue(anchor); - } - - _anchor = anchorStyleValue; - - _anchorTransition = MGLTransitionFromOptions(mbglLight->getAnchorTransition()); - - auto positionValue = mbglLight->getPosition(); - if (positionValue.isUndefined()) { - _position = MGLStyleValueTransformer().toStyleValue(mbglLight->getDefaultPosition()); - } else { - _position = MGLStyleValueTransformer().toStyleValue(positionValue); - } - - _positionTransiton = MGLTransitionFromOptions(mbglLight->getPositionTransition()); - - auto colorValue = mbglLight->getColor(); - if (colorValue.isUndefined()) { - _color = MGLStyleValueTransformer().toStyleValue(mbglLight->getDefaultColor()); +<% if (properties.length) { -%> +<% for (const property of properties) { -%> +<% if (property.type == "enum") { -%> + auto <%- camelizeWithLeadingLowercase(property.name) -%> = mbglLight->get<%- camelize(property.name) -%>(); + MGLStyleValue *<%- camelizeWithLeadingLowercase(property.name) -%>StyleValue; + if (<%- camelizeWithLeadingLowercase(property.name) -%>.isUndefined()) { + mbgl::style::PropertyValueType> default<%- camelize(property.name) -%> = mbglLight->getDefault<%- camelize(property.name) -%>(); + <%- camelizeWithLeadingLowercase(property.name) -%>StyleValue = MGLStyleValueTransformerType, MGLLight<%- camelize(property.name) -%>>().toEnumStyleValue(default<%- camelize(property.name) -%>); } else { - _color = MGLStyleValueTransformer().toStyleValue(colorValue); + <%- camelizeWithLeadingLowercase(property.name) -%>StyleValue = MGLStyleValueTransformerType, NSValue *, mbgl::style::Light<%- camelize(property.name) -%>Type, MGLLight<%- camelize(property.name) -%>>().toEnumStyleValue(<%- camelizeWithLeadingLowercase(property.name) -%>); } - - _colorTransiton = MGLTransitionFromOptions(mbglLight->getColorTransition()); - - auto intensityValue = mbglLight->getIntensity(); - if (intensityValue.isUndefined()) { - _intensity = MGLStyleValueTransformer().toStyleValue(mbglLight->getDefaultIntensity()); + + _<%- camelizeWithLeadingLowercase(property.name) -%> = <%- camelizeWithLeadingLowercase(property.name) -%>StyleValue; + +<% if (property.transition) { -%> + _<%- camelizeWithLeadingLowercase(property.name) -%>Transition = MGLTransitionFromOptions(mbglLight->get<%- camelize(property.name) -%>Transition()); + +<% } -%> +<% } else {-%> + auto <%- camelizeWithLeadingLowercase(property.name) -%>Value = mbglLight->get<%- camelize(property.name) -%>(); + if (<%- camelizeWithLeadingLowercase(property.name) -%>Value.isUndefined()) { + _<%- camelizeWithLeadingLowercase(property.name) -%> = MGLStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toStyleValue(mbglLight->getDefault<%- camelize(property.name) -%>()); } else { - _intensity = MGLStyleValueTransformer().toStyleValue(intensityValue); + _<%- camelizeWithLeadingLowercase(property.name) -%> = MGLStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toStyleValue(<%- camelizeWithLeadingLowercase(property.name) -%>Value); } - - _intensityTransition = MGLTransitionFromOptions(mbglLight->getIntensityTransition()); +<% if (property.transition) { -%> + _<%- camelizeWithLeadingLowercase(property.name) -%>Transition = MGLTransitionFromOptions(mbglLight->get<%- camelize(property.name) -%>Transition()); +<% } -%> +<% } -%> +<% } -%> +<% } -%> } return self; @@ -98,26 +90,23 @@ NS_INLINE mbgl::style::TransitionOptions MGLOptionsFromTransition(MGLTransition - (mbgl::style::Light)mbglLight { mbgl::style::Light mbglLight; - - auto anchor = MGLStyleValueTransformer().toEnumPropertyValue(self.anchor); - mbglLight.setAnchor(anchor); - - mbglLight.setAnchorTransition(MGLOptionsFromTransition(self.anchorTransition)); - - auto position = MGLStyleValueTransformer().toInterpolatablePropertyValue(self.position); - mbglLight.setPosition(position); - - mbglLight.setPositionTransition(MGLOptionsFromTransition(self.positionTransiton)); - - auto color = MGLStyleValueTransformer().toInterpolatablePropertyValue(self.color); - mbglLight.setColor(color); - - mbglLight.setColorTransition(MGLOptionsFromTransition(self.colorTransiton)); - - auto intensity = MGLStyleValueTransformer().toInterpolatablePropertyValue(self.intensity); - mbglLight.setIntensity(intensity); - - mbglLight.setIntensityTransition(MGLOptionsFromTransition(self.intensityTransition)); +<% if (properties.length) { -%> +<% for (const property of properties) { -%> +<% if (property.type == "enum") { -%> + auto <%- camelizeWithLeadingLowercase(property.name) -%> = MGLStyleValueTransformerType, NSValue *, mbgl::style::Light<%- camelize(property.name) -%>Type, MGLLight<%- camelize(property.name) -%>>().toEnumPropertyValue(self.<%- camelizeWithLeadingLowercase(property.name) -%>); + mbglLight.set<%- camelize(property.name) -%>(<%- camelizeWithLeadingLowercase(property.name) -%>); + +<% } else {-%> + auto <%- camelizeWithLeadingLowercase(property.name) -%> = MGLStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toInterpolatablePropertyValue(self.<%- camelizeWithLeadingLowercase(property.name) -%>); + mbglLight.set<%- camelize(property.name) -%>(<%- camelizeWithLeadingLowercase(property.name) -%>); + +<% } -%> +<% if (property.transition) { -%> + mbglLight.set<%- camelize(property.name) -%>Transition(MGLOptionsFromTransition(self.<%- camelizeWithLeadingLowercase(property.name) -%>Transition)); + +<% } -%> +<% } -%> +<% } -%> return mbglLight; }