Skip to contents

Registers one or more filters for a layer. When multiple layers share the same bind, controls merge across layers by (bind, label, type).

Usage

add_filters(map, ..., id = NULL, bind = NULL, position = NULL, layer_id = NULL)

Arguments

map

A maplamina widget created by maplamina().

...

One or more filter_range() / filter_select() objects (or a single list of them).

id

Optional id used as a shorthand bind id when bind is omitted.

bind

Bind group id for shared UI control.

position

Optional UI position hint (applied to the control group).

layer_id

Target layer id (defaults to the most recently added layer).

Value

The modified map widget.

Examples

d <- data.frame(
  lon   = runif(1000, -60, 60),
  lat   = runif(1000, -60, 60),
  value = runif(1000, 1, 10)
)
maplamina() |>
  add_circles(d) |>
  add_filters(
    filter_range(~value, default = c(4, 6)),
    bind = "filters"
  )