Skip to content

Commit e54be0e

Browse files
committed
chore: Update style json, generate typescript for properties
1 parent 3af6d67 commit e54be0e

File tree

18 files changed

+2485
-53
lines changed

18 files changed

+2485
-53
lines changed

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

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import com.mapbox.maps.extension.style.layers.generated.SymbolLayer;
1717
import com.mapbox.maps.extension.style.layers.generated.HeatmapLayer;
1818
import com.mapbox.maps.extension.style.layers.generated.HillshadeLayer;
19+
import com.mapbox.maps.extension.style.atmosphere.generated.Atmosphere;
1920
// import com.mapbox.maps.extension.style.layers.properties.generated.Visibility;
2021
import com.mapbox.maps.extension.style.layers.properties.generated.*;
2122
import com.mapbox.maps.extension.style.types.StyleTransition;
@@ -184,6 +185,9 @@ public void onAllImagesLoaded() {
184185
case "lineGradient":
185186
RCTMGLStyleFactory.setLineGradient(layer, styleValue);
186187
break;
188+
case "lineTrimOffset":
189+
RCTMGLStyleFactory.setLineTrimOffset(layer, styleValue);
190+
break;
187191
}
188192
}
189193
}
@@ -820,6 +824,56 @@ public static void setLightLayerStyle(final Light layer, RCTMGLStyle style) {
820824
}
821825
}
822826
}
827+
public static void setAtmosphereLayerStyle(final Atmosphere layer, RCTMGLStyle style) {
828+
List<String> styleKeys = style.getAllStyleKeys();
829+
830+
if (styleKeys.size() == 0) {
831+
return;
832+
}
833+
834+
for (String styleKey : styleKeys) {
835+
final RCTMGLStyleValue styleValue = style.getStyleValueForKey(styleKey);
836+
837+
switch (styleKey) {
838+
case "range":
839+
RCTMGLStyleFactory.setRange(layer, styleValue);
840+
break;
841+
case "rangeTransition":
842+
RCTMGLStyleFactory.setRangeTransition(layer, styleValue);
843+
break;
844+
case "color":
845+
RCTMGLStyleFactory.setColor(layer, styleValue);
846+
break;
847+
case "colorTransition":
848+
RCTMGLStyleFactory.setColorTransition(layer, styleValue);
849+
break;
850+
case "highColor":
851+
RCTMGLStyleFactory.setHighColor(layer, styleValue);
852+
break;
853+
case "highColorTransition":
854+
RCTMGLStyleFactory.setHighColorTransition(layer, styleValue);
855+
break;
856+
case "spaceColor":
857+
RCTMGLStyleFactory.setSpaceColor(layer, styleValue);
858+
break;
859+
case "spaceColorTransition":
860+
RCTMGLStyleFactory.setSpaceColorTransition(layer, styleValue);
861+
break;
862+
case "horizonBlend":
863+
RCTMGLStyleFactory.setHorizonBlend(layer, styleValue);
864+
break;
865+
case "horizonBlendTransition":
866+
RCTMGLStyleFactory.setHorizonBlendTransition(layer, styleValue);
867+
break;
868+
case "starIntensity":
869+
RCTMGLStyleFactory.setStarIntensity(layer, styleValue);
870+
break;
871+
case "starIntensityTransition":
872+
RCTMGLStyleFactory.setStarIntensityTransition(layer, styleValue);
873+
break;
874+
}
875+
}
876+
}
823877

824878
public static void setFillSortKey(FillLayer layer, RCTMGLStyleValue styleValue) {
825879
if (styleValue.isExpression()) {
@@ -1141,6 +1195,14 @@ public static void setLineGradient(LineLayer layer, RCTMGLStyleValue styleValue)
11411195
}
11421196
}
11431197

1198+
public static void setLineTrimOffset(LineLayer layer, RCTMGLStyleValue styleValue) {
1199+
if (styleValue.isExpression()) {
1200+
layer.lineTrimOffset(styleValue.getExpression());
1201+
} else {
1202+
layer.lineTrimOffset(styleValue.getFloatArray(VALUE_KEY));
1203+
}
1204+
}
1205+
11441206
public static void setSymbolPlacement(SymbolLayer layer, RCTMGLStyleValue styleValue) {
11451207
if (styleValue.isExpression()) {
11461208
layer.symbolPlacement(styleValue.getExpression());
@@ -2433,4 +2495,100 @@ public static void setIntensityTransition(Light layer, RCTMGLStyleValue styleVal
24332495
}
24342496
}
24352497

2498+
public static void setRange(Atmosphere layer, RCTMGLStyleValue styleValue) {
2499+
if (styleValue.isExpression()) {
2500+
layer.range(styleValue.getExpression());
2501+
} else {
2502+
layer.range(styleValue.getFloatArray(VALUE_KEY));
2503+
}
2504+
}
2505+
2506+
2507+
public static void setRangeTransition(Atmosphere layer, RCTMGLStyleValue styleValue) {
2508+
StyleTransition transition = styleValue.getTransition();
2509+
if (transition != null) {
2510+
layer.rangeTransition(transition);
2511+
}
2512+
}
2513+
2514+
public static void setColor(Atmosphere layer, RCTMGLStyleValue styleValue) {
2515+
if (styleValue.isExpression()) {
2516+
layer.color(styleValue.getExpression());
2517+
} else {
2518+
layer.color(styleValue.getInt(VALUE_KEY));
2519+
}
2520+
}
2521+
2522+
2523+
public static void setColorTransition(Atmosphere layer, RCTMGLStyleValue styleValue) {
2524+
StyleTransition transition = styleValue.getTransition();
2525+
if (transition != null) {
2526+
layer.colorTransition(transition);
2527+
}
2528+
}
2529+
2530+
public static void setHighColor(Atmosphere layer, RCTMGLStyleValue styleValue) {
2531+
if (styleValue.isExpression()) {
2532+
layer.highColor(styleValue.getExpression());
2533+
} else {
2534+
layer.highColor(styleValue.getInt(VALUE_KEY));
2535+
}
2536+
}
2537+
2538+
2539+
public static void setHighColorTransition(Atmosphere layer, RCTMGLStyleValue styleValue) {
2540+
StyleTransition transition = styleValue.getTransition();
2541+
if (transition != null) {
2542+
layer.highColorTransition(transition);
2543+
}
2544+
}
2545+
2546+
public static void setSpaceColor(Atmosphere layer, RCTMGLStyleValue styleValue) {
2547+
if (styleValue.isExpression()) {
2548+
layer.spaceColor(styleValue.getExpression());
2549+
} else {
2550+
layer.spaceColor(styleValue.getInt(VALUE_KEY));
2551+
}
2552+
}
2553+
2554+
2555+
public static void setSpaceColorTransition(Atmosphere layer, RCTMGLStyleValue styleValue) {
2556+
StyleTransition transition = styleValue.getTransition();
2557+
if (transition != null) {
2558+
layer.spaceColorTransition(transition);
2559+
}
2560+
}
2561+
2562+
public static void setHorizonBlend(Atmosphere layer, RCTMGLStyleValue styleValue) {
2563+
if (styleValue.isExpression()) {
2564+
layer.horizonBlend(styleValue.getExpression());
2565+
} else {
2566+
layer.horizonBlend(styleValue.getFloat(VALUE_KEY));
2567+
}
2568+
}
2569+
2570+
2571+
public static void setHorizonBlendTransition(Atmosphere layer, RCTMGLStyleValue styleValue) {
2572+
StyleTransition transition = styleValue.getTransition();
2573+
if (transition != null) {
2574+
layer.horizonBlendTransition(transition);
2575+
}
2576+
}
2577+
2578+
public static void setStarIntensity(Atmosphere layer, RCTMGLStyleValue styleValue) {
2579+
if (styleValue.isExpression()) {
2580+
layer.starIntensity(styleValue.getExpression());
2581+
} else {
2582+
layer.starIntensity(styleValue.getFloat(VALUE_KEY));
2583+
}
2584+
}
2585+
2586+
2587+
public static void setStarIntensityTransition(Atmosphere layer, RCTMGLStyleValue styleValue) {
2588+
StyleTransition transition = styleValue.getTransition();
2589+
if (transition != null) {
2590+
layer.starIntensityTransition(transition);
2591+
}
2592+
}
2593+
24362594
}

docs/LineLayer.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
* <a href="#linedasharray">lineDasharray</a><br/>
3737
* <a href="#linepattern">linePattern</a><br/>
3838
* <a href="#linegradient">lineGradient</a><br/>
39+
* <a href="#linetrimoffset">lineTrimOffset</a><br/>
3940

4041
___
4142

@@ -582,3 +583,24 @@ Defines a gradient with which to color a line feature. Can only be used with Geo
582583

583584
Parameters: `line-progress`
584585

586+
___
587+
588+
#### lineTrimOffset
589+
Name: `lineTrimOffset`
590+
591+
#### Description
592+
The line part between [trimStart, trimEnd] will be marked as transparent to make a route vanishing effect. The line trimOff offset is based on the whole line range [0.0, 1.0].
593+
594+
#### Type
595+
`array<number>`
596+
#### Default Value
597+
`[0,0]`
598+
599+
#### Minimum
600+
`0,0`
601+
602+
603+
#### Maximum
604+
`1,1`
605+
606+

docs/SymbolLayer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ ___
572572
Name: `textField`
573573

574574
#### Description
575-
Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options.
575+
Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options. SDF images are not supported in formatted text and will be ignored.
576576

577577
#### Type
578578
`formatted`

docs/Terrain.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!-- This file was autogenerated from Terrain.js do not modify -->
22
## <MapboxGL.Terrain />
3-
### Terrain renders a terran
3+
### A global modifier that elevates layers and markers based on a DEM data source.
44

55
### props
66
| Prop | Type | Default | Required | Description |

docs/docs.json

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2555,6 +2555,28 @@
25552555
]
25562556
},
25572557
"transition": false
2558+
},
2559+
{
2560+
"name": "lineTrimOffset",
2561+
"type": "array<number>",
2562+
"values": [],
2563+
"minimum": [
2564+
0,
2565+
0
2566+
],
2567+
"maximum": [
2568+
1,
2569+
1
2570+
],
2571+
"default": [
2572+
0,
2573+
0
2574+
],
2575+
"description": "The line part between [trimStart, trimEnd] will be marked as transparent to make a route vanishing effect. The line trimOff offset is based on the whole line range [0.0, 1.0].",
2576+
"requires": [],
2577+
"disabledBy": [],
2578+
"allowedFunctionTypes": [],
2579+
"transition": false
25582580
}
25592581
]
25602582
},
@@ -5020,7 +5042,7 @@
50205042
"type": "formatted",
50215043
"values": [],
50225044
"default": "",
5023-
"description": "Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options.",
5045+
"description": "Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options. SDF images are not supported in formatted text and will be ignored.",
50245046
"requires": [],
50255047
"disabledBy": [],
50265048
"allowedFunctionTypes": [],
@@ -5829,7 +5851,7 @@
58295851
]
58305852
},
58315853
"Terrain": {
5832-
"description": "Terrain renders a terran",
5854+
"description": "A global modifier that elevates layers and markers based on a DEM data source.",
58335855
"displayName": "Terrain",
58345856
"methods": [
58355857
{

0 commit comments

Comments
 (0)