setStyleLayerPropertyAsync

Sets a value to a style layer property asynchronously.

This method provides asynchronous argument parsing which is beneficial when working with large or complex style expressions that could block the main thread during parsing. The operation is performed on a background thread and the callback is invoked on the main thread once the operation completes.

Values will be applied asynchronously at some moment in the future. If multiple calls to this method are made, the corresponding values will be applied in the same order as the calls were made.

Note: This method should be used only if the given argument is a massive expression and its parsing would block the main thread otherwise. For simple property values, prefer the synchronous setStyleLayerProperty method.

If the style is modified during this asynchronous method call, the scheduled layer property change will still be applied as long as a layer with the original name and type still exists.

Return

A Cancelable object that can be used to cancel the asynchronous operation.

Parameters

layerId

A style layer identifier.

property

The style layer property name.

value

The style layer property value.

callback

Called once the request is complete or an error occurred.