setLayerZoomRange method

MapboxMap setLayerZoomRange(
  1. String layerId,
  2. num minzoom,
  3. num maxzoom
)

Sets the zoom extent for the specified style layer. The zoom extent includes the minimum zoom level and maximum zoom level) at which the layer will be rendered.

Note: For style layers using vector sources, style layers cannot be rendered at zoom levels lower than the minimum zoom level of the source layer because the data does not exist at those zoom levels. If the minimum zoom level of the source layer is higher than the minimum zoom level defined in the style layer, the style layer will not be rendered at all zoom levels in the zoom range.

@param {string} layerId The ID of the layer to which the zoom extent will be applied. @param {number} minzoom The minimum zoom to set (0-24). @param {number} maxzoom The maximum zoom to set (0-24). @returns {MapboxMap} this

@example map.setLayerZoomRange('my-layer', 2, 5);

Implementation

MapboxMap setLayerZoomRange(String layerId, num minzoom, num maxzoom) =>
    MapboxMap.fromJsObject(
        jsObject.setLayerZoomRange(layerId, minzoom, maxzoom));