Learn R Programming

toro (version 0.1.0)

add_control_group: Add a control group to a control panel

Description

Creates a collapsible group within a control panel that can contain multiple controls.

Usage

add_control_group(
  map,
  panel_id,
  group_id,
  group_title = NULL,
  collapsible = FALSE,
  collapsed = FALSE
)

Value

The map or map proxy object for chaining.

Arguments

map

The map or map proxy object.

panel_id

ID of the target control panel.

group_id

Unique identifier for the control group.

group_title

Title for the control group (optional).

collapsible

Whether the group can be collapsed. Default is FALSE.

collapsed

Initial collapsed state. Default is FALSE.

Examples

Run this code
map() |>
  add_control_panel(panel_id = "my_panel", direction = "row") |>
  add_control_group(
    panel_id = "my_panel",
    group_id = "group_1",
    group_title = "Group 1"
  ) |>
  add_control_group(
    panel_id = "my_panel",
    group_id = "group_2",
    group_title = "Group 2"
  ) |>
  add_cursor_coords_control(panel_id = "my_panel", group_id = "group_1") |>
  add_zoom_control(panel_id = "my_panel", group_id = "group_2")

map() |>
  add_control_panel(
    panel_id = "my_panel",
    title = "Map Settings",
    position = "top-right",
    collapsible = TRUE,
    collapsed = TRUE,
    direction = "row"
  ) |>
  add_cursor_coords_control(
    panel_id = "my_panel",
    section_title = "Cursor Coordinates"
  )

Run the code above in your browser using DataLab