@maplibre/maplibre-react-native 11.0.0-beta.30 → 11.0.0-beta.31

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.
Files changed (21) hide show
  1. package/android/src/main/java/org/maplibre/reactnative/components/layer/MLRNLayer.kt +8 -8
  2. package/android/src/main/java/org/maplibre/reactnative/components/layer/style/MLRNStyle.kt +60 -0
  3. package/android/src/main/java/org/maplibre/reactnative/components/layer/style/MLRNStyleFactory.kt +3005 -0
  4. package/android/src/main/java/org/maplibre/reactnative/components/layer/style/MLRNStyleValue.kt +159 -0
  5. package/android/src/main/java/org/maplibre/reactnative/components/mapview/MLRNMapView.kt +3 -1
  6. package/ios/components/layer/style/MLRNStyle.h +1 -1
  7. package/ios/components/layer/style/MLRNStyle.m +1 -1
  8. package/lib/commonjs/utils/getStylePropertyType.js +1 -1
  9. package/lib/module/utils/getStylePropertyType.js +1 -1
  10. package/lib/typescript/commonjs/types/MapLibreRNStyles.d.ts +92 -59
  11. package/lib/typescript/commonjs/types/MapLibreRNStyles.d.ts.map +1 -1
  12. package/lib/typescript/module/types/MapLibreRNStyles.d.ts +92 -59
  13. package/lib/typescript/module/types/MapLibreRNStyles.d.ts.map +1 -1
  14. package/package.json +1 -1
  15. package/src/types/MapLibreRNStyles.ts +102 -119
  16. package/src/utils/getStylePropertyType.ts +1 -1
  17. package/android/src/main/java/org/maplibre/reactnative/components/layer/style/MLRNStyle.java +0 -76
  18. package/android/src/main/java/org/maplibre/reactnative/components/layer/style/MLRNStyleFactory.java +0 -2285
  19. package/android/src/main/java/org/maplibre/reactnative/components/layer/style/MLRNStyleFunctionParser.java +0 -94
  20. package/android/src/main/java/org/maplibre/reactnative/components/layer/style/MLRNStyleValue.java +0 -207
  21. package/android/src/main/java/org/maplibre/reactnative/events/AndroidCallbackEvent.java +0 -34
@@ -0,0 +1,3005 @@
1
+ // DO NOT MODIFY
2
+ // This file is auto-generated from scripts/src/templates/renderMLRNStyleFactory.ts
3
+ package org.maplibre.reactnative.components.layer.style
4
+
5
+ import org.maplibre.android.style.layers.BackgroundLayer
6
+ import org.maplibre.android.style.layers.CircleLayer
7
+ import org.maplibre.android.style.layers.FillExtrusionLayer
8
+ import org.maplibre.android.style.layers.FillLayer
9
+ import org.maplibre.android.style.layers.HeatmapLayer
10
+ import org.maplibre.android.style.layers.HillshadeLayer
11
+ import org.maplibre.android.style.layers.LineLayer
12
+ import org.maplibre.android.style.layers.PropertyFactory
13
+ import org.maplibre.android.style.layers.RasterLayer
14
+ import org.maplibre.android.style.layers.SymbolLayer
15
+ import org.maplibre.android.style.light.Light
16
+ import org.maplibre.android.style.light.Position
17
+
18
+ object MLRNStyleFactory {
19
+ const val VALUE_KEY: String = "value"
20
+
21
+ fun setFillLayerStyle(
22
+ layer: FillLayer,
23
+ style: MLRNStyle,
24
+ ) {
25
+ val styleKeys = style.allStyleKeys
26
+
27
+ if (styleKeys.isEmpty()) {
28
+ return
29
+ }
30
+
31
+ for (styleKey in styleKeys) {
32
+ val styleValue = style.getStyleValueForKey(styleKey)
33
+
34
+ when (styleKey) {
35
+ "fillSortKey" -> {
36
+ setFillSortKey(layer, styleValue)
37
+ }
38
+
39
+ "visibility" -> {
40
+ setVisibility(layer, styleValue)
41
+ }
42
+
43
+ "fillAntialias" -> {
44
+ setFillAntialias(layer, styleValue)
45
+ }
46
+
47
+ "fillOpacity" -> {
48
+ setFillOpacity(layer, styleValue)
49
+ }
50
+
51
+ "fillOpacityTransition" -> {
52
+ setFillOpacityTransition(layer, styleValue)
53
+ }
54
+
55
+ "fillColor" -> {
56
+ setFillColor(layer, styleValue)
57
+ }
58
+
59
+ "fillColorTransition" -> {
60
+ setFillColorTransition(layer, styleValue)
61
+ }
62
+
63
+ "fillOutlineColor" -> {
64
+ setFillOutlineColor(layer, styleValue)
65
+ }
66
+
67
+ "fillOutlineColorTransition" -> {
68
+ setFillOutlineColorTransition(layer, styleValue)
69
+ }
70
+
71
+ "fillTranslate" -> {
72
+ setFillTranslate(layer, styleValue)
73
+ }
74
+
75
+ "fillTranslateTransition" -> {
76
+ setFillTranslateTransition(layer, styleValue)
77
+ }
78
+
79
+ "fillTranslateAnchor" -> {
80
+ setFillTranslateAnchor(layer, styleValue)
81
+ }
82
+
83
+ "fillPattern" -> {
84
+ style.addImage(
85
+ styleValue,
86
+ ) { setFillPattern(layer, styleValue) }
87
+ }
88
+
89
+ "fillPatternTransition" -> {
90
+ setFillPatternTransition(layer, styleValue)
91
+ }
92
+ }
93
+ }
94
+ }
95
+
96
+ fun setLineLayerStyle(
97
+ layer: LineLayer,
98
+ style: MLRNStyle,
99
+ ) {
100
+ val styleKeys = style.allStyleKeys
101
+
102
+ if (styleKeys.isEmpty()) {
103
+ return
104
+ }
105
+
106
+ for (styleKey in styleKeys) {
107
+ val styleValue = style.getStyleValueForKey(styleKey)
108
+
109
+ when (styleKey) {
110
+ "lineCap" -> {
111
+ setLineCap(layer, styleValue)
112
+ }
113
+
114
+ "lineJoin" -> {
115
+ setLineJoin(layer, styleValue)
116
+ }
117
+
118
+ "lineMiterLimit" -> {
119
+ setLineMiterLimit(layer, styleValue)
120
+ }
121
+
122
+ "lineRoundLimit" -> {
123
+ setLineRoundLimit(layer, styleValue)
124
+ }
125
+
126
+ "lineSortKey" -> {
127
+ setLineSortKey(layer, styleValue)
128
+ }
129
+
130
+ "visibility" -> {
131
+ setVisibility(layer, styleValue)
132
+ }
133
+
134
+ "lineOpacity" -> {
135
+ setLineOpacity(layer, styleValue)
136
+ }
137
+
138
+ "lineOpacityTransition" -> {
139
+ setLineOpacityTransition(layer, styleValue)
140
+ }
141
+
142
+ "lineColor" -> {
143
+ setLineColor(layer, styleValue)
144
+ }
145
+
146
+ "lineColorTransition" -> {
147
+ setLineColorTransition(layer, styleValue)
148
+ }
149
+
150
+ "lineTranslate" -> {
151
+ setLineTranslate(layer, styleValue)
152
+ }
153
+
154
+ "lineTranslateTransition" -> {
155
+ setLineTranslateTransition(layer, styleValue)
156
+ }
157
+
158
+ "lineTranslateAnchor" -> {
159
+ setLineTranslateAnchor(layer, styleValue)
160
+ }
161
+
162
+ "lineWidth" -> {
163
+ setLineWidth(layer, styleValue)
164
+ }
165
+
166
+ "lineWidthTransition" -> {
167
+ setLineWidthTransition(layer, styleValue)
168
+ }
169
+
170
+ "lineGapWidth" -> {
171
+ setLineGapWidth(layer, styleValue)
172
+ }
173
+
174
+ "lineGapWidthTransition" -> {
175
+ setLineGapWidthTransition(layer, styleValue)
176
+ }
177
+
178
+ "lineOffset" -> {
179
+ setLineOffset(layer, styleValue)
180
+ }
181
+
182
+ "lineOffsetTransition" -> {
183
+ setLineOffsetTransition(layer, styleValue)
184
+ }
185
+
186
+ "lineBlur" -> {
187
+ setLineBlur(layer, styleValue)
188
+ }
189
+
190
+ "lineBlurTransition" -> {
191
+ setLineBlurTransition(layer, styleValue)
192
+ }
193
+
194
+ "lineDasharray" -> {
195
+ setLineDasharray(layer, styleValue)
196
+ }
197
+
198
+ "lineDasharrayTransition" -> {
199
+ setLineDasharrayTransition(layer, styleValue)
200
+ }
201
+
202
+ "linePattern" -> {
203
+ style.addImage(
204
+ styleValue,
205
+ ) { setLinePattern(layer, styleValue) }
206
+ }
207
+
208
+ "linePatternTransition" -> {
209
+ setLinePatternTransition(layer, styleValue)
210
+ }
211
+
212
+ "lineGradient" -> {
213
+ setLineGradient(layer, styleValue)
214
+ }
215
+ }
216
+ }
217
+ }
218
+
219
+ fun setSymbolLayerStyle(
220
+ layer: SymbolLayer,
221
+ style: MLRNStyle,
222
+ ) {
223
+ val styleKeys = style.allStyleKeys
224
+
225
+ if (styleKeys.isEmpty()) {
226
+ return
227
+ }
228
+
229
+ for (styleKey in styleKeys) {
230
+ val styleValue = style.getStyleValueForKey(styleKey)
231
+
232
+ when (styleKey) {
233
+ "symbolPlacement" -> {
234
+ setSymbolPlacement(layer, styleValue)
235
+ }
236
+
237
+ "symbolSpacing" -> {
238
+ setSymbolSpacing(layer, styleValue)
239
+ }
240
+
241
+ "symbolAvoidEdges" -> {
242
+ setSymbolAvoidEdges(layer, styleValue)
243
+ }
244
+
245
+ "symbolSortKey" -> {
246
+ setSymbolSortKey(layer, styleValue)
247
+ }
248
+
249
+ "symbolZOrder" -> {
250
+ setSymbolZOrder(layer, styleValue)
251
+ }
252
+
253
+ "iconAllowOverlap" -> {
254
+ setIconAllowOverlap(layer, styleValue)
255
+ }
256
+
257
+ "iconIgnorePlacement" -> {
258
+ setIconIgnorePlacement(layer, styleValue)
259
+ }
260
+
261
+ "iconOptional" -> {
262
+ setIconOptional(layer, styleValue)
263
+ }
264
+
265
+ "iconRotationAlignment" -> {
266
+ setIconRotationAlignment(layer, styleValue)
267
+ }
268
+
269
+ "iconSize" -> {
270
+ setIconSize(layer, styleValue)
271
+ }
272
+
273
+ "iconTextFit" -> {
274
+ setIconTextFit(layer, styleValue)
275
+ }
276
+
277
+ "iconTextFitPadding" -> {
278
+ setIconTextFitPadding(layer, styleValue)
279
+ }
280
+
281
+ "iconImage" -> {
282
+ style.addImage(
283
+ styleValue,
284
+ ) { setIconImage(layer, styleValue) }
285
+ }
286
+
287
+ "iconRotate" -> {
288
+ setIconRotate(layer, styleValue)
289
+ }
290
+
291
+ "iconPadding" -> {
292
+ setIconPadding(layer, styleValue)
293
+ }
294
+
295
+ "iconKeepUpright" -> {
296
+ setIconKeepUpright(layer, styleValue)
297
+ }
298
+
299
+ "iconOffset" -> {
300
+ setIconOffset(layer, styleValue)
301
+ }
302
+
303
+ "iconAnchor" -> {
304
+ setIconAnchor(layer, styleValue)
305
+ }
306
+
307
+ "iconPitchAlignment" -> {
308
+ setIconPitchAlignment(layer, styleValue)
309
+ }
310
+
311
+ "textPitchAlignment" -> {
312
+ setTextPitchAlignment(layer, styleValue)
313
+ }
314
+
315
+ "textRotationAlignment" -> {
316
+ setTextRotationAlignment(layer, styleValue)
317
+ }
318
+
319
+ "textField" -> {
320
+ setTextField(layer, styleValue)
321
+ }
322
+
323
+ "textFont" -> {
324
+ setTextFont(layer, styleValue)
325
+ }
326
+
327
+ "textSize" -> {
328
+ setTextSize(layer, styleValue)
329
+ }
330
+
331
+ "textMaxWidth" -> {
332
+ setTextMaxWidth(layer, styleValue)
333
+ }
334
+
335
+ "textLineHeight" -> {
336
+ setTextLineHeight(layer, styleValue)
337
+ }
338
+
339
+ "textLetterSpacing" -> {
340
+ setTextLetterSpacing(layer, styleValue)
341
+ }
342
+
343
+ "textJustify" -> {
344
+ setTextJustify(layer, styleValue)
345
+ }
346
+
347
+ "textRadialOffset" -> {
348
+ setTextRadialOffset(layer, styleValue)
349
+ }
350
+
351
+ "textVariableAnchor" -> {
352
+ setTextVariableAnchor(layer, styleValue)
353
+ }
354
+
355
+ "textAnchor" -> {
356
+ setTextAnchor(layer, styleValue)
357
+ }
358
+
359
+ "textMaxAngle" -> {
360
+ setTextMaxAngle(layer, styleValue)
361
+ }
362
+
363
+ "textWritingMode" -> {
364
+ setTextWritingMode(layer, styleValue)
365
+ }
366
+
367
+ "textRotate" -> {
368
+ setTextRotate(layer, styleValue)
369
+ }
370
+
371
+ "textPadding" -> {
372
+ setTextPadding(layer, styleValue)
373
+ }
374
+
375
+ "textKeepUpright" -> {
376
+ setTextKeepUpright(layer, styleValue)
377
+ }
378
+
379
+ "textTransform" -> {
380
+ setTextTransform(layer, styleValue)
381
+ }
382
+
383
+ "textOffset" -> {
384
+ setTextOffset(layer, styleValue)
385
+ }
386
+
387
+ "textAllowOverlap" -> {
388
+ setTextAllowOverlap(layer, styleValue)
389
+ }
390
+
391
+ "textIgnorePlacement" -> {
392
+ setTextIgnorePlacement(layer, styleValue)
393
+ }
394
+
395
+ "textOptional" -> {
396
+ setTextOptional(layer, styleValue)
397
+ }
398
+
399
+ "visibility" -> {
400
+ setVisibility(layer, styleValue)
401
+ }
402
+
403
+ "iconOpacity" -> {
404
+ setIconOpacity(layer, styleValue)
405
+ }
406
+
407
+ "iconOpacityTransition" -> {
408
+ setIconOpacityTransition(layer, styleValue)
409
+ }
410
+
411
+ "iconColor" -> {
412
+ setIconColor(layer, styleValue)
413
+ }
414
+
415
+ "iconColorTransition" -> {
416
+ setIconColorTransition(layer, styleValue)
417
+ }
418
+
419
+ "iconHaloColor" -> {
420
+ setIconHaloColor(layer, styleValue)
421
+ }
422
+
423
+ "iconHaloColorTransition" -> {
424
+ setIconHaloColorTransition(layer, styleValue)
425
+ }
426
+
427
+ "iconHaloWidth" -> {
428
+ setIconHaloWidth(layer, styleValue)
429
+ }
430
+
431
+ "iconHaloWidthTransition" -> {
432
+ setIconHaloWidthTransition(layer, styleValue)
433
+ }
434
+
435
+ "iconHaloBlur" -> {
436
+ setIconHaloBlur(layer, styleValue)
437
+ }
438
+
439
+ "iconHaloBlurTransition" -> {
440
+ setIconHaloBlurTransition(layer, styleValue)
441
+ }
442
+
443
+ "iconTranslate" -> {
444
+ setIconTranslate(layer, styleValue)
445
+ }
446
+
447
+ "iconTranslateTransition" -> {
448
+ setIconTranslateTransition(layer, styleValue)
449
+ }
450
+
451
+ "iconTranslateAnchor" -> {
452
+ setIconTranslateAnchor(layer, styleValue)
453
+ }
454
+
455
+ "textOpacity" -> {
456
+ setTextOpacity(layer, styleValue)
457
+ }
458
+
459
+ "textOpacityTransition" -> {
460
+ setTextOpacityTransition(layer, styleValue)
461
+ }
462
+
463
+ "textColor" -> {
464
+ setTextColor(layer, styleValue)
465
+ }
466
+
467
+ "textColorTransition" -> {
468
+ setTextColorTransition(layer, styleValue)
469
+ }
470
+
471
+ "textHaloColor" -> {
472
+ setTextHaloColor(layer, styleValue)
473
+ }
474
+
475
+ "textHaloColorTransition" -> {
476
+ setTextHaloColorTransition(layer, styleValue)
477
+ }
478
+
479
+ "textHaloWidth" -> {
480
+ setTextHaloWidth(layer, styleValue)
481
+ }
482
+
483
+ "textHaloWidthTransition" -> {
484
+ setTextHaloWidthTransition(layer, styleValue)
485
+ }
486
+
487
+ "textHaloBlur" -> {
488
+ setTextHaloBlur(layer, styleValue)
489
+ }
490
+
491
+ "textHaloBlurTransition" -> {
492
+ setTextHaloBlurTransition(layer, styleValue)
493
+ }
494
+
495
+ "textTranslate" -> {
496
+ setTextTranslate(layer, styleValue)
497
+ }
498
+
499
+ "textTranslateTransition" -> {
500
+ setTextTranslateTransition(layer, styleValue)
501
+ }
502
+
503
+ "textTranslateAnchor" -> {
504
+ setTextTranslateAnchor(layer, styleValue)
505
+ }
506
+ }
507
+ }
508
+ }
509
+
510
+ fun setCircleLayerStyle(
511
+ layer: CircleLayer,
512
+ style: MLRNStyle,
513
+ ) {
514
+ val styleKeys = style.allStyleKeys
515
+
516
+ if (styleKeys.isEmpty()) {
517
+ return
518
+ }
519
+
520
+ for (styleKey in styleKeys) {
521
+ val styleValue = style.getStyleValueForKey(styleKey)
522
+
523
+ when (styleKey) {
524
+ "circleSortKey" -> {
525
+ setCircleSortKey(layer, styleValue)
526
+ }
527
+
528
+ "visibility" -> {
529
+ setVisibility(layer, styleValue)
530
+ }
531
+
532
+ "circleRadius" -> {
533
+ setCircleRadius(layer, styleValue)
534
+ }
535
+
536
+ "circleRadiusTransition" -> {
537
+ setCircleRadiusTransition(layer, styleValue)
538
+ }
539
+
540
+ "circleColor" -> {
541
+ setCircleColor(layer, styleValue)
542
+ }
543
+
544
+ "circleColorTransition" -> {
545
+ setCircleColorTransition(layer, styleValue)
546
+ }
547
+
548
+ "circleBlur" -> {
549
+ setCircleBlur(layer, styleValue)
550
+ }
551
+
552
+ "circleBlurTransition" -> {
553
+ setCircleBlurTransition(layer, styleValue)
554
+ }
555
+
556
+ "circleOpacity" -> {
557
+ setCircleOpacity(layer, styleValue)
558
+ }
559
+
560
+ "circleOpacityTransition" -> {
561
+ setCircleOpacityTransition(layer, styleValue)
562
+ }
563
+
564
+ "circleTranslate" -> {
565
+ setCircleTranslate(layer, styleValue)
566
+ }
567
+
568
+ "circleTranslateTransition" -> {
569
+ setCircleTranslateTransition(layer, styleValue)
570
+ }
571
+
572
+ "circleTranslateAnchor" -> {
573
+ setCircleTranslateAnchor(layer, styleValue)
574
+ }
575
+
576
+ "circlePitchScale" -> {
577
+ setCirclePitchScale(layer, styleValue)
578
+ }
579
+
580
+ "circlePitchAlignment" -> {
581
+ setCirclePitchAlignment(layer, styleValue)
582
+ }
583
+
584
+ "circleStrokeWidth" -> {
585
+ setCircleStrokeWidth(layer, styleValue)
586
+ }
587
+
588
+ "circleStrokeWidthTransition" -> {
589
+ setCircleStrokeWidthTransition(layer, styleValue)
590
+ }
591
+
592
+ "circleStrokeColor" -> {
593
+ setCircleStrokeColor(layer, styleValue)
594
+ }
595
+
596
+ "circleStrokeColorTransition" -> {
597
+ setCircleStrokeColorTransition(layer, styleValue)
598
+ }
599
+
600
+ "circleStrokeOpacity" -> {
601
+ setCircleStrokeOpacity(layer, styleValue)
602
+ }
603
+
604
+ "circleStrokeOpacityTransition" -> {
605
+ setCircleStrokeOpacityTransition(layer, styleValue)
606
+ }
607
+ }
608
+ }
609
+ }
610
+
611
+ fun setHeatmapLayerStyle(
612
+ layer: HeatmapLayer,
613
+ style: MLRNStyle,
614
+ ) {
615
+ val styleKeys = style.allStyleKeys
616
+
617
+ if (styleKeys.isEmpty()) {
618
+ return
619
+ }
620
+
621
+ for (styleKey in styleKeys) {
622
+ val styleValue = style.getStyleValueForKey(styleKey)
623
+
624
+ when (styleKey) {
625
+ "visibility" -> {
626
+ setVisibility(layer, styleValue)
627
+ }
628
+
629
+ "heatmapRadius" -> {
630
+ setHeatmapRadius(layer, styleValue)
631
+ }
632
+
633
+ "heatmapRadiusTransition" -> {
634
+ setHeatmapRadiusTransition(layer, styleValue)
635
+ }
636
+
637
+ "heatmapWeight" -> {
638
+ setHeatmapWeight(layer, styleValue)
639
+ }
640
+
641
+ "heatmapIntensity" -> {
642
+ setHeatmapIntensity(layer, styleValue)
643
+ }
644
+
645
+ "heatmapIntensityTransition" -> {
646
+ setHeatmapIntensityTransition(layer, styleValue)
647
+ }
648
+
649
+ "heatmapColor" -> {
650
+ setHeatmapColor(layer, styleValue)
651
+ }
652
+
653
+ "heatmapOpacity" -> {
654
+ setHeatmapOpacity(layer, styleValue)
655
+ }
656
+
657
+ "heatmapOpacityTransition" -> {
658
+ setHeatmapOpacityTransition(layer, styleValue)
659
+ }
660
+ }
661
+ }
662
+ }
663
+
664
+ fun setFillExtrusionLayerStyle(
665
+ layer: FillExtrusionLayer,
666
+ style: MLRNStyle,
667
+ ) {
668
+ val styleKeys = style.allStyleKeys
669
+
670
+ if (styleKeys.isEmpty()) {
671
+ return
672
+ }
673
+
674
+ for (styleKey in styleKeys) {
675
+ val styleValue = style.getStyleValueForKey(styleKey)
676
+
677
+ when (styleKey) {
678
+ "visibility" -> {
679
+ setVisibility(layer, styleValue)
680
+ }
681
+
682
+ "fillExtrusionOpacity" -> {
683
+ setFillExtrusionOpacity(layer, styleValue)
684
+ }
685
+
686
+ "fillExtrusionOpacityTransition" -> {
687
+ setFillExtrusionOpacityTransition(layer, styleValue)
688
+ }
689
+
690
+ "fillExtrusionColor" -> {
691
+ setFillExtrusionColor(layer, styleValue)
692
+ }
693
+
694
+ "fillExtrusionColorTransition" -> {
695
+ setFillExtrusionColorTransition(layer, styleValue)
696
+ }
697
+
698
+ "fillExtrusionTranslate" -> {
699
+ setFillExtrusionTranslate(layer, styleValue)
700
+ }
701
+
702
+ "fillExtrusionTranslateTransition" -> {
703
+ setFillExtrusionTranslateTransition(layer, styleValue)
704
+ }
705
+
706
+ "fillExtrusionTranslateAnchor" -> {
707
+ setFillExtrusionTranslateAnchor(layer, styleValue)
708
+ }
709
+
710
+ "fillExtrusionPattern" -> {
711
+ style.addImage(
712
+ styleValue,
713
+ ) { setFillExtrusionPattern(layer, styleValue) }
714
+ }
715
+
716
+ "fillExtrusionPatternTransition" -> {
717
+ setFillExtrusionPatternTransition(layer, styleValue)
718
+ }
719
+
720
+ "fillExtrusionHeight" -> {
721
+ setFillExtrusionHeight(layer, styleValue)
722
+ }
723
+
724
+ "fillExtrusionHeightTransition" -> {
725
+ setFillExtrusionHeightTransition(layer, styleValue)
726
+ }
727
+
728
+ "fillExtrusionBase" -> {
729
+ setFillExtrusionBase(layer, styleValue)
730
+ }
731
+
732
+ "fillExtrusionBaseTransition" -> {
733
+ setFillExtrusionBaseTransition(layer, styleValue)
734
+ }
735
+
736
+ "fillExtrusionVerticalGradient" -> {
737
+ setFillExtrusionVerticalGradient(layer, styleValue)
738
+ }
739
+ }
740
+ }
741
+ }
742
+
743
+ fun setRasterLayerStyle(
744
+ layer: RasterLayer,
745
+ style: MLRNStyle,
746
+ ) {
747
+ val styleKeys = style.allStyleKeys
748
+
749
+ if (styleKeys.isEmpty()) {
750
+ return
751
+ }
752
+
753
+ for (styleKey in styleKeys) {
754
+ val styleValue = style.getStyleValueForKey(styleKey)
755
+
756
+ when (styleKey) {
757
+ "visibility" -> {
758
+ setVisibility(layer, styleValue)
759
+ }
760
+
761
+ "rasterOpacity" -> {
762
+ setRasterOpacity(layer, styleValue)
763
+ }
764
+
765
+ "rasterOpacityTransition" -> {
766
+ setRasterOpacityTransition(layer, styleValue)
767
+ }
768
+
769
+ "rasterHueRotate" -> {
770
+ setRasterHueRotate(layer, styleValue)
771
+ }
772
+
773
+ "rasterHueRotateTransition" -> {
774
+ setRasterHueRotateTransition(layer, styleValue)
775
+ }
776
+
777
+ "rasterBrightnessMin" -> {
778
+ setRasterBrightnessMin(layer, styleValue)
779
+ }
780
+
781
+ "rasterBrightnessMinTransition" -> {
782
+ setRasterBrightnessMinTransition(layer, styleValue)
783
+ }
784
+
785
+ "rasterBrightnessMax" -> {
786
+ setRasterBrightnessMax(layer, styleValue)
787
+ }
788
+
789
+ "rasterBrightnessMaxTransition" -> {
790
+ setRasterBrightnessMaxTransition(layer, styleValue)
791
+ }
792
+
793
+ "rasterSaturation" -> {
794
+ setRasterSaturation(layer, styleValue)
795
+ }
796
+
797
+ "rasterSaturationTransition" -> {
798
+ setRasterSaturationTransition(layer, styleValue)
799
+ }
800
+
801
+ "rasterContrast" -> {
802
+ setRasterContrast(layer, styleValue)
803
+ }
804
+
805
+ "rasterContrastTransition" -> {
806
+ setRasterContrastTransition(layer, styleValue)
807
+ }
808
+
809
+ "rasterResampling" -> {
810
+ setRasterResampling(layer, styleValue)
811
+ }
812
+
813
+ "rasterFadeDuration" -> {
814
+ setRasterFadeDuration(layer, styleValue)
815
+ }
816
+ }
817
+ }
818
+ }
819
+
820
+ fun setHillshadeLayerStyle(
821
+ layer: HillshadeLayer,
822
+ style: MLRNStyle,
823
+ ) {
824
+ val styleKeys = style.allStyleKeys
825
+
826
+ if (styleKeys.isEmpty()) {
827
+ return
828
+ }
829
+
830
+ for (styleKey in styleKeys) {
831
+ val styleValue = style.getStyleValueForKey(styleKey)
832
+
833
+ when (styleKey) {
834
+ "visibility" -> {
835
+ setVisibility(layer, styleValue)
836
+ }
837
+
838
+ "hillshadeIlluminationDirection" -> {
839
+ setHillshadeIlluminationDirection(layer, styleValue)
840
+ }
841
+
842
+ "hillshadeIlluminationAnchor" -> {
843
+ setHillshadeIlluminationAnchor(layer, styleValue)
844
+ }
845
+
846
+ "hillshadeExaggeration" -> {
847
+ setHillshadeExaggeration(layer, styleValue)
848
+ }
849
+
850
+ "hillshadeExaggerationTransition" -> {
851
+ setHillshadeExaggerationTransition(layer, styleValue)
852
+ }
853
+
854
+ "hillshadeShadowColor" -> {
855
+ setHillshadeShadowColor(layer, styleValue)
856
+ }
857
+
858
+ "hillshadeShadowColorTransition" -> {
859
+ setHillshadeShadowColorTransition(layer, styleValue)
860
+ }
861
+
862
+ "hillshadeHighlightColor" -> {
863
+ setHillshadeHighlightColor(layer, styleValue)
864
+ }
865
+
866
+ "hillshadeHighlightColorTransition" -> {
867
+ setHillshadeHighlightColorTransition(layer, styleValue)
868
+ }
869
+
870
+ "hillshadeAccentColor" -> {
871
+ setHillshadeAccentColor(layer, styleValue)
872
+ }
873
+
874
+ "hillshadeAccentColorTransition" -> {
875
+ setHillshadeAccentColorTransition(layer, styleValue)
876
+ }
877
+ }
878
+ }
879
+ }
880
+
881
+ fun setBackgroundLayerStyle(
882
+ layer: BackgroundLayer,
883
+ style: MLRNStyle,
884
+ ) {
885
+ val styleKeys = style.allStyleKeys
886
+
887
+ if (styleKeys.isEmpty()) {
888
+ return
889
+ }
890
+
891
+ for (styleKey in styleKeys) {
892
+ val styleValue = style.getStyleValueForKey(styleKey)
893
+
894
+ when (styleKey) {
895
+ "visibility" -> {
896
+ setVisibility(layer, styleValue)
897
+ }
898
+
899
+ "backgroundColor" -> {
900
+ setBackgroundColor(layer, styleValue)
901
+ }
902
+
903
+ "backgroundColorTransition" -> {
904
+ setBackgroundColorTransition(layer, styleValue)
905
+ }
906
+
907
+ "backgroundPattern" -> {
908
+ style.addImage(
909
+ styleValue,
910
+ ) { setBackgroundPattern(layer, styleValue) }
911
+ }
912
+
913
+ "backgroundPatternTransition" -> {
914
+ setBackgroundPatternTransition(layer, styleValue)
915
+ }
916
+
917
+ "backgroundOpacity" -> {
918
+ setBackgroundOpacity(layer, styleValue)
919
+ }
920
+
921
+ "backgroundOpacityTransition" -> {
922
+ setBackgroundOpacityTransition(layer, styleValue)
923
+ }
924
+ }
925
+ }
926
+ }
927
+
928
+ fun setLightLayerStyle(
929
+ layer: Light,
930
+ style: MLRNStyle,
931
+ ) {
932
+ val styleKeys = style.allStyleKeys
933
+
934
+ if (styleKeys.isEmpty()) {
935
+ return
936
+ }
937
+
938
+ for (styleKey in styleKeys) {
939
+ val styleValue = style.getStyleValueForKey(styleKey)
940
+
941
+ when (styleKey) {
942
+ "anchor" -> {
943
+ setAnchor(layer, styleValue)
944
+ }
945
+
946
+ "position" -> {
947
+ setPosition(layer, styleValue)
948
+ }
949
+
950
+ "positionTransition" -> {
951
+ setPositionTransition(layer, styleValue)
952
+ }
953
+
954
+ "color" -> {
955
+ setColor(layer, styleValue)
956
+ }
957
+
958
+ "colorTransition" -> {
959
+ setColorTransition(layer, styleValue)
960
+ }
961
+
962
+ "intensity" -> {
963
+ setIntensity(layer, styleValue)
964
+ }
965
+
966
+ "intensityTransition" -> {
967
+ setIntensityTransition(layer, styleValue)
968
+ }
969
+ }
970
+ }
971
+ }
972
+
973
+ fun setFillSortKey(
974
+ layer: FillLayer,
975
+ styleValue: MLRNStyleValue,
976
+ ) {
977
+ if (styleValue.isExpression()) {
978
+ layer.setProperties(PropertyFactory.fillSortKey(styleValue.getExpression()))
979
+ } else {
980
+ layer.setProperties(PropertyFactory.fillSortKey(styleValue.getFloat(VALUE_KEY)))
981
+ }
982
+ }
983
+
984
+ fun setVisibility(
985
+ layer: FillLayer,
986
+ styleValue: MLRNStyleValue,
987
+ ) {
988
+ layer.setProperties(PropertyFactory.visibility(styleValue.getString(VALUE_KEY)))
989
+ }
990
+
991
+ fun setFillAntialias(
992
+ layer: FillLayer,
993
+ styleValue: MLRNStyleValue,
994
+ ) {
995
+ if (styleValue.isExpression()) {
996
+ layer.setProperties(PropertyFactory.fillAntialias(styleValue.getExpression()))
997
+ } else {
998
+ layer.setProperties(PropertyFactory.fillAntialias(styleValue.getBoolean(VALUE_KEY)))
999
+ }
1000
+ }
1001
+
1002
+ fun setFillOpacity(
1003
+ layer: FillLayer,
1004
+ styleValue: MLRNStyleValue,
1005
+ ) {
1006
+ if (styleValue.isExpression()) {
1007
+ layer.setProperties(PropertyFactory.fillOpacity(styleValue.getExpression()))
1008
+ } else {
1009
+ layer.setProperties(PropertyFactory.fillOpacity(styleValue.getFloat(VALUE_KEY)))
1010
+ }
1011
+ }
1012
+
1013
+ fun setFillOpacityTransition(
1014
+ layer: FillLayer,
1015
+ styleValue: MLRNStyleValue,
1016
+ ) {
1017
+ val transition = styleValue.transition
1018
+ if (transition != null) {
1019
+ layer.fillOpacityTransition = transition
1020
+ }
1021
+ }
1022
+
1023
+ fun setFillColor(
1024
+ layer: FillLayer,
1025
+ styleValue: MLRNStyleValue,
1026
+ ) {
1027
+ if (styleValue.isExpression()) {
1028
+ layer.setProperties(PropertyFactory.fillColor(styleValue.getExpression()))
1029
+ } else {
1030
+ layer.setProperties(PropertyFactory.fillColor(styleValue.getInt(VALUE_KEY)))
1031
+ }
1032
+ }
1033
+
1034
+ fun setFillColorTransition(
1035
+ layer: FillLayer,
1036
+ styleValue: MLRNStyleValue,
1037
+ ) {
1038
+ val transition = styleValue.transition
1039
+ if (transition != null) {
1040
+ layer.fillColorTransition = transition
1041
+ }
1042
+ }
1043
+
1044
+ fun setFillOutlineColor(
1045
+ layer: FillLayer,
1046
+ styleValue: MLRNStyleValue,
1047
+ ) {
1048
+ if (styleValue.isExpression()) {
1049
+ layer.setProperties(PropertyFactory.fillOutlineColor(styleValue.getExpression()))
1050
+ } else {
1051
+ layer.setProperties(PropertyFactory.fillOutlineColor(styleValue.getInt(VALUE_KEY)))
1052
+ }
1053
+ }
1054
+
1055
+ fun setFillOutlineColorTransition(
1056
+ layer: FillLayer,
1057
+ styleValue: MLRNStyleValue,
1058
+ ) {
1059
+ val transition = styleValue.transition
1060
+ if (transition != null) {
1061
+ layer.fillOutlineColorTransition = transition
1062
+ }
1063
+ }
1064
+
1065
+ fun setFillTranslate(
1066
+ layer: FillLayer,
1067
+ styleValue: MLRNStyleValue,
1068
+ ) {
1069
+ if (styleValue.isExpression()) {
1070
+ layer.setProperties(PropertyFactory.fillTranslate(styleValue.getExpression()))
1071
+ } else {
1072
+ layer.setProperties(PropertyFactory.fillTranslate(styleValue.getFloatArray(VALUE_KEY)))
1073
+ }
1074
+ }
1075
+
1076
+ fun setFillTranslateTransition(
1077
+ layer: FillLayer,
1078
+ styleValue: MLRNStyleValue,
1079
+ ) {
1080
+ val transition = styleValue.transition
1081
+ if (transition != null) {
1082
+ layer.fillTranslateTransition = transition
1083
+ }
1084
+ }
1085
+
1086
+ fun setFillTranslateAnchor(
1087
+ layer: FillLayer,
1088
+ styleValue: MLRNStyleValue,
1089
+ ) {
1090
+ if (styleValue.isExpression()) {
1091
+ layer.setProperties(PropertyFactory.fillTranslateAnchor(styleValue.getExpression()))
1092
+ } else {
1093
+ layer.setProperties(PropertyFactory.fillTranslateAnchor(styleValue.getString(VALUE_KEY)))
1094
+ }
1095
+ }
1096
+
1097
+ fun setFillPattern(
1098
+ layer: FillLayer,
1099
+ styleValue: MLRNStyleValue,
1100
+ ) {
1101
+ if (styleValue.isExpression()) {
1102
+ if (styleValue.isImageStringValue) {
1103
+ layer.setProperties(PropertyFactory.fillPattern(styleValue.getImageStringValue()))
1104
+ } else {
1105
+ layer.setProperties(PropertyFactory.fillPattern(styleValue.getExpression()))
1106
+ }
1107
+ } else {
1108
+ layer.setProperties(PropertyFactory.fillPattern(styleValue.imageURI))
1109
+ }
1110
+ }
1111
+
1112
+ fun setFillPatternTransition(
1113
+ layer: FillLayer,
1114
+ styleValue: MLRNStyleValue,
1115
+ ) {
1116
+ val transition = styleValue.transition
1117
+ if (transition != null) {
1118
+ layer.fillPatternTransition = transition
1119
+ }
1120
+ }
1121
+
1122
+ fun setLineCap(
1123
+ layer: LineLayer,
1124
+ styleValue: MLRNStyleValue,
1125
+ ) {
1126
+ if (styleValue.isExpression()) {
1127
+ layer.setProperties(PropertyFactory.lineCap(styleValue.getExpression()))
1128
+ } else {
1129
+ layer.setProperties(PropertyFactory.lineCap(styleValue.getString(VALUE_KEY)))
1130
+ }
1131
+ }
1132
+
1133
+ fun setLineJoin(
1134
+ layer: LineLayer,
1135
+ styleValue: MLRNStyleValue,
1136
+ ) {
1137
+ if (styleValue.isExpression()) {
1138
+ layer.setProperties(PropertyFactory.lineJoin(styleValue.getExpression()))
1139
+ } else {
1140
+ layer.setProperties(PropertyFactory.lineJoin(styleValue.getString(VALUE_KEY)))
1141
+ }
1142
+ }
1143
+
1144
+ fun setLineMiterLimit(
1145
+ layer: LineLayer,
1146
+ styleValue: MLRNStyleValue,
1147
+ ) {
1148
+ if (styleValue.isExpression()) {
1149
+ layer.setProperties(PropertyFactory.lineMiterLimit(styleValue.getExpression()))
1150
+ } else {
1151
+ layer.setProperties(PropertyFactory.lineMiterLimit(styleValue.getFloat(VALUE_KEY)))
1152
+ }
1153
+ }
1154
+
1155
+ fun setLineRoundLimit(
1156
+ layer: LineLayer,
1157
+ styleValue: MLRNStyleValue,
1158
+ ) {
1159
+ if (styleValue.isExpression()) {
1160
+ layer.setProperties(PropertyFactory.lineRoundLimit(styleValue.getExpression()))
1161
+ } else {
1162
+ layer.setProperties(PropertyFactory.lineRoundLimit(styleValue.getFloat(VALUE_KEY)))
1163
+ }
1164
+ }
1165
+
1166
+ fun setLineSortKey(
1167
+ layer: LineLayer,
1168
+ styleValue: MLRNStyleValue,
1169
+ ) {
1170
+ if (styleValue.isExpression()) {
1171
+ layer.setProperties(PropertyFactory.lineSortKey(styleValue.getExpression()))
1172
+ } else {
1173
+ layer.setProperties(PropertyFactory.lineSortKey(styleValue.getFloat(VALUE_KEY)))
1174
+ }
1175
+ }
1176
+
1177
+ fun setVisibility(
1178
+ layer: LineLayer,
1179
+ styleValue: MLRNStyleValue,
1180
+ ) {
1181
+ layer.setProperties(PropertyFactory.visibility(styleValue.getString(VALUE_KEY)))
1182
+ }
1183
+
1184
+ fun setLineOpacity(
1185
+ layer: LineLayer,
1186
+ styleValue: MLRNStyleValue,
1187
+ ) {
1188
+ if (styleValue.isExpression()) {
1189
+ layer.setProperties(PropertyFactory.lineOpacity(styleValue.getExpression()))
1190
+ } else {
1191
+ layer.setProperties(PropertyFactory.lineOpacity(styleValue.getFloat(VALUE_KEY)))
1192
+ }
1193
+ }
1194
+
1195
+ fun setLineOpacityTransition(
1196
+ layer: LineLayer,
1197
+ styleValue: MLRNStyleValue,
1198
+ ) {
1199
+ val transition = styleValue.transition
1200
+ if (transition != null) {
1201
+ layer.lineOpacityTransition = transition
1202
+ }
1203
+ }
1204
+
1205
+ fun setLineColor(
1206
+ layer: LineLayer,
1207
+ styleValue: MLRNStyleValue,
1208
+ ) {
1209
+ if (styleValue.isExpression()) {
1210
+ layer.setProperties(PropertyFactory.lineColor(styleValue.getExpression()))
1211
+ } else {
1212
+ layer.setProperties(PropertyFactory.lineColor(styleValue.getInt(VALUE_KEY)))
1213
+ }
1214
+ }
1215
+
1216
+ fun setLineColorTransition(
1217
+ layer: LineLayer,
1218
+ styleValue: MLRNStyleValue,
1219
+ ) {
1220
+ val transition = styleValue.transition
1221
+ if (transition != null) {
1222
+ layer.lineColorTransition = transition
1223
+ }
1224
+ }
1225
+
1226
+ fun setLineTranslate(
1227
+ layer: LineLayer,
1228
+ styleValue: MLRNStyleValue,
1229
+ ) {
1230
+ if (styleValue.isExpression()) {
1231
+ layer.setProperties(PropertyFactory.lineTranslate(styleValue.getExpression()))
1232
+ } else {
1233
+ layer.setProperties(PropertyFactory.lineTranslate(styleValue.getFloatArray(VALUE_KEY)))
1234
+ }
1235
+ }
1236
+
1237
+ fun setLineTranslateTransition(
1238
+ layer: LineLayer,
1239
+ styleValue: MLRNStyleValue,
1240
+ ) {
1241
+ val transition = styleValue.transition
1242
+ if (transition != null) {
1243
+ layer.lineTranslateTransition = transition
1244
+ }
1245
+ }
1246
+
1247
+ fun setLineTranslateAnchor(
1248
+ layer: LineLayer,
1249
+ styleValue: MLRNStyleValue,
1250
+ ) {
1251
+ if (styleValue.isExpression()) {
1252
+ layer.setProperties(PropertyFactory.lineTranslateAnchor(styleValue.getExpression()))
1253
+ } else {
1254
+ layer.setProperties(PropertyFactory.lineTranslateAnchor(styleValue.getString(VALUE_KEY)))
1255
+ }
1256
+ }
1257
+
1258
+ fun setLineWidth(
1259
+ layer: LineLayer,
1260
+ styleValue: MLRNStyleValue,
1261
+ ) {
1262
+ if (styleValue.isExpression()) {
1263
+ layer.setProperties(PropertyFactory.lineWidth(styleValue.getExpression()))
1264
+ } else {
1265
+ layer.setProperties(PropertyFactory.lineWidth(styleValue.getFloat(VALUE_KEY)))
1266
+ }
1267
+ }
1268
+
1269
+ fun setLineWidthTransition(
1270
+ layer: LineLayer,
1271
+ styleValue: MLRNStyleValue,
1272
+ ) {
1273
+ val transition = styleValue.transition
1274
+ if (transition != null) {
1275
+ layer.lineWidthTransition = transition
1276
+ }
1277
+ }
1278
+
1279
+ fun setLineGapWidth(
1280
+ layer: LineLayer,
1281
+ styleValue: MLRNStyleValue,
1282
+ ) {
1283
+ if (styleValue.isExpression()) {
1284
+ layer.setProperties(PropertyFactory.lineGapWidth(styleValue.getExpression()))
1285
+ } else {
1286
+ layer.setProperties(PropertyFactory.lineGapWidth(styleValue.getFloat(VALUE_KEY)))
1287
+ }
1288
+ }
1289
+
1290
+ fun setLineGapWidthTransition(
1291
+ layer: LineLayer,
1292
+ styleValue: MLRNStyleValue,
1293
+ ) {
1294
+ val transition = styleValue.transition
1295
+ if (transition != null) {
1296
+ layer.lineGapWidthTransition = transition
1297
+ }
1298
+ }
1299
+
1300
+ fun setLineOffset(
1301
+ layer: LineLayer,
1302
+ styleValue: MLRNStyleValue,
1303
+ ) {
1304
+ if (styleValue.isExpression()) {
1305
+ layer.setProperties(PropertyFactory.lineOffset(styleValue.getExpression()))
1306
+ } else {
1307
+ layer.setProperties(PropertyFactory.lineOffset(styleValue.getFloat(VALUE_KEY)))
1308
+ }
1309
+ }
1310
+
1311
+ fun setLineOffsetTransition(
1312
+ layer: LineLayer,
1313
+ styleValue: MLRNStyleValue,
1314
+ ) {
1315
+ val transition = styleValue.transition
1316
+ if (transition != null) {
1317
+ layer.lineOffsetTransition = transition
1318
+ }
1319
+ }
1320
+
1321
+ fun setLineBlur(
1322
+ layer: LineLayer,
1323
+ styleValue: MLRNStyleValue,
1324
+ ) {
1325
+ if (styleValue.isExpression()) {
1326
+ layer.setProperties(PropertyFactory.lineBlur(styleValue.getExpression()))
1327
+ } else {
1328
+ layer.setProperties(PropertyFactory.lineBlur(styleValue.getFloat(VALUE_KEY)))
1329
+ }
1330
+ }
1331
+
1332
+ fun setLineBlurTransition(
1333
+ layer: LineLayer,
1334
+ styleValue: MLRNStyleValue,
1335
+ ) {
1336
+ val transition = styleValue.transition
1337
+ if (transition != null) {
1338
+ layer.lineBlurTransition = transition
1339
+ }
1340
+ }
1341
+
1342
+ fun setLineDasharray(
1343
+ layer: LineLayer,
1344
+ styleValue: MLRNStyleValue,
1345
+ ) {
1346
+ if (styleValue.isExpression()) {
1347
+ layer.setProperties(PropertyFactory.lineDasharray(styleValue.getExpression()))
1348
+ } else {
1349
+ layer.setProperties(PropertyFactory.lineDasharray(styleValue.getFloatArray(VALUE_KEY)))
1350
+ }
1351
+ }
1352
+
1353
+ fun setLineDasharrayTransition(
1354
+ layer: LineLayer,
1355
+ styleValue: MLRNStyleValue,
1356
+ ) {
1357
+ val transition = styleValue.transition
1358
+ if (transition != null) {
1359
+ layer.lineDasharrayTransition = transition
1360
+ }
1361
+ }
1362
+
1363
+ fun setLinePattern(
1364
+ layer: LineLayer,
1365
+ styleValue: MLRNStyleValue,
1366
+ ) {
1367
+ if (styleValue.isExpression()) {
1368
+ if (styleValue.isImageStringValue) {
1369
+ layer.setProperties(PropertyFactory.linePattern(styleValue.getImageStringValue()))
1370
+ } else {
1371
+ layer.setProperties(PropertyFactory.linePattern(styleValue.getExpression()))
1372
+ }
1373
+ } else {
1374
+ layer.setProperties(PropertyFactory.linePattern(styleValue.imageURI))
1375
+ }
1376
+ }
1377
+
1378
+ fun setLinePatternTransition(
1379
+ layer: LineLayer,
1380
+ styleValue: MLRNStyleValue,
1381
+ ) {
1382
+ val transition = styleValue.transition
1383
+ if (transition != null) {
1384
+ layer.linePatternTransition = transition
1385
+ }
1386
+ }
1387
+
1388
+ fun setLineGradient(
1389
+ layer: LineLayer,
1390
+ styleValue: MLRNStyleValue,
1391
+ ) {
1392
+ if (styleValue.isExpression()) {
1393
+ layer.setProperties(PropertyFactory.lineGradient(styleValue.getExpression()))
1394
+ } else {
1395
+ layer.setProperties(PropertyFactory.lineGradient(styleValue.getInt(VALUE_KEY)))
1396
+ }
1397
+ }
1398
+
1399
+ fun setSymbolPlacement(
1400
+ layer: SymbolLayer,
1401
+ styleValue: MLRNStyleValue,
1402
+ ) {
1403
+ if (styleValue.isExpression()) {
1404
+ layer.setProperties(PropertyFactory.symbolPlacement(styleValue.getExpression()))
1405
+ } else {
1406
+ layer.setProperties(PropertyFactory.symbolPlacement(styleValue.getString(VALUE_KEY)))
1407
+ }
1408
+ }
1409
+
1410
+ fun setSymbolSpacing(
1411
+ layer: SymbolLayer,
1412
+ styleValue: MLRNStyleValue,
1413
+ ) {
1414
+ if (styleValue.isExpression()) {
1415
+ layer.setProperties(PropertyFactory.symbolSpacing(styleValue.getExpression()))
1416
+ } else {
1417
+ layer.setProperties(PropertyFactory.symbolSpacing(styleValue.getFloat(VALUE_KEY)))
1418
+ }
1419
+ }
1420
+
1421
+ fun setSymbolAvoidEdges(
1422
+ layer: SymbolLayer,
1423
+ styleValue: MLRNStyleValue,
1424
+ ) {
1425
+ if (styleValue.isExpression()) {
1426
+ layer.setProperties(PropertyFactory.symbolAvoidEdges(styleValue.getExpression()))
1427
+ } else {
1428
+ layer.setProperties(PropertyFactory.symbolAvoidEdges(styleValue.getBoolean(VALUE_KEY)))
1429
+ }
1430
+ }
1431
+
1432
+ fun setSymbolSortKey(
1433
+ layer: SymbolLayer,
1434
+ styleValue: MLRNStyleValue,
1435
+ ) {
1436
+ if (styleValue.isExpression()) {
1437
+ layer.setProperties(PropertyFactory.symbolSortKey(styleValue.getExpression()))
1438
+ } else {
1439
+ layer.setProperties(PropertyFactory.symbolSortKey(styleValue.getFloat(VALUE_KEY)))
1440
+ }
1441
+ }
1442
+
1443
+ fun setSymbolZOrder(
1444
+ layer: SymbolLayer,
1445
+ styleValue: MLRNStyleValue,
1446
+ ) {
1447
+ if (styleValue.isExpression()) {
1448
+ layer.setProperties(PropertyFactory.symbolZOrder(styleValue.getExpression()))
1449
+ } else {
1450
+ layer.setProperties(PropertyFactory.symbolZOrder(styleValue.getString(VALUE_KEY)))
1451
+ }
1452
+ }
1453
+
1454
+ fun setIconAllowOverlap(
1455
+ layer: SymbolLayer,
1456
+ styleValue: MLRNStyleValue,
1457
+ ) {
1458
+ if (styleValue.isExpression()) {
1459
+ layer.setProperties(PropertyFactory.iconAllowOverlap(styleValue.getExpression()))
1460
+ } else {
1461
+ layer.setProperties(PropertyFactory.iconAllowOverlap(styleValue.getBoolean(VALUE_KEY)))
1462
+ }
1463
+ }
1464
+
1465
+ fun setIconIgnorePlacement(
1466
+ layer: SymbolLayer,
1467
+ styleValue: MLRNStyleValue,
1468
+ ) {
1469
+ if (styleValue.isExpression()) {
1470
+ layer.setProperties(PropertyFactory.iconIgnorePlacement(styleValue.getExpression()))
1471
+ } else {
1472
+ layer.setProperties(PropertyFactory.iconIgnorePlacement(styleValue.getBoolean(VALUE_KEY)))
1473
+ }
1474
+ }
1475
+
1476
+ fun setIconOptional(
1477
+ layer: SymbolLayer,
1478
+ styleValue: MLRNStyleValue,
1479
+ ) {
1480
+ if (styleValue.isExpression()) {
1481
+ layer.setProperties(PropertyFactory.iconOptional(styleValue.getExpression()))
1482
+ } else {
1483
+ layer.setProperties(PropertyFactory.iconOptional(styleValue.getBoolean(VALUE_KEY)))
1484
+ }
1485
+ }
1486
+
1487
+ fun setIconRotationAlignment(
1488
+ layer: SymbolLayer,
1489
+ styleValue: MLRNStyleValue,
1490
+ ) {
1491
+ if (styleValue.isExpression()) {
1492
+ layer.setProperties(PropertyFactory.iconRotationAlignment(styleValue.getExpression()))
1493
+ } else {
1494
+ layer.setProperties(PropertyFactory.iconRotationAlignment(styleValue.getString(VALUE_KEY)))
1495
+ }
1496
+ }
1497
+
1498
+ fun setIconSize(
1499
+ layer: SymbolLayer,
1500
+ styleValue: MLRNStyleValue,
1501
+ ) {
1502
+ if (styleValue.isExpression()) {
1503
+ layer.setProperties(PropertyFactory.iconSize(styleValue.getExpression()))
1504
+ } else {
1505
+ layer.setProperties(PropertyFactory.iconSize(styleValue.getFloat(VALUE_KEY)))
1506
+ }
1507
+ }
1508
+
1509
+ fun setIconTextFit(
1510
+ layer: SymbolLayer,
1511
+ styleValue: MLRNStyleValue,
1512
+ ) {
1513
+ if (styleValue.isExpression()) {
1514
+ layer.setProperties(PropertyFactory.iconTextFit(styleValue.getExpression()))
1515
+ } else {
1516
+ layer.setProperties(PropertyFactory.iconTextFit(styleValue.getString(VALUE_KEY)))
1517
+ }
1518
+ }
1519
+
1520
+ fun setIconTextFitPadding(
1521
+ layer: SymbolLayer,
1522
+ styleValue: MLRNStyleValue,
1523
+ ) {
1524
+ if (styleValue.isExpression()) {
1525
+ layer.setProperties(PropertyFactory.iconTextFitPadding(styleValue.getExpression()))
1526
+ } else {
1527
+ layer.setProperties(PropertyFactory.iconTextFitPadding(styleValue.getFloatArray(VALUE_KEY)))
1528
+ }
1529
+ }
1530
+
1531
+ fun setIconImage(
1532
+ layer: SymbolLayer,
1533
+ styleValue: MLRNStyleValue,
1534
+ ) {
1535
+ if (styleValue.isExpression()) {
1536
+ if (styleValue.isImageStringValue) {
1537
+ layer.setProperties(PropertyFactory.iconImage(styleValue.getImageStringValue()))
1538
+ } else {
1539
+ layer.setProperties(PropertyFactory.iconImage(styleValue.getExpression()))
1540
+ }
1541
+ } else {
1542
+ layer.setProperties(PropertyFactory.iconImage(styleValue.imageURI))
1543
+ }
1544
+ }
1545
+
1546
+ fun setIconRotate(
1547
+ layer: SymbolLayer,
1548
+ styleValue: MLRNStyleValue,
1549
+ ) {
1550
+ if (styleValue.isExpression()) {
1551
+ layer.setProperties(PropertyFactory.iconRotate(styleValue.getExpression()))
1552
+ } else {
1553
+ layer.setProperties(PropertyFactory.iconRotate(styleValue.getFloat(VALUE_KEY)))
1554
+ }
1555
+ }
1556
+
1557
+ fun setIconPadding(
1558
+ layer: SymbolLayer,
1559
+ styleValue: MLRNStyleValue,
1560
+ ) {
1561
+ if (styleValue.isExpression()) {
1562
+ layer.setProperties(PropertyFactory.iconPadding(styleValue.getExpression()))
1563
+ } else {
1564
+ layer.setProperties(PropertyFactory.iconPadding(styleValue.getFloatArray(VALUE_KEY)))
1565
+ }
1566
+ }
1567
+
1568
+ fun setIconKeepUpright(
1569
+ layer: SymbolLayer,
1570
+ styleValue: MLRNStyleValue,
1571
+ ) {
1572
+ if (styleValue.isExpression()) {
1573
+ layer.setProperties(PropertyFactory.iconKeepUpright(styleValue.getExpression()))
1574
+ } else {
1575
+ layer.setProperties(PropertyFactory.iconKeepUpright(styleValue.getBoolean(VALUE_KEY)))
1576
+ }
1577
+ }
1578
+
1579
+ fun setIconOffset(
1580
+ layer: SymbolLayer,
1581
+ styleValue: MLRNStyleValue,
1582
+ ) {
1583
+ if (styleValue.isExpression()) {
1584
+ layer.setProperties(PropertyFactory.iconOffset(styleValue.getExpression()))
1585
+ } else {
1586
+ layer.setProperties(PropertyFactory.iconOffset(styleValue.getFloatArray(VALUE_KEY)))
1587
+ }
1588
+ }
1589
+
1590
+ fun setIconAnchor(
1591
+ layer: SymbolLayer,
1592
+ styleValue: MLRNStyleValue,
1593
+ ) {
1594
+ if (styleValue.isExpression()) {
1595
+ layer.setProperties(PropertyFactory.iconAnchor(styleValue.getExpression()))
1596
+ } else {
1597
+ layer.setProperties(PropertyFactory.iconAnchor(styleValue.getString(VALUE_KEY)))
1598
+ }
1599
+ }
1600
+
1601
+ fun setIconPitchAlignment(
1602
+ layer: SymbolLayer,
1603
+ styleValue: MLRNStyleValue,
1604
+ ) {
1605
+ if (styleValue.isExpression()) {
1606
+ layer.setProperties(PropertyFactory.iconPitchAlignment(styleValue.getExpression()))
1607
+ } else {
1608
+ layer.setProperties(PropertyFactory.iconPitchAlignment(styleValue.getString(VALUE_KEY)))
1609
+ }
1610
+ }
1611
+
1612
+ fun setTextPitchAlignment(
1613
+ layer: SymbolLayer,
1614
+ styleValue: MLRNStyleValue,
1615
+ ) {
1616
+ if (styleValue.isExpression()) {
1617
+ layer.setProperties(PropertyFactory.textPitchAlignment(styleValue.getExpression()))
1618
+ } else {
1619
+ layer.setProperties(PropertyFactory.textPitchAlignment(styleValue.getString(VALUE_KEY)))
1620
+ }
1621
+ }
1622
+
1623
+ fun setTextRotationAlignment(
1624
+ layer: SymbolLayer,
1625
+ styleValue: MLRNStyleValue,
1626
+ ) {
1627
+ if (styleValue.isExpression()) {
1628
+ layer.setProperties(PropertyFactory.textRotationAlignment(styleValue.getExpression()))
1629
+ } else {
1630
+ layer.setProperties(PropertyFactory.textRotationAlignment(styleValue.getString(VALUE_KEY)))
1631
+ }
1632
+ }
1633
+
1634
+ fun setTextField(
1635
+ layer: SymbolLayer,
1636
+ styleValue: MLRNStyleValue,
1637
+ ) {
1638
+ if (styleValue.isExpression()) {
1639
+ layer.setProperties(PropertyFactory.textField(styleValue.getExpression()))
1640
+ } else {
1641
+ layer.setProperties(PropertyFactory.textField(styleValue.getString(VALUE_KEY)))
1642
+ }
1643
+ }
1644
+
1645
+ fun setTextFont(
1646
+ layer: SymbolLayer,
1647
+ styleValue: MLRNStyleValue,
1648
+ ) {
1649
+ if (styleValue.isExpression()) {
1650
+ layer.setProperties(PropertyFactory.textFont(styleValue.getExpression()))
1651
+ } else {
1652
+ layer.setProperties(PropertyFactory.textFont(styleValue.getStringArray(VALUE_KEY)))
1653
+ }
1654
+ }
1655
+
1656
+ fun setTextSize(
1657
+ layer: SymbolLayer,
1658
+ styleValue: MLRNStyleValue,
1659
+ ) {
1660
+ if (styleValue.isExpression()) {
1661
+ layer.setProperties(PropertyFactory.textSize(styleValue.getExpression()))
1662
+ } else {
1663
+ layer.setProperties(PropertyFactory.textSize(styleValue.getFloat(VALUE_KEY)))
1664
+ }
1665
+ }
1666
+
1667
+ fun setTextMaxWidth(
1668
+ layer: SymbolLayer,
1669
+ styleValue: MLRNStyleValue,
1670
+ ) {
1671
+ if (styleValue.isExpression()) {
1672
+ layer.setProperties(PropertyFactory.textMaxWidth(styleValue.getExpression()))
1673
+ } else {
1674
+ layer.setProperties(PropertyFactory.textMaxWidth(styleValue.getFloat(VALUE_KEY)))
1675
+ }
1676
+ }
1677
+
1678
+ fun setTextLineHeight(
1679
+ layer: SymbolLayer,
1680
+ styleValue: MLRNStyleValue,
1681
+ ) {
1682
+ if (styleValue.isExpression()) {
1683
+ layer.setProperties(PropertyFactory.textLineHeight(styleValue.getExpression()))
1684
+ } else {
1685
+ layer.setProperties(PropertyFactory.textLineHeight(styleValue.getFloat(VALUE_KEY)))
1686
+ }
1687
+ }
1688
+
1689
+ fun setTextLetterSpacing(
1690
+ layer: SymbolLayer,
1691
+ styleValue: MLRNStyleValue,
1692
+ ) {
1693
+ if (styleValue.isExpression()) {
1694
+ layer.setProperties(PropertyFactory.textLetterSpacing(styleValue.getExpression()))
1695
+ } else {
1696
+ layer.setProperties(PropertyFactory.textLetterSpacing(styleValue.getFloat(VALUE_KEY)))
1697
+ }
1698
+ }
1699
+
1700
+ fun setTextJustify(
1701
+ layer: SymbolLayer,
1702
+ styleValue: MLRNStyleValue,
1703
+ ) {
1704
+ if (styleValue.isExpression()) {
1705
+ layer.setProperties(PropertyFactory.textJustify(styleValue.getExpression()))
1706
+ } else {
1707
+ layer.setProperties(PropertyFactory.textJustify(styleValue.getString(VALUE_KEY)))
1708
+ }
1709
+ }
1710
+
1711
+ fun setTextRadialOffset(
1712
+ layer: SymbolLayer,
1713
+ styleValue: MLRNStyleValue,
1714
+ ) {
1715
+ if (styleValue.isExpression()) {
1716
+ layer.setProperties(PropertyFactory.textRadialOffset(styleValue.getExpression()))
1717
+ } else {
1718
+ layer.setProperties(PropertyFactory.textRadialOffset(styleValue.getFloat(VALUE_KEY)))
1719
+ }
1720
+ }
1721
+
1722
+ fun setTextVariableAnchor(
1723
+ layer: SymbolLayer,
1724
+ styleValue: MLRNStyleValue,
1725
+ ) {
1726
+ if (styleValue.isExpression()) {
1727
+ layer.setProperties(PropertyFactory.textVariableAnchor(styleValue.getExpression()))
1728
+ } else {
1729
+ layer.setProperties(PropertyFactory.textVariableAnchor(styleValue.getStringArray(VALUE_KEY)))
1730
+ }
1731
+ }
1732
+
1733
+ fun setTextAnchor(
1734
+ layer: SymbolLayer,
1735
+ styleValue: MLRNStyleValue,
1736
+ ) {
1737
+ if (styleValue.isExpression()) {
1738
+ layer.setProperties(PropertyFactory.textAnchor(styleValue.getExpression()))
1739
+ } else {
1740
+ layer.setProperties(PropertyFactory.textAnchor(styleValue.getString(VALUE_KEY)))
1741
+ }
1742
+ }
1743
+
1744
+ fun setTextMaxAngle(
1745
+ layer: SymbolLayer,
1746
+ styleValue: MLRNStyleValue,
1747
+ ) {
1748
+ if (styleValue.isExpression()) {
1749
+ layer.setProperties(PropertyFactory.textMaxAngle(styleValue.getExpression()))
1750
+ } else {
1751
+ layer.setProperties(PropertyFactory.textMaxAngle(styleValue.getFloat(VALUE_KEY)))
1752
+ }
1753
+ }
1754
+
1755
+ fun setTextWritingMode(
1756
+ layer: SymbolLayer,
1757
+ styleValue: MLRNStyleValue,
1758
+ ) {
1759
+ if (styleValue.isExpression()) {
1760
+ layer.setProperties(PropertyFactory.textWritingMode(styleValue.getExpression()))
1761
+ } else {
1762
+ layer.setProperties(PropertyFactory.textWritingMode(styleValue.getStringArray(VALUE_KEY)))
1763
+ }
1764
+ }
1765
+
1766
+ fun setTextRotate(
1767
+ layer: SymbolLayer,
1768
+ styleValue: MLRNStyleValue,
1769
+ ) {
1770
+ if (styleValue.isExpression()) {
1771
+ layer.setProperties(PropertyFactory.textRotate(styleValue.getExpression()))
1772
+ } else {
1773
+ layer.setProperties(PropertyFactory.textRotate(styleValue.getFloat(VALUE_KEY)))
1774
+ }
1775
+ }
1776
+
1777
+ fun setTextPadding(
1778
+ layer: SymbolLayer,
1779
+ styleValue: MLRNStyleValue,
1780
+ ) {
1781
+ if (styleValue.isExpression()) {
1782
+ layer.setProperties(PropertyFactory.textPadding(styleValue.getExpression()))
1783
+ } else {
1784
+ layer.setProperties(PropertyFactory.textPadding(styleValue.getFloat(VALUE_KEY)))
1785
+ }
1786
+ }
1787
+
1788
+ fun setTextKeepUpright(
1789
+ layer: SymbolLayer,
1790
+ styleValue: MLRNStyleValue,
1791
+ ) {
1792
+ if (styleValue.isExpression()) {
1793
+ layer.setProperties(PropertyFactory.textKeepUpright(styleValue.getExpression()))
1794
+ } else {
1795
+ layer.setProperties(PropertyFactory.textKeepUpright(styleValue.getBoolean(VALUE_KEY)))
1796
+ }
1797
+ }
1798
+
1799
+ fun setTextTransform(
1800
+ layer: SymbolLayer,
1801
+ styleValue: MLRNStyleValue,
1802
+ ) {
1803
+ if (styleValue.isExpression()) {
1804
+ layer.setProperties(PropertyFactory.textTransform(styleValue.getExpression()))
1805
+ } else {
1806
+ layer.setProperties(PropertyFactory.textTransform(styleValue.getString(VALUE_KEY)))
1807
+ }
1808
+ }
1809
+
1810
+ fun setTextOffset(
1811
+ layer: SymbolLayer,
1812
+ styleValue: MLRNStyleValue,
1813
+ ) {
1814
+ if (styleValue.isExpression()) {
1815
+ layer.setProperties(PropertyFactory.textOffset(styleValue.getExpression()))
1816
+ } else {
1817
+ layer.setProperties(PropertyFactory.textOffset(styleValue.getFloatArray(VALUE_KEY)))
1818
+ }
1819
+ }
1820
+
1821
+ fun setTextAllowOverlap(
1822
+ layer: SymbolLayer,
1823
+ styleValue: MLRNStyleValue,
1824
+ ) {
1825
+ if (styleValue.isExpression()) {
1826
+ layer.setProperties(PropertyFactory.textAllowOverlap(styleValue.getExpression()))
1827
+ } else {
1828
+ layer.setProperties(PropertyFactory.textAllowOverlap(styleValue.getBoolean(VALUE_KEY)))
1829
+ }
1830
+ }
1831
+
1832
+ fun setTextIgnorePlacement(
1833
+ layer: SymbolLayer,
1834
+ styleValue: MLRNStyleValue,
1835
+ ) {
1836
+ if (styleValue.isExpression()) {
1837
+ layer.setProperties(PropertyFactory.textIgnorePlacement(styleValue.getExpression()))
1838
+ } else {
1839
+ layer.setProperties(PropertyFactory.textIgnorePlacement(styleValue.getBoolean(VALUE_KEY)))
1840
+ }
1841
+ }
1842
+
1843
+ fun setTextOptional(
1844
+ layer: SymbolLayer,
1845
+ styleValue: MLRNStyleValue,
1846
+ ) {
1847
+ if (styleValue.isExpression()) {
1848
+ layer.setProperties(PropertyFactory.textOptional(styleValue.getExpression()))
1849
+ } else {
1850
+ layer.setProperties(PropertyFactory.textOptional(styleValue.getBoolean(VALUE_KEY)))
1851
+ }
1852
+ }
1853
+
1854
+ fun setVisibility(
1855
+ layer: SymbolLayer,
1856
+ styleValue: MLRNStyleValue,
1857
+ ) {
1858
+ layer.setProperties(PropertyFactory.visibility(styleValue.getString(VALUE_KEY)))
1859
+ }
1860
+
1861
+ fun setIconOpacity(
1862
+ layer: SymbolLayer,
1863
+ styleValue: MLRNStyleValue,
1864
+ ) {
1865
+ if (styleValue.isExpression()) {
1866
+ layer.setProperties(PropertyFactory.iconOpacity(styleValue.getExpression()))
1867
+ } else {
1868
+ layer.setProperties(PropertyFactory.iconOpacity(styleValue.getFloat(VALUE_KEY)))
1869
+ }
1870
+ }
1871
+
1872
+ fun setIconOpacityTransition(
1873
+ layer: SymbolLayer,
1874
+ styleValue: MLRNStyleValue,
1875
+ ) {
1876
+ val transition = styleValue.transition
1877
+ if (transition != null) {
1878
+ layer.iconOpacityTransition = transition
1879
+ }
1880
+ }
1881
+
1882
+ fun setIconColor(
1883
+ layer: SymbolLayer,
1884
+ styleValue: MLRNStyleValue,
1885
+ ) {
1886
+ if (styleValue.isExpression()) {
1887
+ layer.setProperties(PropertyFactory.iconColor(styleValue.getExpression()))
1888
+ } else {
1889
+ layer.setProperties(PropertyFactory.iconColor(styleValue.getInt(VALUE_KEY)))
1890
+ }
1891
+ }
1892
+
1893
+ fun setIconColorTransition(
1894
+ layer: SymbolLayer,
1895
+ styleValue: MLRNStyleValue,
1896
+ ) {
1897
+ val transition = styleValue.transition
1898
+ if (transition != null) {
1899
+ layer.iconColorTransition = transition
1900
+ }
1901
+ }
1902
+
1903
+ fun setIconHaloColor(
1904
+ layer: SymbolLayer,
1905
+ styleValue: MLRNStyleValue,
1906
+ ) {
1907
+ if (styleValue.isExpression()) {
1908
+ layer.setProperties(PropertyFactory.iconHaloColor(styleValue.getExpression()))
1909
+ } else {
1910
+ layer.setProperties(PropertyFactory.iconHaloColor(styleValue.getInt(VALUE_KEY)))
1911
+ }
1912
+ }
1913
+
1914
+ fun setIconHaloColorTransition(
1915
+ layer: SymbolLayer,
1916
+ styleValue: MLRNStyleValue,
1917
+ ) {
1918
+ val transition = styleValue.transition
1919
+ if (transition != null) {
1920
+ layer.iconHaloColorTransition = transition
1921
+ }
1922
+ }
1923
+
1924
+ fun setIconHaloWidth(
1925
+ layer: SymbolLayer,
1926
+ styleValue: MLRNStyleValue,
1927
+ ) {
1928
+ if (styleValue.isExpression()) {
1929
+ layer.setProperties(PropertyFactory.iconHaloWidth(styleValue.getExpression()))
1930
+ } else {
1931
+ layer.setProperties(PropertyFactory.iconHaloWidth(styleValue.getFloat(VALUE_KEY)))
1932
+ }
1933
+ }
1934
+
1935
+ fun setIconHaloWidthTransition(
1936
+ layer: SymbolLayer,
1937
+ styleValue: MLRNStyleValue,
1938
+ ) {
1939
+ val transition = styleValue.transition
1940
+ if (transition != null) {
1941
+ layer.iconHaloWidthTransition = transition
1942
+ }
1943
+ }
1944
+
1945
+ fun setIconHaloBlur(
1946
+ layer: SymbolLayer,
1947
+ styleValue: MLRNStyleValue,
1948
+ ) {
1949
+ if (styleValue.isExpression()) {
1950
+ layer.setProperties(PropertyFactory.iconHaloBlur(styleValue.getExpression()))
1951
+ } else {
1952
+ layer.setProperties(PropertyFactory.iconHaloBlur(styleValue.getFloat(VALUE_KEY)))
1953
+ }
1954
+ }
1955
+
1956
+ fun setIconHaloBlurTransition(
1957
+ layer: SymbolLayer,
1958
+ styleValue: MLRNStyleValue,
1959
+ ) {
1960
+ val transition = styleValue.transition
1961
+ if (transition != null) {
1962
+ layer.iconHaloBlurTransition = transition
1963
+ }
1964
+ }
1965
+
1966
+ fun setIconTranslate(
1967
+ layer: SymbolLayer,
1968
+ styleValue: MLRNStyleValue,
1969
+ ) {
1970
+ if (styleValue.isExpression()) {
1971
+ layer.setProperties(PropertyFactory.iconTranslate(styleValue.getExpression()))
1972
+ } else {
1973
+ layer.setProperties(PropertyFactory.iconTranslate(styleValue.getFloatArray(VALUE_KEY)))
1974
+ }
1975
+ }
1976
+
1977
+ fun setIconTranslateTransition(
1978
+ layer: SymbolLayer,
1979
+ styleValue: MLRNStyleValue,
1980
+ ) {
1981
+ val transition = styleValue.transition
1982
+ if (transition != null) {
1983
+ layer.iconTranslateTransition = transition
1984
+ }
1985
+ }
1986
+
1987
+ fun setIconTranslateAnchor(
1988
+ layer: SymbolLayer,
1989
+ styleValue: MLRNStyleValue,
1990
+ ) {
1991
+ if (styleValue.isExpression()) {
1992
+ layer.setProperties(PropertyFactory.iconTranslateAnchor(styleValue.getExpression()))
1993
+ } else {
1994
+ layer.setProperties(PropertyFactory.iconTranslateAnchor(styleValue.getString(VALUE_KEY)))
1995
+ }
1996
+ }
1997
+
1998
+ fun setTextOpacity(
1999
+ layer: SymbolLayer,
2000
+ styleValue: MLRNStyleValue,
2001
+ ) {
2002
+ if (styleValue.isExpression()) {
2003
+ layer.setProperties(PropertyFactory.textOpacity(styleValue.getExpression()))
2004
+ } else {
2005
+ layer.setProperties(PropertyFactory.textOpacity(styleValue.getFloat(VALUE_KEY)))
2006
+ }
2007
+ }
2008
+
2009
+ fun setTextOpacityTransition(
2010
+ layer: SymbolLayer,
2011
+ styleValue: MLRNStyleValue,
2012
+ ) {
2013
+ val transition = styleValue.transition
2014
+ if (transition != null) {
2015
+ layer.textOpacityTransition = transition
2016
+ }
2017
+ }
2018
+
2019
+ fun setTextColor(
2020
+ layer: SymbolLayer,
2021
+ styleValue: MLRNStyleValue,
2022
+ ) {
2023
+ if (styleValue.isExpression()) {
2024
+ layer.setProperties(PropertyFactory.textColor(styleValue.getExpression()))
2025
+ } else {
2026
+ layer.setProperties(PropertyFactory.textColor(styleValue.getInt(VALUE_KEY)))
2027
+ }
2028
+ }
2029
+
2030
+ fun setTextColorTransition(
2031
+ layer: SymbolLayer,
2032
+ styleValue: MLRNStyleValue,
2033
+ ) {
2034
+ val transition = styleValue.transition
2035
+ if (transition != null) {
2036
+ layer.textColorTransition = transition
2037
+ }
2038
+ }
2039
+
2040
+ fun setTextHaloColor(
2041
+ layer: SymbolLayer,
2042
+ styleValue: MLRNStyleValue,
2043
+ ) {
2044
+ if (styleValue.isExpression()) {
2045
+ layer.setProperties(PropertyFactory.textHaloColor(styleValue.getExpression()))
2046
+ } else {
2047
+ layer.setProperties(PropertyFactory.textHaloColor(styleValue.getInt(VALUE_KEY)))
2048
+ }
2049
+ }
2050
+
2051
+ fun setTextHaloColorTransition(
2052
+ layer: SymbolLayer,
2053
+ styleValue: MLRNStyleValue,
2054
+ ) {
2055
+ val transition = styleValue.transition
2056
+ if (transition != null) {
2057
+ layer.textHaloColorTransition = transition
2058
+ }
2059
+ }
2060
+
2061
+ fun setTextHaloWidth(
2062
+ layer: SymbolLayer,
2063
+ styleValue: MLRNStyleValue,
2064
+ ) {
2065
+ if (styleValue.isExpression()) {
2066
+ layer.setProperties(PropertyFactory.textHaloWidth(styleValue.getExpression()))
2067
+ } else {
2068
+ layer.setProperties(PropertyFactory.textHaloWidth(styleValue.getFloat(VALUE_KEY)))
2069
+ }
2070
+ }
2071
+
2072
+ fun setTextHaloWidthTransition(
2073
+ layer: SymbolLayer,
2074
+ styleValue: MLRNStyleValue,
2075
+ ) {
2076
+ val transition = styleValue.transition
2077
+ if (transition != null) {
2078
+ layer.textHaloWidthTransition = transition
2079
+ }
2080
+ }
2081
+
2082
+ fun setTextHaloBlur(
2083
+ layer: SymbolLayer,
2084
+ styleValue: MLRNStyleValue,
2085
+ ) {
2086
+ if (styleValue.isExpression()) {
2087
+ layer.setProperties(PropertyFactory.textHaloBlur(styleValue.getExpression()))
2088
+ } else {
2089
+ layer.setProperties(PropertyFactory.textHaloBlur(styleValue.getFloat(VALUE_KEY)))
2090
+ }
2091
+ }
2092
+
2093
+ fun setTextHaloBlurTransition(
2094
+ layer: SymbolLayer,
2095
+ styleValue: MLRNStyleValue,
2096
+ ) {
2097
+ val transition = styleValue.transition
2098
+ if (transition != null) {
2099
+ layer.textHaloBlurTransition = transition
2100
+ }
2101
+ }
2102
+
2103
+ fun setTextTranslate(
2104
+ layer: SymbolLayer,
2105
+ styleValue: MLRNStyleValue,
2106
+ ) {
2107
+ if (styleValue.isExpression()) {
2108
+ layer.setProperties(PropertyFactory.textTranslate(styleValue.getExpression()))
2109
+ } else {
2110
+ layer.setProperties(PropertyFactory.textTranslate(styleValue.getFloatArray(VALUE_KEY)))
2111
+ }
2112
+ }
2113
+
2114
+ fun setTextTranslateTransition(
2115
+ layer: SymbolLayer,
2116
+ styleValue: MLRNStyleValue,
2117
+ ) {
2118
+ val transition = styleValue.transition
2119
+ if (transition != null) {
2120
+ layer.textTranslateTransition = transition
2121
+ }
2122
+ }
2123
+
2124
+ fun setTextTranslateAnchor(
2125
+ layer: SymbolLayer,
2126
+ styleValue: MLRNStyleValue,
2127
+ ) {
2128
+ if (styleValue.isExpression()) {
2129
+ layer.setProperties(PropertyFactory.textTranslateAnchor(styleValue.getExpression()))
2130
+ } else {
2131
+ layer.setProperties(PropertyFactory.textTranslateAnchor(styleValue.getString(VALUE_KEY)))
2132
+ }
2133
+ }
2134
+
2135
+ fun setCircleSortKey(
2136
+ layer: CircleLayer,
2137
+ styleValue: MLRNStyleValue,
2138
+ ) {
2139
+ if (styleValue.isExpression()) {
2140
+ layer.setProperties(PropertyFactory.circleSortKey(styleValue.getExpression()))
2141
+ } else {
2142
+ layer.setProperties(PropertyFactory.circleSortKey(styleValue.getFloat(VALUE_KEY)))
2143
+ }
2144
+ }
2145
+
2146
+ fun setVisibility(
2147
+ layer: CircleLayer,
2148
+ styleValue: MLRNStyleValue,
2149
+ ) {
2150
+ layer.setProperties(PropertyFactory.visibility(styleValue.getString(VALUE_KEY)))
2151
+ }
2152
+
2153
+ fun setCircleRadius(
2154
+ layer: CircleLayer,
2155
+ styleValue: MLRNStyleValue,
2156
+ ) {
2157
+ if (styleValue.isExpression()) {
2158
+ layer.setProperties(PropertyFactory.circleRadius(styleValue.getExpression()))
2159
+ } else {
2160
+ layer.setProperties(PropertyFactory.circleRadius(styleValue.getFloat(VALUE_KEY)))
2161
+ }
2162
+ }
2163
+
2164
+ fun setCircleRadiusTransition(
2165
+ layer: CircleLayer,
2166
+ styleValue: MLRNStyleValue,
2167
+ ) {
2168
+ val transition = styleValue.transition
2169
+ if (transition != null) {
2170
+ layer.circleRadiusTransition = transition
2171
+ }
2172
+ }
2173
+
2174
+ fun setCircleColor(
2175
+ layer: CircleLayer,
2176
+ styleValue: MLRNStyleValue,
2177
+ ) {
2178
+ if (styleValue.isExpression()) {
2179
+ layer.setProperties(PropertyFactory.circleColor(styleValue.getExpression()))
2180
+ } else {
2181
+ layer.setProperties(PropertyFactory.circleColor(styleValue.getInt(VALUE_KEY)))
2182
+ }
2183
+ }
2184
+
2185
+ fun setCircleColorTransition(
2186
+ layer: CircleLayer,
2187
+ styleValue: MLRNStyleValue,
2188
+ ) {
2189
+ val transition = styleValue.transition
2190
+ if (transition != null) {
2191
+ layer.circleColorTransition = transition
2192
+ }
2193
+ }
2194
+
2195
+ fun setCircleBlur(
2196
+ layer: CircleLayer,
2197
+ styleValue: MLRNStyleValue,
2198
+ ) {
2199
+ if (styleValue.isExpression()) {
2200
+ layer.setProperties(PropertyFactory.circleBlur(styleValue.getExpression()))
2201
+ } else {
2202
+ layer.setProperties(PropertyFactory.circleBlur(styleValue.getFloat(VALUE_KEY)))
2203
+ }
2204
+ }
2205
+
2206
+ fun setCircleBlurTransition(
2207
+ layer: CircleLayer,
2208
+ styleValue: MLRNStyleValue,
2209
+ ) {
2210
+ val transition = styleValue.transition
2211
+ if (transition != null) {
2212
+ layer.circleBlurTransition = transition
2213
+ }
2214
+ }
2215
+
2216
+ fun setCircleOpacity(
2217
+ layer: CircleLayer,
2218
+ styleValue: MLRNStyleValue,
2219
+ ) {
2220
+ if (styleValue.isExpression()) {
2221
+ layer.setProperties(PropertyFactory.circleOpacity(styleValue.getExpression()))
2222
+ } else {
2223
+ layer.setProperties(PropertyFactory.circleOpacity(styleValue.getFloat(VALUE_KEY)))
2224
+ }
2225
+ }
2226
+
2227
+ fun setCircleOpacityTransition(
2228
+ layer: CircleLayer,
2229
+ styleValue: MLRNStyleValue,
2230
+ ) {
2231
+ val transition = styleValue.transition
2232
+ if (transition != null) {
2233
+ layer.circleOpacityTransition = transition
2234
+ }
2235
+ }
2236
+
2237
+ fun setCircleTranslate(
2238
+ layer: CircleLayer,
2239
+ styleValue: MLRNStyleValue,
2240
+ ) {
2241
+ if (styleValue.isExpression()) {
2242
+ layer.setProperties(PropertyFactory.circleTranslate(styleValue.getExpression()))
2243
+ } else {
2244
+ layer.setProperties(PropertyFactory.circleTranslate(styleValue.getFloatArray(VALUE_KEY)))
2245
+ }
2246
+ }
2247
+
2248
+ fun setCircleTranslateTransition(
2249
+ layer: CircleLayer,
2250
+ styleValue: MLRNStyleValue,
2251
+ ) {
2252
+ val transition = styleValue.transition
2253
+ if (transition != null) {
2254
+ layer.circleTranslateTransition = transition
2255
+ }
2256
+ }
2257
+
2258
+ fun setCircleTranslateAnchor(
2259
+ layer: CircleLayer,
2260
+ styleValue: MLRNStyleValue,
2261
+ ) {
2262
+ if (styleValue.isExpression()) {
2263
+ layer.setProperties(PropertyFactory.circleTranslateAnchor(styleValue.getExpression()))
2264
+ } else {
2265
+ layer.setProperties(PropertyFactory.circleTranslateAnchor(styleValue.getString(VALUE_KEY)))
2266
+ }
2267
+ }
2268
+
2269
+ fun setCirclePitchScale(
2270
+ layer: CircleLayer,
2271
+ styleValue: MLRNStyleValue,
2272
+ ) {
2273
+ if (styleValue.isExpression()) {
2274
+ layer.setProperties(PropertyFactory.circlePitchScale(styleValue.getExpression()))
2275
+ } else {
2276
+ layer.setProperties(PropertyFactory.circlePitchScale(styleValue.getString(VALUE_KEY)))
2277
+ }
2278
+ }
2279
+
2280
+ fun setCirclePitchAlignment(
2281
+ layer: CircleLayer,
2282
+ styleValue: MLRNStyleValue,
2283
+ ) {
2284
+ if (styleValue.isExpression()) {
2285
+ layer.setProperties(PropertyFactory.circlePitchAlignment(styleValue.getExpression()))
2286
+ } else {
2287
+ layer.setProperties(PropertyFactory.circlePitchAlignment(styleValue.getString(VALUE_KEY)))
2288
+ }
2289
+ }
2290
+
2291
+ fun setCircleStrokeWidth(
2292
+ layer: CircleLayer,
2293
+ styleValue: MLRNStyleValue,
2294
+ ) {
2295
+ if (styleValue.isExpression()) {
2296
+ layer.setProperties(PropertyFactory.circleStrokeWidth(styleValue.getExpression()))
2297
+ } else {
2298
+ layer.setProperties(PropertyFactory.circleStrokeWidth(styleValue.getFloat(VALUE_KEY)))
2299
+ }
2300
+ }
2301
+
2302
+ fun setCircleStrokeWidthTransition(
2303
+ layer: CircleLayer,
2304
+ styleValue: MLRNStyleValue,
2305
+ ) {
2306
+ val transition = styleValue.transition
2307
+ if (transition != null) {
2308
+ layer.circleStrokeWidthTransition = transition
2309
+ }
2310
+ }
2311
+
2312
+ fun setCircleStrokeColor(
2313
+ layer: CircleLayer,
2314
+ styleValue: MLRNStyleValue,
2315
+ ) {
2316
+ if (styleValue.isExpression()) {
2317
+ layer.setProperties(PropertyFactory.circleStrokeColor(styleValue.getExpression()))
2318
+ } else {
2319
+ layer.setProperties(PropertyFactory.circleStrokeColor(styleValue.getInt(VALUE_KEY)))
2320
+ }
2321
+ }
2322
+
2323
+ fun setCircleStrokeColorTransition(
2324
+ layer: CircleLayer,
2325
+ styleValue: MLRNStyleValue,
2326
+ ) {
2327
+ val transition = styleValue.transition
2328
+ if (transition != null) {
2329
+ layer.circleStrokeColorTransition = transition
2330
+ }
2331
+ }
2332
+
2333
+ fun setCircleStrokeOpacity(
2334
+ layer: CircleLayer,
2335
+ styleValue: MLRNStyleValue,
2336
+ ) {
2337
+ if (styleValue.isExpression()) {
2338
+ layer.setProperties(PropertyFactory.circleStrokeOpacity(styleValue.getExpression()))
2339
+ } else {
2340
+ layer.setProperties(PropertyFactory.circleStrokeOpacity(styleValue.getFloat(VALUE_KEY)))
2341
+ }
2342
+ }
2343
+
2344
+ fun setCircleStrokeOpacityTransition(
2345
+ layer: CircleLayer,
2346
+ styleValue: MLRNStyleValue,
2347
+ ) {
2348
+ val transition = styleValue.transition
2349
+ if (transition != null) {
2350
+ layer.circleStrokeOpacityTransition = transition
2351
+ }
2352
+ }
2353
+
2354
+ fun setVisibility(
2355
+ layer: HeatmapLayer,
2356
+ styleValue: MLRNStyleValue,
2357
+ ) {
2358
+ layer.setProperties(PropertyFactory.visibility(styleValue.getString(VALUE_KEY)))
2359
+ }
2360
+
2361
+ fun setHeatmapRadius(
2362
+ layer: HeatmapLayer,
2363
+ styleValue: MLRNStyleValue,
2364
+ ) {
2365
+ if (styleValue.isExpression()) {
2366
+ layer.setProperties(PropertyFactory.heatmapRadius(styleValue.getExpression()))
2367
+ } else {
2368
+ layer.setProperties(PropertyFactory.heatmapRadius(styleValue.getFloat(VALUE_KEY)))
2369
+ }
2370
+ }
2371
+
2372
+ fun setHeatmapRadiusTransition(
2373
+ layer: HeatmapLayer,
2374
+ styleValue: MLRNStyleValue,
2375
+ ) {
2376
+ val transition = styleValue.transition
2377
+ if (transition != null) {
2378
+ layer.heatmapRadiusTransition = transition
2379
+ }
2380
+ }
2381
+
2382
+ fun setHeatmapWeight(
2383
+ layer: HeatmapLayer,
2384
+ styleValue: MLRNStyleValue,
2385
+ ) {
2386
+ if (styleValue.isExpression()) {
2387
+ layer.setProperties(PropertyFactory.heatmapWeight(styleValue.getExpression()))
2388
+ } else {
2389
+ layer.setProperties(PropertyFactory.heatmapWeight(styleValue.getFloat(VALUE_KEY)))
2390
+ }
2391
+ }
2392
+
2393
+ fun setHeatmapIntensity(
2394
+ layer: HeatmapLayer,
2395
+ styleValue: MLRNStyleValue,
2396
+ ) {
2397
+ if (styleValue.isExpression()) {
2398
+ layer.setProperties(PropertyFactory.heatmapIntensity(styleValue.getExpression()))
2399
+ } else {
2400
+ layer.setProperties(PropertyFactory.heatmapIntensity(styleValue.getFloat(VALUE_KEY)))
2401
+ }
2402
+ }
2403
+
2404
+ fun setHeatmapIntensityTransition(
2405
+ layer: HeatmapLayer,
2406
+ styleValue: MLRNStyleValue,
2407
+ ) {
2408
+ val transition = styleValue.transition
2409
+ if (transition != null) {
2410
+ layer.heatmapIntensityTransition = transition
2411
+ }
2412
+ }
2413
+
2414
+ fun setHeatmapColor(
2415
+ layer: HeatmapLayer,
2416
+ styleValue: MLRNStyleValue,
2417
+ ) {
2418
+ if (styleValue.isExpression()) {
2419
+ layer.setProperties(PropertyFactory.heatmapColor(styleValue.getExpression()))
2420
+ } else {
2421
+ layer.setProperties(PropertyFactory.heatmapColor(styleValue.getInt(VALUE_KEY)))
2422
+ }
2423
+ }
2424
+
2425
+ fun setHeatmapOpacity(
2426
+ layer: HeatmapLayer,
2427
+ styleValue: MLRNStyleValue,
2428
+ ) {
2429
+ if (styleValue.isExpression()) {
2430
+ layer.setProperties(PropertyFactory.heatmapOpacity(styleValue.getExpression()))
2431
+ } else {
2432
+ layer.setProperties(PropertyFactory.heatmapOpacity(styleValue.getFloat(VALUE_KEY)))
2433
+ }
2434
+ }
2435
+
2436
+ fun setHeatmapOpacityTransition(
2437
+ layer: HeatmapLayer,
2438
+ styleValue: MLRNStyleValue,
2439
+ ) {
2440
+ val transition = styleValue.transition
2441
+ if (transition != null) {
2442
+ layer.heatmapOpacityTransition = transition
2443
+ }
2444
+ }
2445
+
2446
+ fun setVisibility(
2447
+ layer: FillExtrusionLayer,
2448
+ styleValue: MLRNStyleValue,
2449
+ ) {
2450
+ layer.setProperties(PropertyFactory.visibility(styleValue.getString(VALUE_KEY)))
2451
+ }
2452
+
2453
+ fun setFillExtrusionOpacity(
2454
+ layer: FillExtrusionLayer,
2455
+ styleValue: MLRNStyleValue,
2456
+ ) {
2457
+ if (styleValue.isExpression()) {
2458
+ layer.setProperties(PropertyFactory.fillExtrusionOpacity(styleValue.getExpression()))
2459
+ } else {
2460
+ layer.setProperties(PropertyFactory.fillExtrusionOpacity(styleValue.getFloat(VALUE_KEY)))
2461
+ }
2462
+ }
2463
+
2464
+ fun setFillExtrusionOpacityTransition(
2465
+ layer: FillExtrusionLayer,
2466
+ styleValue: MLRNStyleValue,
2467
+ ) {
2468
+ val transition = styleValue.transition
2469
+ if (transition != null) {
2470
+ layer.fillExtrusionOpacityTransition = transition
2471
+ }
2472
+ }
2473
+
2474
+ fun setFillExtrusionColor(
2475
+ layer: FillExtrusionLayer,
2476
+ styleValue: MLRNStyleValue,
2477
+ ) {
2478
+ if (styleValue.isExpression()) {
2479
+ layer.setProperties(PropertyFactory.fillExtrusionColor(styleValue.getExpression()))
2480
+ } else {
2481
+ layer.setProperties(PropertyFactory.fillExtrusionColor(styleValue.getInt(VALUE_KEY)))
2482
+ }
2483
+ }
2484
+
2485
+ fun setFillExtrusionColorTransition(
2486
+ layer: FillExtrusionLayer,
2487
+ styleValue: MLRNStyleValue,
2488
+ ) {
2489
+ val transition = styleValue.transition
2490
+ if (transition != null) {
2491
+ layer.fillExtrusionColorTransition = transition
2492
+ }
2493
+ }
2494
+
2495
+ fun setFillExtrusionTranslate(
2496
+ layer: FillExtrusionLayer,
2497
+ styleValue: MLRNStyleValue,
2498
+ ) {
2499
+ if (styleValue.isExpression()) {
2500
+ layer.setProperties(PropertyFactory.fillExtrusionTranslate(styleValue.getExpression()))
2501
+ } else {
2502
+ layer.setProperties(PropertyFactory.fillExtrusionTranslate(styleValue.getFloatArray(VALUE_KEY)))
2503
+ }
2504
+ }
2505
+
2506
+ fun setFillExtrusionTranslateTransition(
2507
+ layer: FillExtrusionLayer,
2508
+ styleValue: MLRNStyleValue,
2509
+ ) {
2510
+ val transition = styleValue.transition
2511
+ if (transition != null) {
2512
+ layer.fillExtrusionTranslateTransition = transition
2513
+ }
2514
+ }
2515
+
2516
+ fun setFillExtrusionTranslateAnchor(
2517
+ layer: FillExtrusionLayer,
2518
+ styleValue: MLRNStyleValue,
2519
+ ) {
2520
+ if (styleValue.isExpression()) {
2521
+ layer.setProperties(PropertyFactory.fillExtrusionTranslateAnchor(styleValue.getExpression()))
2522
+ } else {
2523
+ layer.setProperties(PropertyFactory.fillExtrusionTranslateAnchor(styleValue.getString(VALUE_KEY)))
2524
+ }
2525
+ }
2526
+
2527
+ fun setFillExtrusionPattern(
2528
+ layer: FillExtrusionLayer,
2529
+ styleValue: MLRNStyleValue,
2530
+ ) {
2531
+ if (styleValue.isExpression()) {
2532
+ if (styleValue.isImageStringValue) {
2533
+ layer.setProperties(PropertyFactory.fillExtrusionPattern(styleValue.getImageStringValue()))
2534
+ } else {
2535
+ layer.setProperties(PropertyFactory.fillExtrusionPattern(styleValue.getExpression()))
2536
+ }
2537
+ } else {
2538
+ layer.setProperties(PropertyFactory.fillExtrusionPattern(styleValue.imageURI))
2539
+ }
2540
+ }
2541
+
2542
+ fun setFillExtrusionPatternTransition(
2543
+ layer: FillExtrusionLayer,
2544
+ styleValue: MLRNStyleValue,
2545
+ ) {
2546
+ val transition = styleValue.transition
2547
+ if (transition != null) {
2548
+ layer.fillExtrusionPatternTransition = transition
2549
+ }
2550
+ }
2551
+
2552
+ fun setFillExtrusionHeight(
2553
+ layer: FillExtrusionLayer,
2554
+ styleValue: MLRNStyleValue,
2555
+ ) {
2556
+ if (styleValue.isExpression()) {
2557
+ layer.setProperties(PropertyFactory.fillExtrusionHeight(styleValue.getExpression()))
2558
+ } else {
2559
+ layer.setProperties(PropertyFactory.fillExtrusionHeight(styleValue.getFloat(VALUE_KEY)))
2560
+ }
2561
+ }
2562
+
2563
+ fun setFillExtrusionHeightTransition(
2564
+ layer: FillExtrusionLayer,
2565
+ styleValue: MLRNStyleValue,
2566
+ ) {
2567
+ val transition = styleValue.transition
2568
+ if (transition != null) {
2569
+ layer.fillExtrusionHeightTransition = transition
2570
+ }
2571
+ }
2572
+
2573
+ fun setFillExtrusionBase(
2574
+ layer: FillExtrusionLayer,
2575
+ styleValue: MLRNStyleValue,
2576
+ ) {
2577
+ if (styleValue.isExpression()) {
2578
+ layer.setProperties(PropertyFactory.fillExtrusionBase(styleValue.getExpression()))
2579
+ } else {
2580
+ layer.setProperties(PropertyFactory.fillExtrusionBase(styleValue.getFloat(VALUE_KEY)))
2581
+ }
2582
+ }
2583
+
2584
+ fun setFillExtrusionBaseTransition(
2585
+ layer: FillExtrusionLayer,
2586
+ styleValue: MLRNStyleValue,
2587
+ ) {
2588
+ val transition = styleValue.transition
2589
+ if (transition != null) {
2590
+ layer.fillExtrusionBaseTransition = transition
2591
+ }
2592
+ }
2593
+
2594
+ fun setFillExtrusionVerticalGradient(
2595
+ layer: FillExtrusionLayer,
2596
+ styleValue: MLRNStyleValue,
2597
+ ) {
2598
+ if (styleValue.isExpression()) {
2599
+ layer.setProperties(PropertyFactory.fillExtrusionVerticalGradient(styleValue.getExpression()))
2600
+ } else {
2601
+ layer.setProperties(PropertyFactory.fillExtrusionVerticalGradient(styleValue.getBoolean(VALUE_KEY)))
2602
+ }
2603
+ }
2604
+
2605
+ fun setVisibility(
2606
+ layer: RasterLayer,
2607
+ styleValue: MLRNStyleValue,
2608
+ ) {
2609
+ layer.setProperties(PropertyFactory.visibility(styleValue.getString(VALUE_KEY)))
2610
+ }
2611
+
2612
+ fun setRasterOpacity(
2613
+ layer: RasterLayer,
2614
+ styleValue: MLRNStyleValue,
2615
+ ) {
2616
+ if (styleValue.isExpression()) {
2617
+ layer.setProperties(PropertyFactory.rasterOpacity(styleValue.getExpression()))
2618
+ } else {
2619
+ layer.setProperties(PropertyFactory.rasterOpacity(styleValue.getFloat(VALUE_KEY)))
2620
+ }
2621
+ }
2622
+
2623
+ fun setRasterOpacityTransition(
2624
+ layer: RasterLayer,
2625
+ styleValue: MLRNStyleValue,
2626
+ ) {
2627
+ val transition = styleValue.transition
2628
+ if (transition != null) {
2629
+ layer.rasterOpacityTransition = transition
2630
+ }
2631
+ }
2632
+
2633
+ fun setRasterHueRotate(
2634
+ layer: RasterLayer,
2635
+ styleValue: MLRNStyleValue,
2636
+ ) {
2637
+ if (styleValue.isExpression()) {
2638
+ layer.setProperties(PropertyFactory.rasterHueRotate(styleValue.getExpression()))
2639
+ } else {
2640
+ layer.setProperties(PropertyFactory.rasterHueRotate(styleValue.getFloat(VALUE_KEY)))
2641
+ }
2642
+ }
2643
+
2644
+ fun setRasterHueRotateTransition(
2645
+ layer: RasterLayer,
2646
+ styleValue: MLRNStyleValue,
2647
+ ) {
2648
+ val transition = styleValue.transition
2649
+ if (transition != null) {
2650
+ layer.rasterHueRotateTransition = transition
2651
+ }
2652
+ }
2653
+
2654
+ fun setRasterBrightnessMin(
2655
+ layer: RasterLayer,
2656
+ styleValue: MLRNStyleValue,
2657
+ ) {
2658
+ if (styleValue.isExpression()) {
2659
+ layer.setProperties(PropertyFactory.rasterBrightnessMin(styleValue.getExpression()))
2660
+ } else {
2661
+ layer.setProperties(PropertyFactory.rasterBrightnessMin(styleValue.getFloat(VALUE_KEY)))
2662
+ }
2663
+ }
2664
+
2665
+ fun setRasterBrightnessMinTransition(
2666
+ layer: RasterLayer,
2667
+ styleValue: MLRNStyleValue,
2668
+ ) {
2669
+ val transition = styleValue.transition
2670
+ if (transition != null) {
2671
+ layer.rasterBrightnessMinTransition = transition
2672
+ }
2673
+ }
2674
+
2675
+ fun setRasterBrightnessMax(
2676
+ layer: RasterLayer,
2677
+ styleValue: MLRNStyleValue,
2678
+ ) {
2679
+ if (styleValue.isExpression()) {
2680
+ layer.setProperties(PropertyFactory.rasterBrightnessMax(styleValue.getExpression()))
2681
+ } else {
2682
+ layer.setProperties(PropertyFactory.rasterBrightnessMax(styleValue.getFloat(VALUE_KEY)))
2683
+ }
2684
+ }
2685
+
2686
+ fun setRasterBrightnessMaxTransition(
2687
+ layer: RasterLayer,
2688
+ styleValue: MLRNStyleValue,
2689
+ ) {
2690
+ val transition = styleValue.transition
2691
+ if (transition != null) {
2692
+ layer.rasterBrightnessMaxTransition = transition
2693
+ }
2694
+ }
2695
+
2696
+ fun setRasterSaturation(
2697
+ layer: RasterLayer,
2698
+ styleValue: MLRNStyleValue,
2699
+ ) {
2700
+ if (styleValue.isExpression()) {
2701
+ layer.setProperties(PropertyFactory.rasterSaturation(styleValue.getExpression()))
2702
+ } else {
2703
+ layer.setProperties(PropertyFactory.rasterSaturation(styleValue.getFloat(VALUE_KEY)))
2704
+ }
2705
+ }
2706
+
2707
+ fun setRasterSaturationTransition(
2708
+ layer: RasterLayer,
2709
+ styleValue: MLRNStyleValue,
2710
+ ) {
2711
+ val transition = styleValue.transition
2712
+ if (transition != null) {
2713
+ layer.rasterSaturationTransition = transition
2714
+ }
2715
+ }
2716
+
2717
+ fun setRasterContrast(
2718
+ layer: RasterLayer,
2719
+ styleValue: MLRNStyleValue,
2720
+ ) {
2721
+ if (styleValue.isExpression()) {
2722
+ layer.setProperties(PropertyFactory.rasterContrast(styleValue.getExpression()))
2723
+ } else {
2724
+ layer.setProperties(PropertyFactory.rasterContrast(styleValue.getFloat(VALUE_KEY)))
2725
+ }
2726
+ }
2727
+
2728
+ fun setRasterContrastTransition(
2729
+ layer: RasterLayer,
2730
+ styleValue: MLRNStyleValue,
2731
+ ) {
2732
+ val transition = styleValue.transition
2733
+ if (transition != null) {
2734
+ layer.rasterContrastTransition = transition
2735
+ }
2736
+ }
2737
+
2738
+ fun setRasterResampling(
2739
+ layer: RasterLayer,
2740
+ styleValue: MLRNStyleValue,
2741
+ ) {
2742
+ if (styleValue.isExpression()) {
2743
+ layer.setProperties(PropertyFactory.rasterResampling(styleValue.getExpression()))
2744
+ } else {
2745
+ layer.setProperties(PropertyFactory.rasterResampling(styleValue.getString(VALUE_KEY)))
2746
+ }
2747
+ }
2748
+
2749
+ fun setRasterFadeDuration(
2750
+ layer: RasterLayer,
2751
+ styleValue: MLRNStyleValue,
2752
+ ) {
2753
+ if (styleValue.isExpression()) {
2754
+ layer.setProperties(PropertyFactory.rasterFadeDuration(styleValue.getExpression()))
2755
+ } else {
2756
+ layer.setProperties(PropertyFactory.rasterFadeDuration(styleValue.getFloat(VALUE_KEY)))
2757
+ }
2758
+ }
2759
+
2760
+ fun setVisibility(
2761
+ layer: HillshadeLayer,
2762
+ styleValue: MLRNStyleValue,
2763
+ ) {
2764
+ layer.setProperties(PropertyFactory.visibility(styleValue.getString(VALUE_KEY)))
2765
+ }
2766
+
2767
+ fun setHillshadeIlluminationDirection(
2768
+ layer: HillshadeLayer,
2769
+ styleValue: MLRNStyleValue,
2770
+ ) {
2771
+ if (styleValue.isExpression()) {
2772
+ layer.setProperties(PropertyFactory.hillshadeIlluminationDirection(styleValue.getExpression()))
2773
+ } else {
2774
+ layer.setProperties(PropertyFactory.hillshadeIlluminationDirection(styleValue.getFloatArray(VALUE_KEY)))
2775
+ }
2776
+ }
2777
+
2778
+ fun setHillshadeIlluminationAnchor(
2779
+ layer: HillshadeLayer,
2780
+ styleValue: MLRNStyleValue,
2781
+ ) {
2782
+ if (styleValue.isExpression()) {
2783
+ layer.setProperties(PropertyFactory.hillshadeIlluminationAnchor(styleValue.getExpression()))
2784
+ } else {
2785
+ layer.setProperties(PropertyFactory.hillshadeIlluminationAnchor(styleValue.getString(VALUE_KEY)))
2786
+ }
2787
+ }
2788
+
2789
+ fun setHillshadeExaggeration(
2790
+ layer: HillshadeLayer,
2791
+ styleValue: MLRNStyleValue,
2792
+ ) {
2793
+ if (styleValue.isExpression()) {
2794
+ layer.setProperties(PropertyFactory.hillshadeExaggeration(styleValue.getExpression()))
2795
+ } else {
2796
+ layer.setProperties(PropertyFactory.hillshadeExaggeration(styleValue.getFloat(VALUE_KEY)))
2797
+ }
2798
+ }
2799
+
2800
+ fun setHillshadeExaggerationTransition(
2801
+ layer: HillshadeLayer,
2802
+ styleValue: MLRNStyleValue,
2803
+ ) {
2804
+ val transition = styleValue.transition
2805
+ if (transition != null) {
2806
+ layer.hillshadeExaggerationTransition = transition
2807
+ }
2808
+ }
2809
+
2810
+ fun setHillshadeShadowColor(
2811
+ layer: HillshadeLayer,
2812
+ styleValue: MLRNStyleValue,
2813
+ ) {
2814
+ if (styleValue.isExpression()) {
2815
+ layer.setProperties(PropertyFactory.hillshadeShadowColor(styleValue.getExpression()))
2816
+ } else {
2817
+ layer.setProperties(PropertyFactory.hillshadeShadowColor(styleValue.getStringArray(VALUE_KEY)))
2818
+ }
2819
+ }
2820
+
2821
+ fun setHillshadeShadowColorTransition(
2822
+ layer: HillshadeLayer,
2823
+ styleValue: MLRNStyleValue,
2824
+ ) {
2825
+ val transition = styleValue.transition
2826
+ if (transition != null) {
2827
+ layer.hillshadeShadowColorTransition = transition
2828
+ }
2829
+ }
2830
+
2831
+ fun setHillshadeHighlightColor(
2832
+ layer: HillshadeLayer,
2833
+ styleValue: MLRNStyleValue,
2834
+ ) {
2835
+ if (styleValue.isExpression()) {
2836
+ layer.setProperties(PropertyFactory.hillshadeHighlightColor(styleValue.getExpression()))
2837
+ } else {
2838
+ layer.setProperties(PropertyFactory.hillshadeHighlightColor(styleValue.getStringArray(VALUE_KEY)))
2839
+ }
2840
+ }
2841
+
2842
+ fun setHillshadeHighlightColorTransition(
2843
+ layer: HillshadeLayer,
2844
+ styleValue: MLRNStyleValue,
2845
+ ) {
2846
+ val transition = styleValue.transition
2847
+ if (transition != null) {
2848
+ layer.hillshadeHighlightColorTransition = transition
2849
+ }
2850
+ }
2851
+
2852
+ fun setHillshadeAccentColor(
2853
+ layer: HillshadeLayer,
2854
+ styleValue: MLRNStyleValue,
2855
+ ) {
2856
+ if (styleValue.isExpression()) {
2857
+ layer.setProperties(PropertyFactory.hillshadeAccentColor(styleValue.getExpression()))
2858
+ } else {
2859
+ layer.setProperties(PropertyFactory.hillshadeAccentColor(styleValue.getInt(VALUE_KEY)))
2860
+ }
2861
+ }
2862
+
2863
+ fun setHillshadeAccentColorTransition(
2864
+ layer: HillshadeLayer,
2865
+ styleValue: MLRNStyleValue,
2866
+ ) {
2867
+ val transition = styleValue.transition
2868
+ if (transition != null) {
2869
+ layer.hillshadeAccentColorTransition = transition
2870
+ }
2871
+ }
2872
+
2873
+ fun setVisibility(
2874
+ layer: BackgroundLayer,
2875
+ styleValue: MLRNStyleValue,
2876
+ ) {
2877
+ layer.setProperties(PropertyFactory.visibility(styleValue.getString(VALUE_KEY)))
2878
+ }
2879
+
2880
+ fun setBackgroundColor(
2881
+ layer: BackgroundLayer,
2882
+ styleValue: MLRNStyleValue,
2883
+ ) {
2884
+ if (styleValue.isExpression()) {
2885
+ layer.setProperties(PropertyFactory.backgroundColor(styleValue.getExpression()))
2886
+ } else {
2887
+ layer.setProperties(PropertyFactory.backgroundColor(styleValue.getInt(VALUE_KEY)))
2888
+ }
2889
+ }
2890
+
2891
+ fun setBackgroundColorTransition(
2892
+ layer: BackgroundLayer,
2893
+ styleValue: MLRNStyleValue,
2894
+ ) {
2895
+ val transition = styleValue.transition
2896
+ if (transition != null) {
2897
+ layer.backgroundColorTransition = transition
2898
+ }
2899
+ }
2900
+
2901
+ fun setBackgroundPattern(
2902
+ layer: BackgroundLayer,
2903
+ styleValue: MLRNStyleValue,
2904
+ ) {
2905
+ if (styleValue.isExpression()) {
2906
+ if (styleValue.isImageStringValue) {
2907
+ layer.setProperties(PropertyFactory.backgroundPattern(styleValue.getImageStringValue()))
2908
+ } else {
2909
+ layer.setProperties(PropertyFactory.backgroundPattern(styleValue.getExpression()))
2910
+ }
2911
+ } else {
2912
+ layer.setProperties(PropertyFactory.backgroundPattern(styleValue.imageURI))
2913
+ }
2914
+ }
2915
+
2916
+ fun setBackgroundPatternTransition(
2917
+ layer: BackgroundLayer,
2918
+ styleValue: MLRNStyleValue,
2919
+ ) {
2920
+ val transition = styleValue.transition
2921
+ if (transition != null) {
2922
+ layer.backgroundPatternTransition = transition
2923
+ }
2924
+ }
2925
+
2926
+ fun setBackgroundOpacity(
2927
+ layer: BackgroundLayer,
2928
+ styleValue: MLRNStyleValue,
2929
+ ) {
2930
+ if (styleValue.isExpression()) {
2931
+ layer.setProperties(PropertyFactory.backgroundOpacity(styleValue.getExpression()))
2932
+ } else {
2933
+ layer.setProperties(PropertyFactory.backgroundOpacity(styleValue.getFloat(VALUE_KEY)))
2934
+ }
2935
+ }
2936
+
2937
+ fun setBackgroundOpacityTransition(
2938
+ layer: BackgroundLayer,
2939
+ styleValue: MLRNStyleValue,
2940
+ ) {
2941
+ val transition = styleValue.transition
2942
+ if (transition != null) {
2943
+ layer.backgroundOpacityTransition = transition
2944
+ }
2945
+ }
2946
+
2947
+ fun setAnchor(
2948
+ layer: Light,
2949
+ styleValue: MLRNStyleValue,
2950
+ ) {
2951
+ layer.anchor = styleValue.getString(VALUE_KEY)
2952
+ }
2953
+
2954
+ fun setPosition(
2955
+ layer: Light,
2956
+ styleValue: MLRNStyleValue,
2957
+ ) {
2958
+ val values = styleValue.getFloatArray(VALUE_KEY)
2959
+ layer.position = Position.fromPosition(values[0]!!, values[1]!!, values[2]!!)
2960
+ }
2961
+
2962
+ fun setPositionTransition(
2963
+ layer: Light,
2964
+ styleValue: MLRNStyleValue,
2965
+ ) {
2966
+ val transition = styleValue.transition
2967
+ if (transition != null) {
2968
+ layer.positionTransition = transition
2969
+ }
2970
+ }
2971
+
2972
+ fun setColor(
2973
+ layer: Light,
2974
+ styleValue: MLRNStyleValue,
2975
+ ) {
2976
+ layer.setColor(styleValue.getInt(VALUE_KEY))
2977
+ }
2978
+
2979
+ fun setColorTransition(
2980
+ layer: Light,
2981
+ styleValue: MLRNStyleValue,
2982
+ ) {
2983
+ val transition = styleValue.transition
2984
+ if (transition != null) {
2985
+ layer.colorTransition = transition
2986
+ }
2987
+ }
2988
+
2989
+ fun setIntensity(
2990
+ layer: Light,
2991
+ styleValue: MLRNStyleValue,
2992
+ ) {
2993
+ layer.intensity = styleValue.getFloat(VALUE_KEY)
2994
+ }
2995
+
2996
+ fun setIntensityTransition(
2997
+ layer: Light,
2998
+ styleValue: MLRNStyleValue,
2999
+ ) {
3000
+ val transition = styleValue.transition
3001
+ if (transition != null) {
3002
+ layer.intensityTransition = transition
3003
+ }
3004
+ }
3005
+ }