Closed tomroh closed 11 months ago
@marcusyoung, Regex considers "_" to be an alphanumeric character which is why it was not being cleansed for use with the javascript functionality.
When I first read this thread I thought that was the issue and changed the group name just to a string with no special characters or spaces. Unfortunately that did not fix the problem.
I can't reproduce that error. Changing underscore to "*" or removing all together both works for me.
bf058cc0cbd347b391ef8a4dbe4bd07c361e6343
When I first read this thread I thought that was the issue and changed the group name just to a string with no special characters or spaces. Unfortunately that did not fix the problem.
I isolated with this (on the "dev" branch now).
library(shiny)
library(leaflet)
library(leaflegend)
data(quakes)
ui <- fluidPage(
sidebarLayout(
sidebarPanel(
checkboxInput('check', 'Show/Hide', value = TRUE)
),
mainPanel(
leaflet::leafletOutput('map')
)
)
)
server <- function(input, output) {
output$map <- leaflet::renderLeaflet({
binPal <- colorBin('Set1', quakes$mag)
leaflet() %>%
addTiles() %>%
addMarkers(data = quakes, group = 'mg_aadf_edges') %>%
addLegendBin(
pal = binPal,
values = quakes$mag,
position = 'bottomleft',
title = 'addLegendBin',
group = 'mg_aadf_edges'
) %>%
addLayersControl(overlayGroups = c('mg_aadf_edges'),
position = 'bottomright'
)
})
observe({
if (input$check) {
leafletProxy('map') |>
showGroup('mg_aadf_edges')
} else {
leafletProxy('map') |>
hideGroup('mg_aadf_edges')
}
})
}
shinyApp(ui = ui, server = server)