<% 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 "MGLStyleValue.h" #import "MGL<%- (type === 'background' ? '' : (type === 'raster' ? 'Foreground' : 'Vector')) %>StyleLayer.h" NS_ASSUME_NONNULL_BEGIN <% for (const property of layoutProperties) { -%> <% if (property.type == "enum") { -%> /** <%- propertyDoc(property.name, property, type) %> Values of this type are used in the `<%- camelizeWithLeadingLowercase(property.name) %>` property of `MGL<%- camelize(type) %>StyleLayer`. */ typedef NS_ENUM(NSUInteger, MGL<%- camelize(property.name) %>) { <% for (const value in property.values) { -%> /** <%- propertyDoc(property.name, property.values[value], type) %> */ MGL<%- camelize(property.name) %><%- camelize(value) %>, <% } -%> }; <% } -%> <% } -%> <% for (const property of paintProperties) { -%> <% if (property.type == "enum") { -%> /** <%- propertyDoc(property.name, property, type) %> Values of this type are used in the `<%- camelizeWithLeadingLowercase(property.name) %>` property of `MGL<%- camelize(type) %>StyleLayer`. */ typedef NS_ENUM(NSUInteger, MGL<%- camelize(property.name) %>) { <% for (const value in property.values) { -%> /** <%- propertyDoc(property.name, property.values[value], type) %> */ MGL<%- camelize(property.name) %><%- camelize(value) %>, <% } -%> }; <% } -%> <% } -%> <% if (type == 'background') { -%> /** A map style's background layer is the bottommost layer and is used to style a color or pattern to show below all other map features. You can query an `MGLMapView` for its `style` and obtain the background layer using the `-[MGLStyle layerWithIdentifier:]` method and passing `background` for the identifier. */ <% } else { -%> /** A <%- type %> layer which allows customization of styling properties at runtime. You may instantiate a new <%- type %> layer to add to a map style or you may query an `MGLMapView` for its `style` and obtain existing layers using the `-[MGLStyle layerWithIdentifier:]` method. */ <% } -%> @interface MGL<%- camelize(type) %>StyleLayer : MGL<%- (type === 'background' ? '' : (type === 'raster' ? 'Foreground' : 'Vector')) %>StyleLayer <% if (type === 'background') { -%> - (instancetype)initWithIdentifier:(NSString *)identifier NS_DESIGNATED_INITIALIZER; <% } -%> <% if (layoutProperties.length) { -%> #pragma mark - Accessing the Layout Attributes <% for (const property of layoutProperties) { -%> /** <%- propertyDoc(property.name, 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) %> <% } -%> <% if (property.original) { -%> This attribute corresponds to the <%- property.original -%> layout property in the Mapbox Style Specification. <% } -%> */ @property (nonatomic<% if (!property.required) { %>, null_resettable<% } %>) MGLStyleValue<<%- propertyType(property, true) %>> *<%- camelizeWithLeadingLowercase(property.name) %>; <% } -%> <% } -%> <% if (paintProperties.length) { -%> #pragma mark - Accessing the Paint Attributes <% for (const property of paintProperties) { -%> /** <%- propertyDoc(property.name, 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) %> <% } -%> <% if (property.original) { -%> This attribute corresponds to the <%- property.original -%> paint property in the Mapbox Style Specification. <% } -%> */ @property (nonatomic<% if (!property.required) { %>, null_resettable<% } %>) MGLStyleValue<<%- propertyType(property, true) %>> *<%- camelizeWithLeadingLowercase(property.name) %>; <% } -%> <% } -%> @end NS_ASSUME_NONNULL_END