moveLayer method

MapboxMap moveLayer(
  1. String id,
  2. String beforeId
)

Moves a layer to a different z-position.

@param {string} id The ID of the layer to move. @param {string} beforeId The ID of an existing layer to insert the new layer before. If this argument is omitted, the layer will be appended to the end of the layers array. @returns {MapboxMap} this

@example // Move a layer with ID 'label' before the layer with ID 'waterways'. map.moveLayer('label', 'waterways');

Implementation

MapboxMap moveLayer(String id, String beforeId) =>
    MapboxMap.fromJsObject(jsObject.moveLayer(id, beforeId));