Skip to content

Commit 7a9bd38

Browse files
author
Chris Vietor
committed
feat: more paint and layout properties for LineLayer supported
1 parent 9b5d19f commit 7a9bd38

File tree

2 files changed

+66
-12
lines changed

2 files changed

+66
-12
lines changed

src/layers/layer-factory.android.ts

+36-6
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,17 @@ export class LayerFactory {
5252
line-cap ✓
5353
line-color ✓
5454
line-dasharray ✓
55-
line-gap-width
55+
line-gap-width
5656
line-gradient
5757
line-join ✓
58-
line-miter-limit
59-
line-offset
58+
line-miter-limit
59+
line-offset
6060
line-opacity ✓
6161
line-pattern
62-
line-round-limit
62+
line-round-limit
6363
line-sort-key
64-
line-translate
65-
line-translate-anchor
64+
line-translate
65+
line-translate-anchor
6666
line-width ✓
6767
visibility
6868
*/
@@ -105,6 +105,10 @@ export class LayerFactory {
105105
lineProperties.push(com.mapbox.mapboxsdk.style.layers.PropertyFactory.lineDasharray(dashArray));
106106
}
107107

108+
if (propertiesObject['line-gap-width']) {
109+
lineProperties.push(com.mapbox.mapboxsdk.style.layers.PropertyFactory.lineGapWidth(new java.lang.Float(propertiesObject['line-gap-width'])));
110+
}
111+
108112
if (propertiesObject['line-join']) {
109113
let property;
110114

@@ -125,10 +129,36 @@ export class LayerFactory {
125129
lineProperties.push(com.mapbox.mapboxsdk.style.layers.PropertyFactory.lineJoin(property));
126130
}
127131

132+
if (propertiesObject['line-miter-limit']) {
133+
lineProperties.push(com.mapbox.mapboxsdk.style.layers.PropertyFactory.lineMiterLimit(new java.lang.Float(propertiesObject['line-miter-limit'])));
134+
}
135+
136+
if (propertiesObject['line-offset']) {
137+
lineProperties.push(com.mapbox.mapboxsdk.style.layers.PropertyFactory.lineOffset(new java.lang.Float(propertiesObject['line-offset'])));
138+
}
139+
128140
if (propertiesObject['line-opacity']) {
129141
lineProperties.push(com.mapbox.mapboxsdk.style.layers.PropertyFactory.lineOpacity(new java.lang.Float(propertiesObject['line-opacity'])));
130142
}
131143

144+
if (propertiesObject['line-round-limit']) {
145+
lineProperties.push(com.mapbox.mapboxsdk.style.layers.PropertyFactory.lineRoundLimit(new java.lang.Float(propertiesObject['line-round-limit'])));
146+
}
147+
148+
if (propertiesObject['line-translate']) {
149+
const dashArray = Array.create('java.lang.Float', propertiesObject['line-translate'].length);
150+
151+
for (let i = 0; i < propertiesObject['line-translate'].length; i++) {
152+
dashArray[i] = new java.lang.Float(propertiesObject['line-translate'][i]);
153+
}
154+
155+
lineProperties.push(com.mapbox.mapboxsdk.style.layers.PropertyFactory.lineTranslate(dashArray));
156+
}
157+
158+
if (propertiesObject['line-translate-anchor']) {
159+
lineProperties.push(com.mapbox.mapboxsdk.style.layers.PropertyFactory.lineTranslateAnchor(propertiesObject['line-translate-anchor']));
160+
}
161+
132162
if (propertiesObject['line-width']) {
133163
lineProperties.push(com.mapbox.mapboxsdk.style.layers.PropertyFactory.lineWidth(new java.lang.Float(propertiesObject['line-width'])));
134164
}

src/layers/layer-factory.ios.ts

+30-6
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,17 @@ export class LayerFactory {
5858
line-cap ✓
5959
line-color ✓
6060
line-dasharray ✓
61-
line-gap-width
61+
line-gap-width
6262
line-gradient
6363
line-join ✓
64-
line-miter-limit
65-
line-offset
64+
line-miter-limit
65+
line-offset
6666
line-opacity ✓
6767
line-pattern
68-
line-round-limit
68+
line-round-limit
6969
line-sort-key
70-
line-translate
71-
line-translate-anchor
70+
line-translate
71+
line-translate-anchor
7272
line-width ✓
7373
visibility
7474
*/
@@ -89,14 +89,38 @@ export class LayerFactory {
8989
lineProperties['lineDashPattern'] = NSExpression.expressionForConstantValue(propertiesObject['line-dash-array']);
9090
}
9191

92+
if (propertiesObject['line-gap-width']) {
93+
lineProperties['lineGapWidth'] = NSExpression.expressionForConstantValue(propertiesObject['line-gap-width']);
94+
}
95+
9296
if (propertiesObject['line-join']) {
9397
lineProperties['lineJoin'] = NSExpression.expressionForConstantValue(propertiesObject['line-join']);
9498
}
9599

100+
if (propertiesObject['line-miter-limit']) {
101+
lineProperties['lineMiterLimit'] = NSExpression.expressionForConstantValue(propertiesObject['line-miter-limit']);
102+
}
103+
104+
if (propertiesObject['line-offset']) {
105+
lineProperties['lineOffset'] = NSExpression.expressionForConstantValue(propertiesObject['line-offset']);
106+
}
107+
96108
if (propertiesObject['line-opacity']) {
97109
lineProperties['lineOpacity'] = NSExpression.expressionForConstantValue(propertiesObject['line-opacity']);
98110
}
99111

112+
if (propertiesObject['line-round-limit']) {
113+
lineProperties['lineRoundLimit'] = NSExpression.expressionForConstantValue(propertiesObject['line-round-limit']);
114+
}
115+
116+
if (propertiesObject['line-translate']) {
117+
lineProperties['lineTranslation'] = NSExpression.expressionForConstantValue(propertiesObject['line-translate']);
118+
}
119+
120+
if (propertiesObject['line-translate-anchor']) {
121+
lineProperties['lineTranslationAnchor'] = NSExpression.expressionForConstantValue(propertiesObject['line-translate-anchor']);
122+
}
123+
100124
if (propertiesObject['line-width']) {
101125
lineProperties['lineWidth'] = NSExpression.expressionForConstantValue(propertiesObject['line-width']);
102126
}

0 commit comments

Comments
 (0)