set_filter function

Set a filter on a map layer

Set a filter on a map layer

This function sets a filter on a map layer, working with both regular map objects and proxy objects.

set_filter(map, layer_id, filter)

Arguments

  • map: A map object created by the mapboxgl or maplibre function, or a proxy object.
  • layer_id: The ID of the layer to which the filter will be applied.
  • filter: The filter expression to apply.

Returns

The updated map object.

  • Maintainer: Kyle Walker
  • License: MIT + file LICENSE
  • Last published: 2025-03-18