apply_default_leaflet_behavior
is a helper function that provides consistent default behavior for leaflet maps
when handling selection events. It manages popup display and map navigation
based on the selection state.
apply_default_leaflet_behavior(map_proxy, selected_data, component_info)
Returns the modified map proxy object with updated view and popups
A leaflet map proxy object used to update the map
A data frame or list containing the selected row/item data. If NULL, indicates deselection occurred.
A list containing component configuration information:
Character. Name of the column containing unique identifiers
List containing:
Character. Name of the longitude column
Character. Name of the latitude column
Numeric. Zoom level to use when highlighting selection
When selected_data
is provided:
Creates a popup with "Selected" header and ID information
Sets map view to the selected location coordinates
Applies the configured highlight zoom level
When selected_data
is NULL (deselection):
Removes all existing popups from the map