This function allows a layer to be moved to a different z-position in an existing Mapbox GL or Maplibre GL map using a proxy object.
move_layer(proxy, layer_id, before_id = NULL)
The updated proxy object.
A proxy object created by mapboxgl_proxy
or maplibre_proxy
.
The ID of the layer to move.
The ID of an existing layer to insert the new layer before. Important: this means that the layer will appear immediately behind the layer defined in before_id
. If omitted, the layer will be appended to the end of the layers array and appear above all other layers.