You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Backport release/v0.17] feature state expression API (#8166)
Backport mapbox/mapbox-sdk#8049 to
`release/v0.17`.
cc @mapbox/maps-android
cc @mapbox/maps-ios
cc @mapbox/sdk-ci
Co-authored-by: Natig Babayev <[email protected]>
GitOrigin-RevId: e1a70ef455a6ecf4bee1767fce8a1dcb32d0ec11
* Make `line-emissive-strength` property data-driven.
17
+
* Add experimental `MapboxMap.setFeatureStateExpression()`, `removeFeatureStateExpression()`, and `resetFeatureStateExpressions()` APIs to efficiently update feature state for multiple features at once using expressions.
17
18
18
19
## Bug fixes 🐞
19
20
* Fix camera listener not unsubscribed when disabling ScaleBar via `updateSettings { enabled = false }`
Copy file name to clipboardExpand all lines: maps-sdk/api/maps-sdk.api
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -282,6 +282,7 @@ public final class com/mapbox/maps/MapboxMap : com/mapbox/maps/MapboxStyleManage
282
282
public fun removeFeatureState (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/mapbox/maps/FeatureStateOperationCallback;)Lcom/mapbox/common/Cancelable;
283
283
public static synthetic fun removeFeatureState$default (Lcom/mapbox/maps/MapboxMap;Lcom/mapbox/maps/interactions/FeaturesetFeature;Lcom/mapbox/maps/interactions/FeatureStateKey;Lcom/mapbox/maps/FeatureStateOperationCallback;ILjava/lang/Object;)Lcom/mapbox/common/Cancelable;
284
284
public static synthetic fun removeFeatureState$default (Lcom/mapbox/maps/MapboxMap;Lcom/mapbox/maps/interactions/TypedFeaturesetDescriptor;Lcom/mapbox/maps/FeaturesetFeatureId;Lcom/mapbox/maps/interactions/FeatureStateKey;Lcom/mapbox/maps/FeatureStateOperationCallback;ILjava/lang/Object;)Lcom/mapbox/common/Cancelable;
285
+
public fun removeFeatureStateExpression (ILcom/mapbox/maps/FeatureStateOperationCallback;)V
285
286
public fun removeOnCameraChangeListener (Lcom/mapbox/maps/plugin/delegates/listeners/OnCameraChangeListener;)V
286
287
public fun removeOnMapIdleListener (Lcom/mapbox/maps/plugin/delegates/listeners/OnMapIdleListener;)V
287
288
public fun removeOnMapLoadErrorListener (Lcom/mapbox/maps/plugin/delegates/listeners/OnMapLoadErrorListener;)V
@@ -295,6 +296,7 @@ public final class com/mapbox/maps/MapboxMap : com/mapbox/maps/MapboxStyleManage
295
296
public fun removeOnStyleImageMissingListener (Lcom/mapbox/maps/plugin/delegates/listeners/OnStyleImageMissingListener;)V
296
297
public fun removeOnStyleImageUnusedListener (Lcom/mapbox/maps/plugin/delegates/listeners/OnStyleImageUnusedListener;)V
297
298
public fun removeOnStyleLoadedListener (Lcom/mapbox/maps/plugin/delegates/listeners/OnStyleLoadedListener;)V
299
+
public fun resetFeatureStateExpressions (Lcom/mapbox/maps/FeatureStateOperationCallback;)V
298
300
public final fun resetFeatureStates (Lcom/mapbox/maps/interactions/TypedFeaturesetDescriptor;)Lcom/mapbox/common/Cancelable;
299
301
public final fun resetFeatureStates (Lcom/mapbox/maps/interactions/TypedFeaturesetDescriptor;Lcom/mapbox/maps/FeatureStateOperationCallback;)Lcom/mapbox/common/Cancelable;
300
302
public final fun resetFeatureStates (Ljava/lang/String;Lcom/mapbox/maps/FeatureStateOperationCallback;)Lcom/mapbox/common/Cancelable;
@@ -315,6 +317,7 @@ public final class com/mapbox/maps/MapboxMap : com/mapbox/maps/MapboxStyleManage
315
317
public fun setFeatureState (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/mapbox/bindgen/Value;Lcom/mapbox/maps/FeatureStateOperationCallback;)Lcom/mapbox/common/Cancelable;
316
318
public static synthetic fun setFeatureState$default (Lcom/mapbox/maps/MapboxMap;Lcom/mapbox/maps/interactions/FeaturesetFeature;Lcom/mapbox/maps/interactions/FeatureState;Lcom/mapbox/maps/FeatureStateOperationCallback;ILjava/lang/Object;)Lcom/mapbox/common/Cancelable;
317
319
public static synthetic fun setFeatureState$default (Lcom/mapbox/maps/MapboxMap;Lcom/mapbox/maps/interactions/TypedFeaturesetDescriptor;Lcom/mapbox/maps/FeaturesetFeatureId;Lcom/mapbox/maps/interactions/FeatureState;Lcom/mapbox/maps/FeatureStateOperationCallback;ILjava/lang/Object;)Lcom/mapbox/common/Cancelable;
320
+
public fun setFeatureStateExpression (ILcom/mapbox/maps/interactions/TypedFeaturesetDescriptor;Lcom/mapbox/bindgen/Value;Lcom/mapbox/maps/interactions/FeatureState;Lcom/mapbox/maps/FeatureStateOperationCallback;)V
318
321
public fun setGestureInProgress (Z)V
319
322
public fun setNorthOrientation (Lcom/mapbox/maps/NorthOrientation;)V
Copy file name to clipboardExpand all lines: maps-sdk/src/main/java/com/mapbox/maps/MapboxMap.kt
+75Lines changed: 75 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -2913,6 +2913,81 @@ class MapboxMap :
2913
2913
}
2914
2914
}
2915
2915
2916
+
/**
2917
+
* Sets a feature state expression that applies to features within the specified featureset.
2918
+
*
2919
+
* All feature states with expressions that evaluate to true will be applied to the feature.
2920
+
* Feature states from later added feature state expressions have higher priority. Regular feature states have higher priority than feature state expressions.
2921
+
* The final feature state is determined by applying states in order from lower to higher priority. As a result, multiple expressions that set states with different keys can affect the same features simultaneously.
2922
+
* If an expression is added for a feature set, properties from that feature set are used, not the properties from original sources.
2923
+
*
2924
+
* Note that updates to feature state expressions are asynchronous, so changes made by this method might not be
2925
+
* immediately visible and will have some delay. The displayed data will not be affected immediately.
2926
+
*
2927
+
* @param featureStateExpressionId Unique identifier for the state expression.
2928
+
* @param featureset The featureset descriptor that specifies which featureset the expression applies to.
2929
+
* @param expression The expression to evaluate for the state. Should return boolean.
2930
+
* @param state The `state` object with properties to update with their respective new values.
2931
+
* @param callback The `feature state operation callback` called when the operation completes.
0 commit comments