Skip to content

Commit 1824e83

Browse files
aleksigronactions-user
authored andcommitted
[MAPS3D-1933] Allow specifying ground shadow draw position in layer stack (#8631)
Fixes https://mapbox.atlassian.net/browse/MAPS3D-1933 Fixes https://mapbox.atlassian.net/browse/MAPS3D-2090 Add new property `shadow-draw-before-layer` to the directional light. When terrain is disabled and the layer is specified, shadows are drawn to the ground before the specified layer. This allows customers to fix issues like shown in the image below. The problem is that the style has shadow-casting layers after the middle slot, but moving the symbol layer (or similar) to the top slot is not desirable. Existing behavior was to always render the shadow to the ground after the last shadow-casting layer, but this is not acceptable in some cases. <img width="640" height="481" alt="image" src="https://github.com/user-attachments/assets/fe5009fa-e69f-48b2-a947-d480d927917b" /> ``` <public> Add shadow-draw-before-layer property to directional light to allow specifying shadow draw order. </public> ``` cc @mapbox/gl-js cc @mapbox/gl-native cc @mapbox/maps-ios cc @mapbox/maps-android cc @mapbox/sdk-ci --------- Co-authored-by: Changelog autocreator bot <[email protected]> GitOrigin-RevId: c69f78e0b6842a819468e2256335a600de8b58f8
1 parent 6408b81 commit 1824e83

File tree

9 files changed

+215
-1
lines changed

9 files changed

+215
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Mapbox welcomes participation and contributions from everyone.
1313
## Features ✨ and improvements 🏁
1414
* Add Standard Style color and 3D configuration options: `colorBuildings`, `colorCommercial`, `colorEducation`, `colorIndustrial`, `colorLand`, `colorMedical`, `show3dBuildings`, `show3dFacades`, `show3dLandmarks`, and `show3dTrees`.
1515
* Introduce experimental `AttributionControl` composable function that exposes `AttributionState` programmatically, enabling developers to build custom Attribution UI outside of the map while maintaining compliance with [Mapbox ToS](https://www.mapbox.com/legal/tos) requirements.
16+
* Add `shadowDrawBeforeLayer` property to directional light to allow specifying the position in the layer stack for drawing shadows on the ground.
1617

1718
# 11.17.1 December 11, 2025
1819
## Bug fixes 🐞

extension-compose/api/Release/metalava.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4325,6 +4325,7 @@ package com.mapbox.maps.extension.compose.style.lights.generated {
43254325
method public String getId();
43264326
method public com.mapbox.maps.extension.compose.style.DoubleValue getIntensity();
43274327
method public com.mapbox.maps.extension.compose.style.Transition getIntensityTransition();
4328+
method public com.mapbox.maps.extension.compose.style.StringValue getShadowDrawBeforeLayer();
43284329
method public com.mapbox.maps.extension.compose.style.DoubleValue getShadowIntensity();
43294330
method public com.mapbox.maps.extension.compose.style.Transition getShadowIntensityTransition();
43304331
method public void setCastShadows(com.mapbox.maps.extension.compose.style.BooleanValue);
@@ -4335,6 +4336,7 @@ package com.mapbox.maps.extension.compose.style.lights.generated {
43354336
method public void setDirectionTransition(com.mapbox.maps.extension.compose.style.Transition);
43364337
method public void setIntensity(com.mapbox.maps.extension.compose.style.DoubleValue);
43374338
method public void setIntensityTransition(com.mapbox.maps.extension.compose.style.Transition);
4339+
method public void setShadowDrawBeforeLayer(com.mapbox.maps.extension.compose.style.StringValue);
43384340
method public void setShadowIntensity(com.mapbox.maps.extension.compose.style.DoubleValue);
43394341
method public void setShadowIntensityTransition(com.mapbox.maps.extension.compose.style.Transition);
43404342
property public final com.mapbox.maps.extension.compose.style.BooleanValue castShadows;
@@ -4346,6 +4348,7 @@ package com.mapbox.maps.extension.compose.style.lights.generated {
43464348
property public final String id;
43474349
property public final com.mapbox.maps.extension.compose.style.DoubleValue intensity;
43484350
property public final com.mapbox.maps.extension.compose.style.Transition intensityTransition;
4351+
property public final com.mapbox.maps.extension.compose.style.StringValue shadowDrawBeforeLayer;
43494352
property public final com.mapbox.maps.extension.compose.style.DoubleValue shadowIntensity;
43504353
property public final com.mapbox.maps.extension.compose.style.Transition shadowIntensityTransition;
43514354
field public static final com.mapbox.maps.extension.compose.style.lights.generated.DirectionalLightState.Companion Companion;

extension-compose/api/extension-compose.api

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3627,6 +3627,7 @@ public final class com/mapbox/maps/extension/compose/style/lights/generated/Dire
36273627
public final fun getId ()Ljava/lang/String;
36283628
public final fun getIntensity ()Lcom/mapbox/maps/extension/compose/style/DoubleValue;
36293629
public final fun getIntensityTransition ()Lcom/mapbox/maps/extension/compose/style/Transition;
3630+
public final fun getShadowDrawBeforeLayer ()Lcom/mapbox/maps/extension/compose/style/StringValue;
36303631
public final fun getShadowIntensity ()Lcom/mapbox/maps/extension/compose/style/DoubleValue;
36313632
public final fun getShadowIntensityTransition ()Lcom/mapbox/maps/extension/compose/style/Transition;
36323633
public fun hashCode ()I
@@ -3638,6 +3639,7 @@ public final class com/mapbox/maps/extension/compose/style/lights/generated/Dire
36383639
public final fun setDirectionTransition (Lcom/mapbox/maps/extension/compose/style/Transition;)V
36393640
public final fun setIntensity (Lcom/mapbox/maps/extension/compose/style/DoubleValue;)V
36403641
public final fun setIntensityTransition (Lcom/mapbox/maps/extension/compose/style/Transition;)V
3642+
public final fun setShadowDrawBeforeLayer (Lcom/mapbox/maps/extension/compose/style/StringValue;)V
36413643
public final fun setShadowIntensity (Lcom/mapbox/maps/extension/compose/style/DoubleValue;)V
36423644
public final fun setShadowIntensityTransition (Lcom/mapbox/maps/extension/compose/style/Transition;)V
36433645
public fun toString ()Ljava/lang/String;

extension-compose/src/main/java/com/mapbox/maps/extension/compose/style/lights/generated/DirectionalLightState.kt

Lines changed: 18 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extension-style-app/src/androidTest/java/com/mapbox/maps/testapp/style/light/generated/DirectionalLightTest.kt

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extension-style/api/Release/metalava.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6974,13 +6974,17 @@ package com.mapbox.maps.extension.style.light.generated {
69746974
method public com.mapbox.maps.extension.style.expressions.generated.Expression? getIntensityAsExpression();
69756975
method public com.mapbox.maps.extension.style.types.StyleTransition? getIntensityTransition();
69766976
method public String getLightId();
6977+
method public String? getShadowDrawBeforeLayer();
6978+
method public com.mapbox.maps.extension.style.expressions.generated.Expression? getShadowDrawBeforeLayerAsExpression();
69776979
method public Double? getShadowIntensity();
69786980
method public com.mapbox.maps.extension.style.expressions.generated.Expression? getShadowIntensityAsExpression();
69796981
method public com.mapbox.maps.extension.style.types.StyleTransition? getShadowIntensityTransition();
69806982
method public com.mapbox.maps.extension.style.light.generated.DirectionalLight intensity(double intensity);
69816983
method public com.mapbox.maps.extension.style.light.generated.DirectionalLight intensity(com.mapbox.maps.extension.style.expressions.generated.Expression intensity);
69826984
method public com.mapbox.maps.extension.style.light.generated.DirectionalLight intensityTransition(com.mapbox.maps.extension.style.types.StyleTransition options);
69836985
method public com.mapbox.maps.extension.style.light.generated.DirectionalLight intensityTransition(kotlin.jvm.functions.Function1<? super com.mapbox.maps.extension.style.types.StyleTransition.Builder,kotlin.Unit> block);
6986+
method @com.mapbox.maps.MapboxExperimental public com.mapbox.maps.extension.style.light.generated.DirectionalLight shadowDrawBeforeLayer(String shadowDrawBeforeLayer);
6987+
method @com.mapbox.maps.MapboxExperimental public com.mapbox.maps.extension.style.light.generated.DirectionalLight shadowDrawBeforeLayer(com.mapbox.maps.extension.style.expressions.generated.Expression shadowDrawBeforeLayer);
69846988
method public com.mapbox.maps.extension.style.light.generated.DirectionalLight shadowIntensity(double shadowIntensity);
69856989
method public com.mapbox.maps.extension.style.light.generated.DirectionalLight shadowIntensity(com.mapbox.maps.extension.style.expressions.generated.Expression shadowIntensity);
69866990
method public com.mapbox.maps.extension.style.light.generated.DirectionalLight shadowIntensityTransition(com.mapbox.maps.extension.style.types.StyleTransition options);
@@ -7000,6 +7004,8 @@ package com.mapbox.maps.extension.style.light.generated {
70007004
property public final com.mapbox.maps.extension.style.expressions.generated.Expression? intensityAsExpression;
70017005
property public final com.mapbox.maps.extension.style.types.StyleTransition? intensityTransition;
70027006
property public String lightId;
7007+
property public final String? shadowDrawBeforeLayer;
7008+
property public final com.mapbox.maps.extension.style.expressions.generated.Expression? shadowDrawBeforeLayerAsExpression;
70037009
property public final Double? shadowIntensity;
70047010
property public final com.mapbox.maps.extension.style.expressions.generated.Expression? shadowIntensityAsExpression;
70057011
property public final com.mapbox.maps.extension.style.types.StyleTransition? shadowIntensityTransition;
@@ -7023,6 +7029,8 @@ package com.mapbox.maps.extension.style.light.generated {
70237029
method public com.mapbox.maps.extension.style.light.generated.DirectionalLight intensity(com.mapbox.maps.extension.style.expressions.generated.Expression intensity);
70247030
method public com.mapbox.maps.extension.style.light.generated.DirectionalLight intensityTransition(com.mapbox.maps.extension.style.types.StyleTransition options);
70257031
method public com.mapbox.maps.extension.style.light.generated.DirectionalLight intensityTransition(kotlin.jvm.functions.Function1<? super com.mapbox.maps.extension.style.types.StyleTransition.Builder,kotlin.Unit> block);
7032+
method @com.mapbox.maps.MapboxExperimental public com.mapbox.maps.extension.style.light.generated.DirectionalLight shadowDrawBeforeLayer(String shadowDrawBeforeLayer);
7033+
method @com.mapbox.maps.MapboxExperimental public com.mapbox.maps.extension.style.light.generated.DirectionalLight shadowDrawBeforeLayer(com.mapbox.maps.extension.style.expressions.generated.Expression shadowDrawBeforeLayer);
70267034
method public com.mapbox.maps.extension.style.light.generated.DirectionalLight shadowIntensity(double shadowIntensity = 1.0);
70277035
method public com.mapbox.maps.extension.style.light.generated.DirectionalLight shadowIntensity(com.mapbox.maps.extension.style.expressions.generated.Expression shadowIntensity);
70287036
method public com.mapbox.maps.extension.style.light.generated.DirectionalLight shadowIntensityTransition(com.mapbox.maps.extension.style.types.StyleTransition options);

extension-style/api/extension-style.api

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5793,13 +5793,17 @@ public final class com/mapbox/maps/extension/style/light/generated/DirectionalLi
57935793
public final fun getIntensityAsExpression ()Lcom/mapbox/maps/extension/style/expressions/generated/Expression;
57945794
public final fun getIntensityTransition ()Lcom/mapbox/maps/extension/style/types/StyleTransition;
57955795
public fun getLightId ()Ljava/lang/String;
5796+
public final fun getShadowDrawBeforeLayer ()Ljava/lang/String;
5797+
public final fun getShadowDrawBeforeLayerAsExpression ()Lcom/mapbox/maps/extension/style/expressions/generated/Expression;
57965798
public final fun getShadowIntensity ()Ljava/lang/Double;
57975799
public final fun getShadowIntensityAsExpression ()Lcom/mapbox/maps/extension/style/expressions/generated/Expression;
57985800
public final fun getShadowIntensityTransition ()Lcom/mapbox/maps/extension/style/types/StyleTransition;
57995801
public fun intensity (D)Lcom/mapbox/maps/extension/style/light/generated/DirectionalLight;
58005802
public fun intensity (Lcom/mapbox/maps/extension/style/expressions/generated/Expression;)Lcom/mapbox/maps/extension/style/light/generated/DirectionalLight;
58015803
public fun intensityTransition (Lcom/mapbox/maps/extension/style/types/StyleTransition;)Lcom/mapbox/maps/extension/style/light/generated/DirectionalLight;
58025804
public fun intensityTransition (Lkotlin/jvm/functions/Function1;)Lcom/mapbox/maps/extension/style/light/generated/DirectionalLight;
5805+
public fun shadowDrawBeforeLayer (Lcom/mapbox/maps/extension/style/expressions/generated/Expression;)Lcom/mapbox/maps/extension/style/light/generated/DirectionalLight;
5806+
public fun shadowDrawBeforeLayer (Ljava/lang/String;)Lcom/mapbox/maps/extension/style/light/generated/DirectionalLight;
58035807
public fun shadowIntensity (D)Lcom/mapbox/maps/extension/style/light/generated/DirectionalLight;
58045808
public fun shadowIntensity (Lcom/mapbox/maps/extension/style/expressions/generated/Expression;)Lcom/mapbox/maps/extension/style/light/generated/DirectionalLight;
58055809
public fun shadowIntensityTransition (Lcom/mapbox/maps/extension/style/types/StyleTransition;)Lcom/mapbox/maps/extension/style/light/generated/DirectionalLight;
@@ -5824,6 +5828,8 @@ public abstract interface class com/mapbox/maps/extension/style/light/generated/
58245828
public abstract fun intensity (Lcom/mapbox/maps/extension/style/expressions/generated/Expression;)Lcom/mapbox/maps/extension/style/light/generated/DirectionalLight;
58255829
public abstract fun intensityTransition (Lcom/mapbox/maps/extension/style/types/StyleTransition;)Lcom/mapbox/maps/extension/style/light/generated/DirectionalLight;
58265830
public abstract fun intensityTransition (Lkotlin/jvm/functions/Function1;)Lcom/mapbox/maps/extension/style/light/generated/DirectionalLight;
5831+
public abstract fun shadowDrawBeforeLayer (Lcom/mapbox/maps/extension/style/expressions/generated/Expression;)Lcom/mapbox/maps/extension/style/light/generated/DirectionalLight;
5832+
public abstract fun shadowDrawBeforeLayer (Ljava/lang/String;)Lcom/mapbox/maps/extension/style/light/generated/DirectionalLight;
58275833
public abstract fun shadowIntensity (D)Lcom/mapbox/maps/extension/style/light/generated/DirectionalLight;
58285834
public abstract fun shadowIntensity (Lcom/mapbox/maps/extension/style/expressions/generated/Expression;)Lcom/mapbox/maps/extension/style/light/generated/DirectionalLight;
58295835
public abstract fun shadowIntensityTransition (Lcom/mapbox/maps/extension/style/types/StyleTransition;)Lcom/mapbox/maps/extension/style/light/generated/DirectionalLight;

0 commit comments

Comments
 (0)