summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLLineStyleLayer.h
blob: 6dda999047a41c30616089dcda4bf4ca3158f6ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
// 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

typedef NS_ENUM(NSUInteger, MGLLineStyleLayerLineCap) {
    MGLLineStyleLayerLineCapButt,
    MGLLineStyleLayerLineCapRound,
    MGLLineStyleLayerLineCapSquare,
};

typedef NS_ENUM(NSUInteger, MGLLineStyleLayerLineJoin) {
    MGLLineStyleLayerLineJoinBevel,
    MGLLineStyleLayerLineJoinRound,
    MGLLineStyleLayerLineJoinMiter,
};

typedef NS_ENUM(NSUInteger, MGLLineStyleLayerLineTranslateAnchor) {
    MGLLineStyleLayerLineTranslateAnchorMap,
    MGLLineStyleLayerLineTranslateAnchorViewport,
};

@interface MGLLineStyleLayer : MGLBaseStyleLayer <MGLStyleLayer>

#pragma mark - Accessing the Layout Attributes

/**
 The display of line endings.
 
 If this property is set to `nil`, the layer uses an implicit default value of `MGLLineStyleLayerLineCapButt`.
 */
@property (nonatomic, nullable) id <MGLStyleAttributeValue> lineCap;

/**
 The display of lines when joining.
 
 If this property is set to `nil`, the layer uses an implicit default value of `MGLLineStyleLayerLineJoinMiter`.
 */
@property (nonatomic, nullable) id <MGLStyleAttributeValue> lineJoin;

/**
 Used to automatically convert miter joins to bevel joins for sharp angles.
 
 If this property is set to `nil`, the layer uses an implicit default value of `2`.
 
 This property is only applied to the style if `lineJoin` is set to `MGLLineStyleLayerLineJoinMiter`. Otherwise, it is ignored.
 */
@property (nonatomic, nullable) id <MGLStyleAttributeValue> lineMiterLimit;

/**
 Used to automatically convert round joins to miter joins for shallow angles.
 
 If this property is set to `nil`, the layer uses an implicit default value of `1.05`.
 
 This property is only applied to the style if `lineJoin` is set to `MGLLineStyleLayerLineJoinRound`. Otherwise, it is ignored.
 */
@property (nonatomic, nullable) id <MGLStyleAttributeValue> lineRoundLimit;

#pragma mark - Accessing the Paint Attributes

/**
 The opacity at which the line will be drawn.
 
 If this property is set to `nil`, the layer uses an implicit default value of `1`.
 */
@property (nonatomic, nullable) id <MGLStyleAttributeValue> lineOpacity;

/**
 The color with which the line will be drawn.
 
 If this property is set to `nil`, the layer uses an implicit default value of an `NSColor` or `UIColor`object whose RGB value is 0, 0, 0 and whose alpha value is 1.

 This property is only applied to the style if `linePattern` is set to `nil`. Otherwise, it is ignored.
 */
@property (nonatomic, nullable) id <MGLStyleAttributeValue> lineColor;

/**
 The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.

 This property is measured in points.
 
 If this property is set to `nil`, the layer uses an implicit default value of 0 points from the left and 0 points from the top.
 */
@property (nonatomic, nullable) id <MGLStyleAttributeValue> lineTranslate;

/**
 Control whether the translation is relative to the map (north) or viewport (screen)
 
 If this property is set to `nil`, the layer uses an implicit default value of `MGLLineStyleLayerLineTranslateAnchorMap`.

 This property is only applied to the style if `lineTranslate` is non-`nil`. Otherwise, it is ignored.
 */
@property (nonatomic, nullable) id <MGLStyleAttributeValue> lineTranslateAnchor;

/**
 Stroke thickness.

 This property is measured in points.
 
 If this property is set to `nil`, the layer uses an implicit default value of `1`.
 */
@property (nonatomic, nullable) id <MGLStyleAttributeValue> lineWidth;

/**
 Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.

 This property is measured in points.
 
 If this property is set to `nil`, the layer uses an implicit default value of `0`.
 */
@property (nonatomic, nullable) id <MGLStyleAttributeValue> lineGapWidth;

/**
 The line's offset perpendicular to its direction. Values may be positive or negative, where positive indicates "rightwards" (if you were moving in the direction of the line) and negative indicates "leftwards."

 This property is measured in points.
 
 If this property is set to `nil`, the layer uses an implicit default value of `0`.
 */
@property (nonatomic, nullable) id <MGLStyleAttributeValue> lineOffset;

/**
 Blur applied to the line, in points.

 This property is measured in points.
 
 If this property is set to `nil`, the layer uses an implicit default value of `0`.
 */
@property (nonatomic, nullable) id <MGLStyleAttributeValue> lineBlur;

/**
 Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to points, multiply the length by the current line width.

 This property is measured in line widths.

 This property is only applied to the style if `linePattern` is set to `nil`. Otherwise, it is ignored.
 */
@property (nonatomic, nullable) id <MGLStyleAttributeValue> lineDasharray;

/**
 Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512).
 */
@property (nonatomic, nullable) id <MGLStyleAttributeValue> linePattern;

@end

NS_ASSUME_NONNULL_END