@rnmapbox/maps 10.3.0 → 10.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/java/com/rnmapbox/rnmbx/RNMBXPackage.kt +4 -0
- package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/RNMBXStyleFactory.kt +638 -0
- package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/rain/RNMBXRain.kt +83 -0
- package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/rain/RNMBXRainManager.kt +40 -0
- package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/snow/RNMBXSnow.kt +66 -0
- package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/snow/RNMBXSnowManager.kt +40 -0
- package/ios/RNMBX/RNMBXAtmosphereComponentView.mm +2 -1
- package/ios/RNMBX/RNMBXBackgroundLayerComponentView.mm +2 -1
- package/ios/RNMBX/RNMBXBridgeManager.h +8 -0
- package/ios/RNMBX/RNMBXBridgeManager.m +16 -0
- package/ios/RNMBX/RNMBXCircleLayerComponentView.mm +2 -1
- package/ios/RNMBX/RNMBXFillExtrusionLayerComponentView.mm +2 -1
- package/ios/RNMBX/RNMBXFillLayerComponentView.mm +2 -1
- package/ios/RNMBX/RNMBXHeatmapLayerComponentView.mm +2 -1
- package/ios/RNMBX/RNMBXHillshadeLayerComponentView.mm +2 -1
- package/ios/RNMBX/RNMBXImageModule.h +1 -0
- package/ios/RNMBX/RNMBXImageModule.mm +15 -2
- package/ios/RNMBX/RNMBXImageQueue.swift +9 -1
- package/ios/RNMBX/RNMBXImages.swift +4 -0
- package/ios/RNMBX/RNMBXImagesComponentView.mm +2 -1
- package/ios/RNMBX/RNMBXLightComponentView.mm +2 -1
- package/ios/RNMBX/RNMBXLineLayerComponentView.mm +2 -1
- package/ios/RNMBX/RNMBXModelLayerComponentView.mm +2 -1
- package/ios/RNMBX/RNMBXRain.swift +92 -0
- package/ios/RNMBX/RNMBXRainComponentView.h +14 -0
- package/ios/RNMBX/RNMBXRainComponentView.mm +80 -0
- package/ios/RNMBX/RNMBXRasterLayerComponentView.mm +2 -1
- package/ios/RNMBX/RNMBXRasterParticleLayerComponentView.mm +2 -1
- package/ios/RNMBX/RNMBXSkyLayerComponentView.mm +2 -1
- package/ios/RNMBX/RNMBXSnow.swift +76 -0
- package/ios/RNMBX/RNMBXSnowComponentView.h +14 -0
- package/ios/RNMBX/RNMBXSnowComponentView.mm +80 -0
- package/ios/RNMBX/RNMBXStyle.swift +415 -9
- package/ios/RNMBX/RNMBXStyleValue.swift +7 -1
- package/ios/RNMBX/RNMBXSymbolLayerComponentView.mm +2 -1
- package/ios/RNMBX/RNMBXTerrainComponentView.mm +2 -1
- package/lib/commonjs/plugin/install.md +2 -2
- package/lib/module/Mapbox.native.js +2 -0
- package/lib/module/Mapbox.native.js.map +1 -1
- package/lib/module/components/Rain.js +19 -0
- package/lib/module/components/Rain.js.map +1 -0
- package/lib/module/components/Snow.js +19 -0
- package/lib/module/components/Snow.js.map +1 -0
- package/lib/module/specs/RNMBXRainNativeComponent.ts +13 -0
- package/lib/module/specs/RNMBXSnowNativeComponent.ts +13 -0
- package/lib/module/utils/styleMap.js +20 -0
- package/lib/module/utils/styleMap.js.map +1 -1
- package/lib/typescript/scripts/autogenHelpers/generateCodeWithEjs.d.mts +71 -2
- package/lib/typescript/scripts/autogenHelpers/generateCodeWithEjs.d.mts.map +1 -1
- package/lib/typescript/scripts/autogenHelpers/globals.d.mts +1 -1
- package/lib/typescript/scripts/autogenHelpers/globals.d.mts.map +1 -1
- package/lib/typescript/src/Mapbox.native.d.ts +2 -0
- package/lib/typescript/src/Mapbox.native.d.ts.map +1 -1
- package/lib/typescript/src/components/Callout.d.ts +3 -3
- package/lib/typescript/src/components/Rain.d.ts +17 -0
- package/lib/typescript/src/components/Rain.d.ts.map +1 -0
- package/lib/typescript/src/components/Snow.d.ts +8 -0
- package/lib/typescript/src/components/Snow.d.ts.map +1 -0
- package/lib/typescript/src/specs/RNMBXRainNativeComponent.d.ts +8 -0
- package/lib/typescript/src/specs/RNMBXRainNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/specs/RNMBXSnowNativeComponent.d.ts +8 -0
- package/lib/typescript/src/specs/RNMBXSnowNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/utils/MapboxStyles.d.ts +171 -1
- package/lib/typescript/src/utils/MapboxStyles.d.ts.map +1 -1
- package/lib/typescript/src/utils/styleMap.d.ts.map +1 -1
- package/package.json +12 -3
- package/plugin/install.md +2 -2
- package/src/Mapbox.native.ts +2 -0
- package/src/components/Rain.tsx +31 -0
- package/src/components/Snow.tsx +22 -0
- package/src/specs/RNMBXRainNativeComponent.ts +13 -0
- package/src/specs/RNMBXSnowNativeComponent.ts +13 -0
- package/src/utils/MapboxStyles.ts +191 -0
- package/src/utils/styleMap.ts +22 -0
|
@@ -26,6 +26,8 @@ import com.rnmapbox.rnmbx.components.mapview.NativeMapViewModule
|
|
|
26
26
|
import com.rnmapbox.rnmbx.components.mapview.RNMBXMapViewManager
|
|
27
27
|
import com.rnmapbox.rnmbx.components.styles.RNMBXStyleImportManager
|
|
28
28
|
import com.rnmapbox.rnmbx.components.styles.atmosphere.RNMBXAtmosphereManager
|
|
29
|
+
import com.rnmapbox.rnmbx.components.styles.snow.RNMBXSnowManager
|
|
30
|
+
import com.rnmapbox.rnmbx.components.styles.rain.RNMBXRainManager
|
|
29
31
|
import com.rnmapbox.rnmbx.components.styles.layers.RNMBXBackgroundLayerManager
|
|
30
32
|
import com.rnmapbox.rnmbx.components.styles.layers.RNMBXCircleLayerManager
|
|
31
33
|
import com.rnmapbox.rnmbx.components.styles.layers.RNMBXFillExtrusionLayerManager
|
|
@@ -169,6 +171,8 @@ class RNMBXPackage : TurboReactPackage() {
|
|
|
169
171
|
managers.add(RNMBXSkyLayerManager())
|
|
170
172
|
managers.add(RNMBXTerrainManager())
|
|
171
173
|
managers.add(RNMBXAtmosphereManager())
|
|
174
|
+
managers.add(RNMBXSnowManager())
|
|
175
|
+
managers.add(RNMBXRainManager())
|
|
172
176
|
managers.add(RNMBXBackgroundLayerManager())
|
|
173
177
|
managers.add(RNMBXLightManager())
|
|
174
178
|
managers.add(RNMBXModelLayerManager())
|
|
@@ -18,6 +18,8 @@ import com.mapbox.maps.extension.style.layers.generated.SymbolLayer
|
|
|
18
18
|
import com.mapbox.maps.extension.style.layers.generated.HeatmapLayer
|
|
19
19
|
import com.mapbox.maps.extension.style.layers.generated.HillshadeLayer
|
|
20
20
|
import com.mapbox.maps.extension.style.atmosphere.generated.Atmosphere
|
|
21
|
+
import com.mapbox.maps.extension.style.precipitations.generated.Snow
|
|
22
|
+
import com.mapbox.maps.extension.style.precipitations.generated.Rain
|
|
21
23
|
import com.mapbox.maps.extension.style.terrain.generated.Terrain
|
|
22
24
|
import com.mapbox.maps.extension.style.layers.generated.ModelLayer
|
|
23
25
|
// import com.mapbox.maps.extension.style.layers.properties.generated.Visibility
|
|
@@ -189,6 +191,10 @@ object RNMBXStyleFactory {
|
|
|
189
191
|
setLineElevationReference(layer, styleValue)
|
|
190
192
|
"lineCrossSlope" ->
|
|
191
193
|
setLineCrossSlope(layer, styleValue)
|
|
194
|
+
"lineElevationGroundScale" ->
|
|
195
|
+
setLineElevationGroundScale(layer, styleValue)
|
|
196
|
+
"lineElevationGroundScaleTransition" ->
|
|
197
|
+
setLineElevationGroundScaleTransition(layer, styleValue)
|
|
192
198
|
"linePatternCrossFade" ->
|
|
193
199
|
style.addImage(styleValue!!, styleKey, object : OnAllImagesLoaded {
|
|
194
200
|
override fun onAllImagesLoaded() {
|
|
@@ -1027,6 +1033,118 @@ object RNMBXStyleFactory {
|
|
|
1027
1033
|
}
|
|
1028
1034
|
}
|
|
1029
1035
|
}
|
|
1036
|
+
fun setSnowLayerStyle(layer: Snow, style: RNMBXStyle ) {
|
|
1037
|
+
val styleKeys = style.allStyleKeys
|
|
1038
|
+
|
|
1039
|
+
if (styleKeys.isEmpty()) {
|
|
1040
|
+
return
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
for (styleKey in styleKeys) {
|
|
1044
|
+
try {
|
|
1045
|
+
val styleValue = style.getStyleValueForKey(styleKey)
|
|
1046
|
+
|
|
1047
|
+
when (styleKey) {
|
|
1048
|
+
"density" ->
|
|
1049
|
+
setDensity(layer, styleValue)
|
|
1050
|
+
"densityTransition" ->
|
|
1051
|
+
setDensityTransition(layer, styleValue)
|
|
1052
|
+
"intensity" ->
|
|
1053
|
+
setIntensity(layer, styleValue)
|
|
1054
|
+
"intensityTransition" ->
|
|
1055
|
+
setIntensityTransition(layer, styleValue)
|
|
1056
|
+
"color" ->
|
|
1057
|
+
setColor(layer, styleValue)
|
|
1058
|
+
"colorTransition" ->
|
|
1059
|
+
setColorTransition(layer, styleValue)
|
|
1060
|
+
"opacity" ->
|
|
1061
|
+
setOpacity(layer, styleValue)
|
|
1062
|
+
"opacityTransition" ->
|
|
1063
|
+
setOpacityTransition(layer, styleValue)
|
|
1064
|
+
"vignette" ->
|
|
1065
|
+
setVignette(layer, styleValue)
|
|
1066
|
+
"vignetteTransition" ->
|
|
1067
|
+
setVignetteTransition(layer, styleValue)
|
|
1068
|
+
"vignetteColor" ->
|
|
1069
|
+
setVignetteColor(layer, styleValue)
|
|
1070
|
+
"vignetteColorTransition" ->
|
|
1071
|
+
setVignetteColorTransition(layer, styleValue)
|
|
1072
|
+
"centerThinning" ->
|
|
1073
|
+
setCenterThinning(layer, styleValue)
|
|
1074
|
+
"centerThinningTransition" ->
|
|
1075
|
+
setCenterThinningTransition(layer, styleValue)
|
|
1076
|
+
"direction" ->
|
|
1077
|
+
setDirection(layer, styleValue)
|
|
1078
|
+
"directionTransition" ->
|
|
1079
|
+
setDirectionTransition(layer, styleValue)
|
|
1080
|
+
"flakeSize" ->
|
|
1081
|
+
setFlakeSize(layer, styleValue)
|
|
1082
|
+
"flakeSizeTransition" ->
|
|
1083
|
+
setFlakeSizeTransition(layer, styleValue)
|
|
1084
|
+
}
|
|
1085
|
+
} catch (e: MapboxStyleException) {
|
|
1086
|
+
Logger.e(LOG_TAG, "Failed to update: $styleKey ${e.message}")
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
fun setRainLayerStyle(layer: Rain, style: RNMBXStyle ) {
|
|
1091
|
+
val styleKeys = style.allStyleKeys
|
|
1092
|
+
|
|
1093
|
+
if (styleKeys.isEmpty()) {
|
|
1094
|
+
return
|
|
1095
|
+
}
|
|
1096
|
+
|
|
1097
|
+
for (styleKey in styleKeys) {
|
|
1098
|
+
try {
|
|
1099
|
+
val styleValue = style.getStyleValueForKey(styleKey)
|
|
1100
|
+
|
|
1101
|
+
when (styleKey) {
|
|
1102
|
+
"density" ->
|
|
1103
|
+
setDensity(layer, styleValue)
|
|
1104
|
+
"densityTransition" ->
|
|
1105
|
+
setDensityTransition(layer, styleValue)
|
|
1106
|
+
"intensity" ->
|
|
1107
|
+
setIntensity(layer, styleValue)
|
|
1108
|
+
"intensityTransition" ->
|
|
1109
|
+
setIntensityTransition(layer, styleValue)
|
|
1110
|
+
"color" ->
|
|
1111
|
+
setColor(layer, styleValue)
|
|
1112
|
+
"colorTransition" ->
|
|
1113
|
+
setColorTransition(layer, styleValue)
|
|
1114
|
+
"opacity" ->
|
|
1115
|
+
setOpacity(layer, styleValue)
|
|
1116
|
+
"opacityTransition" ->
|
|
1117
|
+
setOpacityTransition(layer, styleValue)
|
|
1118
|
+
"vignette" ->
|
|
1119
|
+
setVignette(layer, styleValue)
|
|
1120
|
+
"vignetteTransition" ->
|
|
1121
|
+
setVignetteTransition(layer, styleValue)
|
|
1122
|
+
"vignetteColor" ->
|
|
1123
|
+
setVignetteColor(layer, styleValue)
|
|
1124
|
+
"vignetteColorTransition" ->
|
|
1125
|
+
setVignetteColorTransition(layer, styleValue)
|
|
1126
|
+
"centerThinning" ->
|
|
1127
|
+
setCenterThinning(layer, styleValue)
|
|
1128
|
+
"centerThinningTransition" ->
|
|
1129
|
+
setCenterThinningTransition(layer, styleValue)
|
|
1130
|
+
"direction" ->
|
|
1131
|
+
setDirection(layer, styleValue)
|
|
1132
|
+
"directionTransition" ->
|
|
1133
|
+
setDirectionTransition(layer, styleValue)
|
|
1134
|
+
"dropletSize" ->
|
|
1135
|
+
setDropletSize(layer, styleValue)
|
|
1136
|
+
"dropletSizeTransition" ->
|
|
1137
|
+
setDropletSizeTransition(layer, styleValue)
|
|
1138
|
+
"distortionStrength" ->
|
|
1139
|
+
setDistortionStrength(layer, styleValue)
|
|
1140
|
+
"distortionStrengthTransition" ->
|
|
1141
|
+
setDistortionStrengthTransition(layer, styleValue)
|
|
1142
|
+
}
|
|
1143
|
+
} catch (e: MapboxStyleException) {
|
|
1144
|
+
Logger.e(LOG_TAG, "Failed to update: $styleKey ${e.message}")
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1030
1148
|
fun setTerrainLayerStyle(layer: Terrain, style: RNMBXStyle ) {
|
|
1031
1149
|
val styleKeys = style.allStyleKeys
|
|
1032
1150
|
|
|
@@ -1732,6 +1850,32 @@ object RNMBXStyleFactory {
|
|
|
1732
1850
|
}
|
|
1733
1851
|
}
|
|
1734
1852
|
|
|
1853
|
+
fun setLineElevationGroundScale(layer: LineLayer, styleValue: RNMBXStyleValue ) {
|
|
1854
|
+
if (styleValue.isExpression()) {
|
|
1855
|
+
val expression = styleValue.getExpression()
|
|
1856
|
+
if (expression != null) {
|
|
1857
|
+
layer.lineElevationGroundScale(expression)
|
|
1858
|
+
} else {
|
|
1859
|
+
Logger.e("RNMBXLine", "Expression for lineElevationGroundScale is null")
|
|
1860
|
+
}
|
|
1861
|
+
} else {
|
|
1862
|
+
val value = styleValue.getDouble(VALUE_KEY)
|
|
1863
|
+
if (value != null) {
|
|
1864
|
+
layer.lineElevationGroundScale(value)
|
|
1865
|
+
} else {
|
|
1866
|
+
Logger.e("RNMBXLine", "value for lineElevationGroundScale is null")
|
|
1867
|
+
}
|
|
1868
|
+
}
|
|
1869
|
+
}
|
|
1870
|
+
|
|
1871
|
+
|
|
1872
|
+
fun setLineElevationGroundScaleTransition(layer: LineLayer, styleValue: RNMBXStyleValue) {
|
|
1873
|
+
val transition = styleValue.transition
|
|
1874
|
+
if (transition != null) {
|
|
1875
|
+
layer.lineElevationGroundScaleTransition(transition);
|
|
1876
|
+
}
|
|
1877
|
+
}
|
|
1878
|
+
|
|
1735
1879
|
fun setLinePatternCrossFade(layer: LineLayer, styleValue: RNMBXStyleValue ) {
|
|
1736
1880
|
if (styleValue.isExpression()) {
|
|
1737
1881
|
val expression = styleValue.getExpression()
|
|
@@ -5671,6 +5815,500 @@ object RNMBXStyleFactory {
|
|
|
5671
5815
|
}
|
|
5672
5816
|
}
|
|
5673
5817
|
|
|
5818
|
+
fun setDensity(layer: Snow, styleValue: RNMBXStyleValue ) {
|
|
5819
|
+
if (styleValue.isExpression()) {
|
|
5820
|
+
val expression = styleValue.getExpression()
|
|
5821
|
+
if (expression != null) {
|
|
5822
|
+
layer.density(expression)
|
|
5823
|
+
} else {
|
|
5824
|
+
Logger.e("RNMBXSnow", "Expression for density is null")
|
|
5825
|
+
}
|
|
5826
|
+
} else {
|
|
5827
|
+
val value = styleValue.getDouble(VALUE_KEY)
|
|
5828
|
+
if (value != null) {
|
|
5829
|
+
layer.density(value)
|
|
5830
|
+
} else {
|
|
5831
|
+
Logger.e("RNMBXSnow", "value for density is null")
|
|
5832
|
+
}
|
|
5833
|
+
}
|
|
5834
|
+
}
|
|
5835
|
+
|
|
5836
|
+
|
|
5837
|
+
fun setDensityTransition(layer: Snow, styleValue: RNMBXStyleValue) {
|
|
5838
|
+
val transition = styleValue.transition
|
|
5839
|
+
if (transition != null) {
|
|
5840
|
+
layer.densityTransition(transition);
|
|
5841
|
+
}
|
|
5842
|
+
}
|
|
5843
|
+
|
|
5844
|
+
fun setIntensity(layer: Snow, styleValue: RNMBXStyleValue ) {
|
|
5845
|
+
if (styleValue.isExpression()) {
|
|
5846
|
+
val expression = styleValue.getExpression()
|
|
5847
|
+
if (expression != null) {
|
|
5848
|
+
layer.intensity(expression)
|
|
5849
|
+
} else {
|
|
5850
|
+
Logger.e("RNMBXSnow", "Expression for intensity is null")
|
|
5851
|
+
}
|
|
5852
|
+
} else {
|
|
5853
|
+
val value = styleValue.getDouble(VALUE_KEY)
|
|
5854
|
+
if (value != null) {
|
|
5855
|
+
layer.intensity(value)
|
|
5856
|
+
} else {
|
|
5857
|
+
Logger.e("RNMBXSnow", "value for intensity is null")
|
|
5858
|
+
}
|
|
5859
|
+
}
|
|
5860
|
+
}
|
|
5861
|
+
|
|
5862
|
+
|
|
5863
|
+
fun setIntensityTransition(layer: Snow, styleValue: RNMBXStyleValue) {
|
|
5864
|
+
val transition = styleValue.transition
|
|
5865
|
+
if (transition != null) {
|
|
5866
|
+
layer.intensityTransition(transition);
|
|
5867
|
+
}
|
|
5868
|
+
}
|
|
5869
|
+
|
|
5870
|
+
fun setColor(layer: Snow, styleValue: RNMBXStyleValue ) {
|
|
5871
|
+
if (styleValue.isExpression()) {
|
|
5872
|
+
val expression = styleValue.getExpression()
|
|
5873
|
+
if (expression != null) {
|
|
5874
|
+
layer.color(expression)
|
|
5875
|
+
} else {
|
|
5876
|
+
Logger.e("RNMBXSnow", "Expression for color is null")
|
|
5877
|
+
}
|
|
5878
|
+
} else {
|
|
5879
|
+
val value = styleValue.getInt(VALUE_KEY)
|
|
5880
|
+
if (value != null) {
|
|
5881
|
+
layer.color(value)
|
|
5882
|
+
} else {
|
|
5883
|
+
Logger.e("RNMBXSnow", "value for color is null")
|
|
5884
|
+
}
|
|
5885
|
+
}
|
|
5886
|
+
}
|
|
5887
|
+
|
|
5888
|
+
|
|
5889
|
+
fun setColorTransition(layer: Snow, styleValue: RNMBXStyleValue) {
|
|
5890
|
+
val transition = styleValue.transition
|
|
5891
|
+
if (transition != null) {
|
|
5892
|
+
layer.colorTransition(transition);
|
|
5893
|
+
}
|
|
5894
|
+
}
|
|
5895
|
+
|
|
5896
|
+
fun setOpacity(layer: Snow, styleValue: RNMBXStyleValue ) {
|
|
5897
|
+
if (styleValue.isExpression()) {
|
|
5898
|
+
val expression = styleValue.getExpression()
|
|
5899
|
+
if (expression != null) {
|
|
5900
|
+
layer.opacity(expression)
|
|
5901
|
+
} else {
|
|
5902
|
+
Logger.e("RNMBXSnow", "Expression for opacity is null")
|
|
5903
|
+
}
|
|
5904
|
+
} else {
|
|
5905
|
+
val value = styleValue.getDouble(VALUE_KEY)
|
|
5906
|
+
if (value != null) {
|
|
5907
|
+
layer.opacity(value)
|
|
5908
|
+
} else {
|
|
5909
|
+
Logger.e("RNMBXSnow", "value for opacity is null")
|
|
5910
|
+
}
|
|
5911
|
+
}
|
|
5912
|
+
}
|
|
5913
|
+
|
|
5914
|
+
|
|
5915
|
+
fun setOpacityTransition(layer: Snow, styleValue: RNMBXStyleValue) {
|
|
5916
|
+
val transition = styleValue.transition
|
|
5917
|
+
if (transition != null) {
|
|
5918
|
+
layer.opacityTransition(transition);
|
|
5919
|
+
}
|
|
5920
|
+
}
|
|
5921
|
+
|
|
5922
|
+
fun setVignette(layer: Snow, styleValue: RNMBXStyleValue ) {
|
|
5923
|
+
if (styleValue.isExpression()) {
|
|
5924
|
+
val expression = styleValue.getExpression()
|
|
5925
|
+
if (expression != null) {
|
|
5926
|
+
layer.vignette(expression)
|
|
5927
|
+
} else {
|
|
5928
|
+
Logger.e("RNMBXSnow", "Expression for vignette is null")
|
|
5929
|
+
}
|
|
5930
|
+
} else {
|
|
5931
|
+
val value = styleValue.getDouble(VALUE_KEY)
|
|
5932
|
+
if (value != null) {
|
|
5933
|
+
layer.vignette(value)
|
|
5934
|
+
} else {
|
|
5935
|
+
Logger.e("RNMBXSnow", "value for vignette is null")
|
|
5936
|
+
}
|
|
5937
|
+
}
|
|
5938
|
+
}
|
|
5939
|
+
|
|
5940
|
+
|
|
5941
|
+
fun setVignetteTransition(layer: Snow, styleValue: RNMBXStyleValue) {
|
|
5942
|
+
val transition = styleValue.transition
|
|
5943
|
+
if (transition != null) {
|
|
5944
|
+
layer.vignetteTransition(transition);
|
|
5945
|
+
}
|
|
5946
|
+
}
|
|
5947
|
+
|
|
5948
|
+
fun setVignetteColor(layer: Snow, styleValue: RNMBXStyleValue ) {
|
|
5949
|
+
if (styleValue.isExpression()) {
|
|
5950
|
+
val expression = styleValue.getExpression()
|
|
5951
|
+
if (expression != null) {
|
|
5952
|
+
layer.vignetteColor(expression)
|
|
5953
|
+
} else {
|
|
5954
|
+
Logger.e("RNMBXSnow", "Expression for vignetteColor is null")
|
|
5955
|
+
}
|
|
5956
|
+
} else {
|
|
5957
|
+
val value = styleValue.getInt(VALUE_KEY)
|
|
5958
|
+
if (value != null) {
|
|
5959
|
+
layer.vignetteColor(value)
|
|
5960
|
+
} else {
|
|
5961
|
+
Logger.e("RNMBXSnow", "value for vignetteColor is null")
|
|
5962
|
+
}
|
|
5963
|
+
}
|
|
5964
|
+
}
|
|
5965
|
+
|
|
5966
|
+
|
|
5967
|
+
fun setVignetteColorTransition(layer: Snow, styleValue: RNMBXStyleValue) {
|
|
5968
|
+
val transition = styleValue.transition
|
|
5969
|
+
if (transition != null) {
|
|
5970
|
+
layer.vignetteColorTransition(transition);
|
|
5971
|
+
}
|
|
5972
|
+
}
|
|
5973
|
+
|
|
5974
|
+
fun setCenterThinning(layer: Snow, styleValue: RNMBXStyleValue ) {
|
|
5975
|
+
if (styleValue.isExpression()) {
|
|
5976
|
+
val expression = styleValue.getExpression()
|
|
5977
|
+
if (expression != null) {
|
|
5978
|
+
layer.centerThinning(expression)
|
|
5979
|
+
} else {
|
|
5980
|
+
Logger.e("RNMBXSnow", "Expression for centerThinning is null")
|
|
5981
|
+
}
|
|
5982
|
+
} else {
|
|
5983
|
+
val value = styleValue.getDouble(VALUE_KEY)
|
|
5984
|
+
if (value != null) {
|
|
5985
|
+
layer.centerThinning(value)
|
|
5986
|
+
} else {
|
|
5987
|
+
Logger.e("RNMBXSnow", "value for centerThinning is null")
|
|
5988
|
+
}
|
|
5989
|
+
}
|
|
5990
|
+
}
|
|
5991
|
+
|
|
5992
|
+
|
|
5993
|
+
fun setCenterThinningTransition(layer: Snow, styleValue: RNMBXStyleValue) {
|
|
5994
|
+
val transition = styleValue.transition
|
|
5995
|
+
if (transition != null) {
|
|
5996
|
+
layer.centerThinningTransition(transition);
|
|
5997
|
+
}
|
|
5998
|
+
}
|
|
5999
|
+
|
|
6000
|
+
fun setDirection(layer: Snow, styleValue: RNMBXStyleValue ) {
|
|
6001
|
+
if (styleValue.isExpression()) {
|
|
6002
|
+
val expression = styleValue.getExpression()
|
|
6003
|
+
if (expression != null) {
|
|
6004
|
+
layer.direction(expression)
|
|
6005
|
+
} else {
|
|
6006
|
+
Logger.e("RNMBXSnow", "Expression for direction is null")
|
|
6007
|
+
}
|
|
6008
|
+
} else {
|
|
6009
|
+
val value = styleValue.getFloatArray(VALUE_KEY)
|
|
6010
|
+
if (value != null) {
|
|
6011
|
+
layer.direction(value)
|
|
6012
|
+
} else {
|
|
6013
|
+
Logger.e("RNMBXSnow", "value for direction is null")
|
|
6014
|
+
}
|
|
6015
|
+
}
|
|
6016
|
+
}
|
|
6017
|
+
|
|
6018
|
+
|
|
6019
|
+
fun setDirectionTransition(layer: Snow, styleValue: RNMBXStyleValue) {
|
|
6020
|
+
val transition = styleValue.transition
|
|
6021
|
+
if (transition != null) {
|
|
6022
|
+
layer.directionTransition(transition);
|
|
6023
|
+
}
|
|
6024
|
+
}
|
|
6025
|
+
|
|
6026
|
+
fun setFlakeSize(layer: Snow, styleValue: RNMBXStyleValue ) {
|
|
6027
|
+
if (styleValue.isExpression()) {
|
|
6028
|
+
val expression = styleValue.getExpression()
|
|
6029
|
+
if (expression != null) {
|
|
6030
|
+
layer.flakeSize(expression)
|
|
6031
|
+
} else {
|
|
6032
|
+
Logger.e("RNMBXSnow", "Expression for flakeSize is null")
|
|
6033
|
+
}
|
|
6034
|
+
} else {
|
|
6035
|
+
val value = styleValue.getDouble(VALUE_KEY)
|
|
6036
|
+
if (value != null) {
|
|
6037
|
+
layer.flakeSize(value)
|
|
6038
|
+
} else {
|
|
6039
|
+
Logger.e("RNMBXSnow", "value for flakeSize is null")
|
|
6040
|
+
}
|
|
6041
|
+
}
|
|
6042
|
+
}
|
|
6043
|
+
|
|
6044
|
+
|
|
6045
|
+
fun setFlakeSizeTransition(layer: Snow, styleValue: RNMBXStyleValue) {
|
|
6046
|
+
val transition = styleValue.transition
|
|
6047
|
+
if (transition != null) {
|
|
6048
|
+
layer.flakeSizeTransition(transition);
|
|
6049
|
+
}
|
|
6050
|
+
}
|
|
6051
|
+
|
|
6052
|
+
fun setDensity(layer: Rain, styleValue: RNMBXStyleValue ) {
|
|
6053
|
+
if (styleValue.isExpression()) {
|
|
6054
|
+
val expression = styleValue.getExpression()
|
|
6055
|
+
if (expression != null) {
|
|
6056
|
+
layer.density(expression)
|
|
6057
|
+
} else {
|
|
6058
|
+
Logger.e("RNMBXRain", "Expression for density is null")
|
|
6059
|
+
}
|
|
6060
|
+
} else {
|
|
6061
|
+
val value = styleValue.getDouble(VALUE_KEY)
|
|
6062
|
+
if (value != null) {
|
|
6063
|
+
layer.density(value)
|
|
6064
|
+
} else {
|
|
6065
|
+
Logger.e("RNMBXRain", "value for density is null")
|
|
6066
|
+
}
|
|
6067
|
+
}
|
|
6068
|
+
}
|
|
6069
|
+
|
|
6070
|
+
|
|
6071
|
+
fun setDensityTransition(layer: Rain, styleValue: RNMBXStyleValue) {
|
|
6072
|
+
val transition = styleValue.transition
|
|
6073
|
+
if (transition != null) {
|
|
6074
|
+
layer.densityTransition(transition);
|
|
6075
|
+
}
|
|
6076
|
+
}
|
|
6077
|
+
|
|
6078
|
+
fun setIntensity(layer: Rain, styleValue: RNMBXStyleValue ) {
|
|
6079
|
+
if (styleValue.isExpression()) {
|
|
6080
|
+
val expression = styleValue.getExpression()
|
|
6081
|
+
if (expression != null) {
|
|
6082
|
+
layer.intensity(expression)
|
|
6083
|
+
} else {
|
|
6084
|
+
Logger.e("RNMBXRain", "Expression for intensity is null")
|
|
6085
|
+
}
|
|
6086
|
+
} else {
|
|
6087
|
+
val value = styleValue.getDouble(VALUE_KEY)
|
|
6088
|
+
if (value != null) {
|
|
6089
|
+
layer.intensity(value)
|
|
6090
|
+
} else {
|
|
6091
|
+
Logger.e("RNMBXRain", "value for intensity is null")
|
|
6092
|
+
}
|
|
6093
|
+
}
|
|
6094
|
+
}
|
|
6095
|
+
|
|
6096
|
+
|
|
6097
|
+
fun setIntensityTransition(layer: Rain, styleValue: RNMBXStyleValue) {
|
|
6098
|
+
val transition = styleValue.transition
|
|
6099
|
+
if (transition != null) {
|
|
6100
|
+
layer.intensityTransition(transition);
|
|
6101
|
+
}
|
|
6102
|
+
}
|
|
6103
|
+
|
|
6104
|
+
fun setColor(layer: Rain, styleValue: RNMBXStyleValue ) {
|
|
6105
|
+
if (styleValue.isExpression()) {
|
|
6106
|
+
val expression = styleValue.getExpression()
|
|
6107
|
+
if (expression != null) {
|
|
6108
|
+
layer.color(expression)
|
|
6109
|
+
} else {
|
|
6110
|
+
Logger.e("RNMBXRain", "Expression for color is null")
|
|
6111
|
+
}
|
|
6112
|
+
} else {
|
|
6113
|
+
val value = styleValue.getInt(VALUE_KEY)
|
|
6114
|
+
if (value != null) {
|
|
6115
|
+
layer.color(value)
|
|
6116
|
+
} else {
|
|
6117
|
+
Logger.e("RNMBXRain", "value for color is null")
|
|
6118
|
+
}
|
|
6119
|
+
}
|
|
6120
|
+
}
|
|
6121
|
+
|
|
6122
|
+
|
|
6123
|
+
fun setColorTransition(layer: Rain, styleValue: RNMBXStyleValue) {
|
|
6124
|
+
val transition = styleValue.transition
|
|
6125
|
+
if (transition != null) {
|
|
6126
|
+
layer.colorTransition(transition);
|
|
6127
|
+
}
|
|
6128
|
+
}
|
|
6129
|
+
|
|
6130
|
+
fun setOpacity(layer: Rain, styleValue: RNMBXStyleValue ) {
|
|
6131
|
+
if (styleValue.isExpression()) {
|
|
6132
|
+
val expression = styleValue.getExpression()
|
|
6133
|
+
if (expression != null) {
|
|
6134
|
+
layer.opacity(expression)
|
|
6135
|
+
} else {
|
|
6136
|
+
Logger.e("RNMBXRain", "Expression for opacity is null")
|
|
6137
|
+
}
|
|
6138
|
+
} else {
|
|
6139
|
+
val value = styleValue.getDouble(VALUE_KEY)
|
|
6140
|
+
if (value != null) {
|
|
6141
|
+
layer.opacity(value)
|
|
6142
|
+
} else {
|
|
6143
|
+
Logger.e("RNMBXRain", "value for opacity is null")
|
|
6144
|
+
}
|
|
6145
|
+
}
|
|
6146
|
+
}
|
|
6147
|
+
|
|
6148
|
+
|
|
6149
|
+
fun setOpacityTransition(layer: Rain, styleValue: RNMBXStyleValue) {
|
|
6150
|
+
val transition = styleValue.transition
|
|
6151
|
+
if (transition != null) {
|
|
6152
|
+
layer.opacityTransition(transition);
|
|
6153
|
+
}
|
|
6154
|
+
}
|
|
6155
|
+
|
|
6156
|
+
fun setVignette(layer: Rain, styleValue: RNMBXStyleValue ) {
|
|
6157
|
+
if (styleValue.isExpression()) {
|
|
6158
|
+
val expression = styleValue.getExpression()
|
|
6159
|
+
if (expression != null) {
|
|
6160
|
+
layer.vignette(expression)
|
|
6161
|
+
} else {
|
|
6162
|
+
Logger.e("RNMBXRain", "Expression for vignette is null")
|
|
6163
|
+
}
|
|
6164
|
+
} else {
|
|
6165
|
+
val value = styleValue.getDouble(VALUE_KEY)
|
|
6166
|
+
if (value != null) {
|
|
6167
|
+
layer.vignette(value)
|
|
6168
|
+
} else {
|
|
6169
|
+
Logger.e("RNMBXRain", "value for vignette is null")
|
|
6170
|
+
}
|
|
6171
|
+
}
|
|
6172
|
+
}
|
|
6173
|
+
|
|
6174
|
+
|
|
6175
|
+
fun setVignetteTransition(layer: Rain, styleValue: RNMBXStyleValue) {
|
|
6176
|
+
val transition = styleValue.transition
|
|
6177
|
+
if (transition != null) {
|
|
6178
|
+
layer.vignetteTransition(transition);
|
|
6179
|
+
}
|
|
6180
|
+
}
|
|
6181
|
+
|
|
6182
|
+
fun setVignetteColor(layer: Rain, styleValue: RNMBXStyleValue ) {
|
|
6183
|
+
if (styleValue.isExpression()) {
|
|
6184
|
+
val expression = styleValue.getExpression()
|
|
6185
|
+
if (expression != null) {
|
|
6186
|
+
layer.vignetteColor(expression)
|
|
6187
|
+
} else {
|
|
6188
|
+
Logger.e("RNMBXRain", "Expression for vignetteColor is null")
|
|
6189
|
+
}
|
|
6190
|
+
} else {
|
|
6191
|
+
val value = styleValue.getInt(VALUE_KEY)
|
|
6192
|
+
if (value != null) {
|
|
6193
|
+
layer.vignetteColor(value)
|
|
6194
|
+
} else {
|
|
6195
|
+
Logger.e("RNMBXRain", "value for vignetteColor is null")
|
|
6196
|
+
}
|
|
6197
|
+
}
|
|
6198
|
+
}
|
|
6199
|
+
|
|
6200
|
+
|
|
6201
|
+
fun setVignetteColorTransition(layer: Rain, styleValue: RNMBXStyleValue) {
|
|
6202
|
+
val transition = styleValue.transition
|
|
6203
|
+
if (transition != null) {
|
|
6204
|
+
layer.vignetteColorTransition(transition);
|
|
6205
|
+
}
|
|
6206
|
+
}
|
|
6207
|
+
|
|
6208
|
+
fun setCenterThinning(layer: Rain, styleValue: RNMBXStyleValue ) {
|
|
6209
|
+
if (styleValue.isExpression()) {
|
|
6210
|
+
val expression = styleValue.getExpression()
|
|
6211
|
+
if (expression != null) {
|
|
6212
|
+
layer.centerThinning(expression)
|
|
6213
|
+
} else {
|
|
6214
|
+
Logger.e("RNMBXRain", "Expression for centerThinning is null")
|
|
6215
|
+
}
|
|
6216
|
+
} else {
|
|
6217
|
+
val value = styleValue.getDouble(VALUE_KEY)
|
|
6218
|
+
if (value != null) {
|
|
6219
|
+
layer.centerThinning(value)
|
|
6220
|
+
} else {
|
|
6221
|
+
Logger.e("RNMBXRain", "value for centerThinning is null")
|
|
6222
|
+
}
|
|
6223
|
+
}
|
|
6224
|
+
}
|
|
6225
|
+
|
|
6226
|
+
|
|
6227
|
+
fun setCenterThinningTransition(layer: Rain, styleValue: RNMBXStyleValue) {
|
|
6228
|
+
val transition = styleValue.transition
|
|
6229
|
+
if (transition != null) {
|
|
6230
|
+
layer.centerThinningTransition(transition);
|
|
6231
|
+
}
|
|
6232
|
+
}
|
|
6233
|
+
|
|
6234
|
+
fun setDirection(layer: Rain, styleValue: RNMBXStyleValue ) {
|
|
6235
|
+
if (styleValue.isExpression()) {
|
|
6236
|
+
val expression = styleValue.getExpression()
|
|
6237
|
+
if (expression != null) {
|
|
6238
|
+
layer.direction(expression)
|
|
6239
|
+
} else {
|
|
6240
|
+
Logger.e("RNMBXRain", "Expression for direction is null")
|
|
6241
|
+
}
|
|
6242
|
+
} else {
|
|
6243
|
+
val value = styleValue.getFloatArray(VALUE_KEY)
|
|
6244
|
+
if (value != null) {
|
|
6245
|
+
layer.direction(value)
|
|
6246
|
+
} else {
|
|
6247
|
+
Logger.e("RNMBXRain", "value for direction is null")
|
|
6248
|
+
}
|
|
6249
|
+
}
|
|
6250
|
+
}
|
|
6251
|
+
|
|
6252
|
+
|
|
6253
|
+
fun setDirectionTransition(layer: Rain, styleValue: RNMBXStyleValue) {
|
|
6254
|
+
val transition = styleValue.transition
|
|
6255
|
+
if (transition != null) {
|
|
6256
|
+
layer.directionTransition(transition);
|
|
6257
|
+
}
|
|
6258
|
+
}
|
|
6259
|
+
|
|
6260
|
+
fun setDropletSize(layer: Rain, styleValue: RNMBXStyleValue ) {
|
|
6261
|
+
if (styleValue.isExpression()) {
|
|
6262
|
+
val expression = styleValue.getExpression()
|
|
6263
|
+
if (expression != null) {
|
|
6264
|
+
layer.dropletSize(expression)
|
|
6265
|
+
} else {
|
|
6266
|
+
Logger.e("RNMBXRain", "Expression for dropletSize is null")
|
|
6267
|
+
}
|
|
6268
|
+
} else {
|
|
6269
|
+
val value = styleValue.getFloatArray(VALUE_KEY)
|
|
6270
|
+
if (value != null) {
|
|
6271
|
+
layer.dropletSize(value)
|
|
6272
|
+
} else {
|
|
6273
|
+
Logger.e("RNMBXRain", "value for dropletSize is null")
|
|
6274
|
+
}
|
|
6275
|
+
}
|
|
6276
|
+
}
|
|
6277
|
+
|
|
6278
|
+
|
|
6279
|
+
fun setDropletSizeTransition(layer: Rain, styleValue: RNMBXStyleValue) {
|
|
6280
|
+
val transition = styleValue.transition
|
|
6281
|
+
if (transition != null) {
|
|
6282
|
+
layer.dropletSizeTransition(transition);
|
|
6283
|
+
}
|
|
6284
|
+
}
|
|
6285
|
+
|
|
6286
|
+
fun setDistortionStrength(layer: Rain, styleValue: RNMBXStyleValue ) {
|
|
6287
|
+
if (styleValue.isExpression()) {
|
|
6288
|
+
val expression = styleValue.getExpression()
|
|
6289
|
+
if (expression != null) {
|
|
6290
|
+
layer.distortionStrength(expression)
|
|
6291
|
+
} else {
|
|
6292
|
+
Logger.e("RNMBXRain", "Expression for distortionStrength is null")
|
|
6293
|
+
}
|
|
6294
|
+
} else {
|
|
6295
|
+
val value = styleValue.getDouble(VALUE_KEY)
|
|
6296
|
+
if (value != null) {
|
|
6297
|
+
layer.distortionStrength(value)
|
|
6298
|
+
} else {
|
|
6299
|
+
Logger.e("RNMBXRain", "value for distortionStrength is null")
|
|
6300
|
+
}
|
|
6301
|
+
}
|
|
6302
|
+
}
|
|
6303
|
+
|
|
6304
|
+
|
|
6305
|
+
fun setDistortionStrengthTransition(layer: Rain, styleValue: RNMBXStyleValue) {
|
|
6306
|
+
val transition = styleValue.transition
|
|
6307
|
+
if (transition != null) {
|
|
6308
|
+
layer.distortionStrengthTransition(transition);
|
|
6309
|
+
}
|
|
6310
|
+
}
|
|
6311
|
+
|
|
5674
6312
|
fun setExaggeration(layer: Terrain, styleValue: RNMBXStyleValue ) {
|
|
5675
6313
|
if (styleValue.isExpression()) {
|
|
5676
6314
|
val expression = styleValue.getExpression()
|