Skip to content

Commit a48f1f7

Browse files
committed
Update style json, improve autogenerate
1 parent 62c7b01 commit a48f1f7

File tree

15 files changed

+755
-302
lines changed

15 files changed

+755
-302
lines changed

android/rctmgl/src/main/java/com/mapbox/rctmgl/components/styles/RCTMGLStyleFactory.java

+44
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,9 @@ public static void setSymbolLayerStyle(final SymbolLayer layer, RCTMGLStyle styl
197197
case "symbolAvoidEdges":
198198
RCTMGLStyleFactory.setSymbolAvoidEdges(layer, styleValue);
199199
break;
200+
case "symbolSortKey":
201+
RCTMGLStyleFactory.setSymbolSortKey(layer, styleValue);
202+
break;
200203
case "symbolZOrder":
201204
RCTMGLStyleFactory.setSymbolZOrder(layer, styleValue);
202205
break;
@@ -274,12 +277,21 @@ public void onAllImagesLoaded() {
274277
case "textJustify":
275278
RCTMGLStyleFactory.setTextJustify(layer, styleValue);
276279
break;
280+
case "textRadialOffset":
281+
RCTMGLStyleFactory.setTextRadialOffset(layer, styleValue);
282+
break;
283+
case "textVariableAnchor":
284+
RCTMGLStyleFactory.setTextVariableAnchor(layer, styleValue);
285+
break;
277286
case "textAnchor":
278287
RCTMGLStyleFactory.setTextAnchor(layer, styleValue);
279288
break;
280289
case "textMaxAngle":
281290
RCTMGLStyleFactory.setTextMaxAngle(layer, styleValue);
282291
break;
292+
case "textWritingMode":
293+
RCTMGLStyleFactory.setTextWritingMode(layer, styleValue);
294+
break;
283295
case "textRotate":
284296
RCTMGLStyleFactory.setTextRotate(layer, styleValue);
285297
break;
@@ -1066,6 +1078,14 @@ public static void setSymbolAvoidEdges(SymbolLayer layer, RCTMGLStyleValue style
10661078
}
10671079
}
10681080

1081+
public static void setSymbolSortKey(SymbolLayer layer, RCTMGLStyleValue styleValue) {
1082+
if (styleValue.isExpression()) {
1083+
layer.setProperties(PropertyFactory.symbolSortKey(styleValue.getExpression()));
1084+
} else {
1085+
layer.setProperties(PropertyFactory.symbolSortKey(styleValue.getFloat(VALUE_KEY)));
1086+
}
1087+
}
1088+
10691089
public static void setSymbolZOrder(SymbolLayer layer, RCTMGLStyleValue styleValue) {
10701090
if (styleValue.isExpression()) {
10711091
layer.setProperties(PropertyFactory.symbolZOrder(styleValue.getExpression()));
@@ -1258,6 +1278,22 @@ public static void setTextJustify(SymbolLayer layer, RCTMGLStyleValue styleValue
12581278
}
12591279
}
12601280

1281+
public static void setTextRadialOffset(SymbolLayer layer, RCTMGLStyleValue styleValue) {
1282+
if (styleValue.isExpression()) {
1283+
layer.setProperties(PropertyFactory.textRadialOffset(styleValue.getExpression()));
1284+
} else {
1285+
layer.setProperties(PropertyFactory.textRadialOffset(styleValue.getFloat(VALUE_KEY)));
1286+
}
1287+
}
1288+
1289+
public static void setTextVariableAnchor(SymbolLayer layer, RCTMGLStyleValue styleValue) {
1290+
if (styleValue.isExpression()) {
1291+
layer.setProperties(PropertyFactory.textVariableAnchor(styleValue.getExpression()));
1292+
} else {
1293+
layer.setProperties(PropertyFactory.textVariableAnchor(styleValue.getStringArray(VALUE_KEY)));
1294+
}
1295+
}
1296+
12611297
public static void setTextAnchor(SymbolLayer layer, RCTMGLStyleValue styleValue) {
12621298
if (styleValue.isExpression()) {
12631299
layer.setProperties(PropertyFactory.textAnchor(styleValue.getExpression()));
@@ -1274,6 +1310,14 @@ public static void setTextMaxAngle(SymbolLayer layer, RCTMGLStyleValue styleValu
12741310
}
12751311
}
12761312

1313+
public static void setTextWritingMode(SymbolLayer layer, RCTMGLStyleValue styleValue) {
1314+
if (styleValue.isExpression()) {
1315+
layer.setProperties(PropertyFactory.textWritingMode(styleValue.getExpression()));
1316+
} else {
1317+
layer.setProperties(PropertyFactory.textWritingMode(styleValue.getStringArray(VALUE_KEY)));
1318+
}
1319+
}
1320+
12771321
public static void setTextRotate(SymbolLayer layer, RCTMGLStyleValue styleValue) {
12781322
if (styleValue.isExpression()) {
12791323
layer.setProperties(PropertyFactory.textRotate(styleValue.getExpression()));

docs/BackgroundLayer.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ ___
7373
Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoomDependent expressions will be evaluated only at integer zoom levels.
7474

7575
#### Type
76-
`string`
76+
`resolvedImage`
7777

7878

7979
#### Expression

docs/FillExtrusionLayer.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ ___
147147
Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoomDependent expressions will be evaluated only at integer zoom levels.
148148

149149
#### Type
150-
`string`
150+
`resolvedImage`
151151

152152

153153
#### Expression

docs/FillLayer.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ ___
184184
Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoomDependent expressions will be evaluated only at integer zoom levels.
185185

186186
#### Type
187-
`string`
187+
`resolvedImage`
188188

189189

190190
#### Expression

docs/LineLayer.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ ___
359359
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). Note that zoomDependent expressions will be evaluated only at integer zoom levels.
360360

361361
#### Type
362-
`string`
362+
`resolvedImage`
363363

364364

365365
#### Expression

docs/SymbolLayer.md

+137-52
Original file line numberDiff line numberDiff line change
@@ -22,55 +22,59 @@
2222
* <a href="#name">symbolPlacement</a><br/>
2323
* <a href="#name-1">symbolSpacing</a><br/>
2424
* <a href="#name-2">symbolAvoidEdges</a><br/>
25-
* <a href="#name-3">symbolZOrder</a><br/>
26-
* <a href="#name-4">iconAllowOverlap</a><br/>
27-
* <a href="#name-5">iconIgnorePlacement</a><br/>
28-
* <a href="#name-6">iconOptional</a><br/>
29-
* <a href="#name-7">iconRotationAlignment</a><br/>
30-
* <a href="#name-8">iconSize</a><br/>
31-
* <a href="#name-9">iconTextFit</a><br/>
32-
* <a href="#name-10">iconTextFitPadding</a><br/>
33-
* <a href="#name-11">iconImage</a><br/>
34-
* <a href="#name-12">iconRotate</a><br/>
35-
* <a href="#name-13">iconPadding</a><br/>
36-
* <a href="#name-14">iconKeepUpright</a><br/>
37-
* <a href="#name-15">iconOffset</a><br/>
38-
* <a href="#name-16">iconAnchor</a><br/>
39-
* <a href="#name-17">iconPitchAlignment</a><br/>
40-
* <a href="#name-18">textPitchAlignment</a><br/>
41-
* <a href="#name-19">textRotationAlignment</a><br/>
42-
* <a href="#name-20">textField</a><br/>
43-
* <a href="#name-21">textFont</a><br/>
44-
* <a href="#name-22">textSize</a><br/>
45-
* <a href="#name-23">textMaxWidth</a><br/>
46-
* <a href="#name-24">textLineHeight</a><br/>
47-
* <a href="#name-25">textLetterSpacing</a><br/>
48-
* <a href="#name-26">textJustify</a><br/>
49-
* <a href="#name-27">textAnchor</a><br/>
50-
* <a href="#name-28">textMaxAngle</a><br/>
51-
* <a href="#name-29">textRotate</a><br/>
52-
* <a href="#name-30">textPadding</a><br/>
53-
* <a href="#name-31">textKeepUpright</a><br/>
54-
* <a href="#name-32">textTransform</a><br/>
55-
* <a href="#name-33">textOffset</a><br/>
56-
* <a href="#name-34">textAllowOverlap</a><br/>
57-
* <a href="#name-35">textIgnorePlacement</a><br/>
58-
* <a href="#name-36">textOptional</a><br/>
59-
* <a href="#name-37">visibility</a><br/>
60-
* <a href="#name-38">iconOpacity</a><br/>
61-
* <a href="#name-39">iconColor</a><br/>
62-
* <a href="#name-40">iconHaloColor</a><br/>
63-
* <a href="#name-41">iconHaloWidth</a><br/>
64-
* <a href="#name-42">iconHaloBlur</a><br/>
65-
* <a href="#name-43">iconTranslate</a><br/>
66-
* <a href="#name-44">iconTranslateAnchor</a><br/>
67-
* <a href="#name-45">textOpacity</a><br/>
68-
* <a href="#name-46">textColor</a><br/>
69-
* <a href="#name-47">textHaloColor</a><br/>
70-
* <a href="#name-48">textHaloWidth</a><br/>
71-
* <a href="#name-49">textHaloBlur</a><br/>
72-
* <a href="#name-50">textTranslate</a><br/>
73-
* <a href="#name-51">textTranslateAnchor</a><br/>
25+
* <a href="#name-3">symbolSortKey</a><br/>
26+
* <a href="#name-4">symbolZOrder</a><br/>
27+
* <a href="#name-5">iconAllowOverlap</a><br/>
28+
* <a href="#name-6">iconIgnorePlacement</a><br/>
29+
* <a href="#name-7">iconOptional</a><br/>
30+
* <a href="#name-8">iconRotationAlignment</a><br/>
31+
* <a href="#name-9">iconSize</a><br/>
32+
* <a href="#name-10">iconTextFit</a><br/>
33+
* <a href="#name-11">iconTextFitPadding</a><br/>
34+
* <a href="#name-12">iconImage</a><br/>
35+
* <a href="#name-13">iconRotate</a><br/>
36+
* <a href="#name-14">iconPadding</a><br/>
37+
* <a href="#name-15">iconKeepUpright</a><br/>
38+
* <a href="#name-16">iconOffset</a><br/>
39+
* <a href="#name-17">iconAnchor</a><br/>
40+
* <a href="#name-18">iconPitchAlignment</a><br/>
41+
* <a href="#name-19">textPitchAlignment</a><br/>
42+
* <a href="#name-20">textRotationAlignment</a><br/>
43+
* <a href="#name-21">textField</a><br/>
44+
* <a href="#name-22">textFont</a><br/>
45+
* <a href="#name-23">textSize</a><br/>
46+
* <a href="#name-24">textMaxWidth</a><br/>
47+
* <a href="#name-25">textLineHeight</a><br/>
48+
* <a href="#name-26">textLetterSpacing</a><br/>
49+
* <a href="#name-27">textJustify</a><br/>
50+
* <a href="#name-28">textRadialOffset</a><br/>
51+
* <a href="#name-29">textVariableAnchor</a><br/>
52+
* <a href="#name-30">textAnchor</a><br/>
53+
* <a href="#name-31">textMaxAngle</a><br/>
54+
* <a href="#name-32">textWritingMode</a><br/>
55+
* <a href="#name-33">textRotate</a><br/>
56+
* <a href="#name-34">textPadding</a><br/>
57+
* <a href="#name-35">textKeepUpright</a><br/>
58+
* <a href="#name-36">textTransform</a><br/>
59+
* <a href="#name-37">textOffset</a><br/>
60+
* <a href="#name-38">textAllowOverlap</a><br/>
61+
* <a href="#name-39">textIgnorePlacement</a><br/>
62+
* <a href="#name-40">textOptional</a><br/>
63+
* <a href="#name-41">visibility</a><br/>
64+
* <a href="#name-42">iconOpacity</a><br/>
65+
* <a href="#name-43">iconColor</a><br/>
66+
* <a href="#name-44">iconHaloColor</a><br/>
67+
* <a href="#name-45">iconHaloWidth</a><br/>
68+
* <a href="#name-46">iconHaloBlur</a><br/>
69+
* <a href="#name-47">iconTranslate</a><br/>
70+
* <a href="#name-48">iconTranslateAnchor</a><br/>
71+
* <a href="#name-49">textOpacity</a><br/>
72+
* <a href="#name-50">textColor</a><br/>
73+
* <a href="#name-51">textHaloColor</a><br/>
74+
* <a href="#name-52">textHaloWidth</a><br/>
75+
* <a href="#name-53">textHaloBlur</a><br/>
76+
* <a href="#name-54">textTranslate</a><br/>
77+
* <a href="#name-55">textTranslateAnchor</a><br/>
7478

7579
___
7680

@@ -125,7 +129,7 @@ ___
125129
`symbolAvoidEdges`
126130

127131
#### Description
128-
If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer.
132+
If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like Mapbox GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.
129133

130134
#### Type
131135
`boolean`
@@ -139,6 +143,22 @@ Parameters: `zoom`
139143

140144
___
141145

146+
#### Name
147+
`symbolSortKey`
148+
149+
#### Description
150+
Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key when they overlap. Features with a lower sort key will have priority over other features when doing placement.
151+
152+
#### Type
153+
`number`
154+
155+
156+
#### Expression
157+
158+
Parameters: `zoom, feature`
159+
160+
___
161+
142162
#### Name
143163
`symbolZOrder`
144164

@@ -336,7 +356,7 @@ ___
336356
Name of image in sprite to use for drawing an image background.
337357

338358
#### Type
339-
`string`
359+
`resolvedImage`
340360

341361

342362
#### Expression
@@ -724,6 +744,49 @@ Parameters: `zoom, feature`
724744

725745
___
726746

747+
#### Name
748+
`textRadialOffset`
749+
750+
#### Description
751+
Radial offset of text, in the direction of the symbol's anchor. Useful in combination with `textVariableAnchor`, which defaults to using the twoDimensional `textOffset` if present.
752+
753+
#### Type
754+
`number`
755+
#### Default Value
756+
`0`
757+
758+
#### Units
759+
`ems`
760+
761+
762+
#### Requires
763+
`textField`
764+
765+
#### Expression
766+
767+
Parameters: `zoom, feature`
768+
769+
___
770+
771+
#### Name
772+
`textVariableAnchor`
773+
774+
#### Description
775+
To increase the chance of placing highPriority labels on the map, you can provide an array of `textAnchor` locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use `textJustify: auto` to choose justification based on anchor position. To apply an offset, use the `textRadialOffset` or the twoDimensional `textOffset`.
776+
777+
#### Type
778+
`array<enum>`
779+
780+
781+
#### Requires
782+
`textField`
783+
784+
#### Expression
785+
786+
Parameters: `zoom`
787+
788+
___
789+
727790
#### Name
728791
`textAnchor`
729792

@@ -750,6 +813,9 @@ Part of the text placed closest to the anchor.
750813
#### Requires
751814
`textField`
752815

816+
#### Disabled By
817+
`textVariableAnchor`
818+
753819
#### Supported Style Functions
754820
`camera`
755821
#### Expression
@@ -773,6 +839,25 @@ Maximum angle change between adjacent characters.
773839
`degrees`
774840

775841

842+
#### Requires
843+
`textField`
844+
845+
#### Expression
846+
847+
Parameters: `zoom`
848+
849+
___
850+
851+
#### Name
852+
`textWritingMode`
853+
854+
#### Description
855+
The property allows control over a symbol's orientation. Note that the property values act as a hint, so that a symbol whose language doesn’t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single 'vertical' enum value. The order of elements in an array define priority order for the placement of an orientation variant.
856+
857+
#### Type
858+
`array<enum>`
859+
860+
776861
#### Requires
777862
`textField`
778863

@@ -884,7 +969,7 @@ ___
884969
`textOffset`
885970

886971
#### Description
887-
Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up.
972+
Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with textVariableAnchor, input values will be taken as absolute values. Offsets along the x and yAxis will be applied automatically based on the anchor position.
888973

889974
#### Type
890975
`array<number>`

0 commit comments

Comments
 (0)