<% const type = locals.type; const layoutProperties = locals.layoutProperties; const paintProperties = locals.paintProperties; const layoutPropertiesByName = locals.layoutPropertiesByName; const paintPropertiesByName = locals.paintPropertiesByName; -%> // This file is generated. // Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`. #import "MGLStyleAttributeValue.h" #import "MGLBaseStyleLayer.h" NS_ASSUME_NONNULL_BEGIN <% for (const property of layoutProperties) { -%> <% if (property.type == "enum") { -%> typedef NS_ENUM(NSUInteger, MGL<%- camelize(type) %>StyleLayer<%- camelize(property.name) %>) { <% for (const value of property.values) { -%> MGL<%- camelize(type) %>StyleLayer<%- camelize(property.name) %><%- camelize(value) %>, <% } -%> }; <% } -%> <% } -%> <% for (const property of paintProperties) { -%> <% if (property.type == "enum") { -%> typedef NS_ENUM(NSUInteger, MGL<%- camelize(type) %>StyleLayer<%- camelize(property.name) %>) { <% for (const value of property.values) { -%> MGL<%- camelize(type) %>StyleLayer<%- camelize(property.name) %><%- camelize(value) %>, <% } -%> }; <% } -%> <% } -%> @interface MGL<%- camelize(type) %>StyleLayer : MGLBaseStyleLayer <% if (type == 'background') { -%> - (instancetype)initWithLayerIdentifier:(NSString *)layerIdentifier; <% } -%> - (instancetype)initWithLayerIdentifier:(NSString *)layerIdentifier source:(MGLSource *)source; <% if (type !== 'background' && type !== 'raster') { -%> - (instancetype)initWithLayerIdentifier:(NSString *)layerIdentifier source:(MGLSource *)source sourceLayer:(NSString *)sourceLayer; <% } -%> <% if (type !== 'background' && type !== 'raster') { -%> /** A predicate that corresponds to the layer's filter. The predicate's left expression must be a string that identifies a feature property, or one of the special keys. */ @property (nonatomic, nullable) NSPredicate *predicate; <% } -%> <% if (layoutProperties.length) { -%> #pragma mark - Accessing the Layout Attributes <% for (const property of layoutProperties) { -%> /** <%- propertyDoc(property, type) %> <% if ('default' in property) { -%> The default value of this property is <%- propertyDefault(property, type) %>.<% if (!property.required) { %> Set this property to `nil` to reset it to the default value.<% } %> <% } if (property.requires) { -%> <%- propertyReqs(property, layoutPropertiesByName, type) %> <% } -%> */ @property (nonatomic<% if (!property.required) { %>, null_resettable<% } %>) <%- propertyType(property, false, type) %> <%- camelizeWithLeadingLowercase(property.name) %>; <% } -%> <% } -%> <% if (paintProperties.length) { -%> #pragma mark - Accessing the Paint Attributes <% for (const property of paintProperties) { -%> /** <%- propertyDoc(property, type) %> <% if ('default' in property) { -%> The default value of this property is <%- propertyDefault(property, type) %>.<% if (!property.required) { %> Set this property to `nil` to reset it to the default value.<% } %> <% } if (property.requires) { -%> <%- propertyReqs(property, paintPropertiesByName, type) %> <% } -%> */ @property (nonatomic<% if (!property.required) { %>, null_resettable<% } %>) <%- propertyType(property, false, type) %> <%- camelizeWithLeadingLowercase(property.name) %>; <% } -%> <% } -%> @end NS_ASSUME_NONNULL_END