在R闪亮应用程序中将图标添加到传单easyButton时,actionButton图标消失
出于某种原因,将easyButtons添加到我的R Shining应用程序会导致actionButton中的图标消失。该应用程序基本上是一个带有面板的传单地图,用户可以在其中选择一些选项,将一些其他数据产品叠加在地图上。不确定发生了什么,雷普雷克斯如下:在R闪亮应用程序中将图标添加到传单easyButton时,actionButton图标消失,r,shiny,leaflet,icons,R,Shiny,Leaflet,Icons,出于某种原因,将easyButtons添加到我的R Shining应用程序会导致actionButton中的图标消失。该应用程序基本上是一个带有面板的传单地图,用户可以在其中选择一些选项,将一些其他数据产品叠加在地图上。不确定发生了什么,雷普雷克斯如下: shinyApp( ui = fluidPage( tabPanel('Map', div(class = 'outer', leafletOutp
shinyApp(
ui = fluidPage(
tabPanel('Map',
div(class = 'outer',
leafletOutput('Map', width = '1000px', height = '500px'),
absolutePanel(
id = 'controls',
class = 'panel panel-default',
fixed = TRUE,
draggable = FALSE,
top = 70, right = 20, left = 'auto', bottom = 'auto',
width = 330, height = 'auto',
h2('Example'),
br(),
actionButton('plot', 'Plot', icon = icon('map-marker'))
)
)
)
),
server = function(input, output, session) {
output$Map = renderLeaflet({
leaflet() %>%
addProviderTiles('Esri.WorldImagery') %>%
addEasyButton(
easyButton(id = 'edit-btn', states = list(
easyButtonState(
stateName = 'add-toolbar',
icon = icon('toggle-off'),
title = 'Edit',
onClick = JS("
function(btn, map) {
Shiny.onInputChange('edit_btn', 'TRUE');
btn.state('remove-toolbar');
}"
)
),
easyButtonState(
stateName = 'remove-toolbar',
icon = icon('toggle-on'),
title = 'Editing',
onClick = JS("
function(btn, map) {
Shiny.onInputChange('edit_btn', 'FALSE');
btn.state('add-toolbar');
}"
)
))
)
)
})
}
)
会话信息如下:
> sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17763)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] stringr_1.4.0 purrr_0.3.4 magrittr_2.0.1 dplyr_1.0.2
[5] sf_0.9-7 raster_3.4-5 sp_1.4-4 leaflet.extras_1.0.0
[9] leaflet_2.0.3 shinydashboard_0.7.1 shinyBS_0.61 shinyjs_2.0.0
[13] shiny_1.5.0
loaded via a namespace (and not attached):
[1] tidyselect_1.1.0 lattice_0.20-41 leaflet.providers_1.9.0 colorspace_2.0-0
[5] vctrs_0.3.5 generics_0.1.0 htmltools_0.5.0 viridisLite_0.3.0
[9] base64enc_0.1-3 yaml_2.2.1 rlang_0.4.9 e1071_1.7-4
[13] later_1.1.0.1 pillar_1.4.7 glue_1.4.2 withr_2.3.0
[17] DBI_1.1.0 RColorBrewer_1.1-2 lifecycle_0.2.0 munsell_0.5.0
[21] gtable_0.3.0 htmlwidgets_1.5.2 codetools_0.2-16 bs4Dash_0.5.0
[25] fastmap_1.0.1 httpuv_1.5.4 crosstalk_1.1.0.1 class_7.3-17
[29] Rcpp_1.0.5 KernSmooth_2.23-17 xtable_1.8-4 promises_1.1.1
[33] scales_1.1.1 classInt_0.4-3 jsonlite_1.7.1 mime_0.9
[37] farver_2.0.3 gridExtra_2.3 png_0.1-7 ggplot2_3.3.2
[41] digest_0.6.27 stringi_1.5.3 grid_4.0.3 rgdal_1.5-18
[45] tools_4.0.3 tibble_3.0.4 crayon_1.3.4 pkgconfig_2.0.3
[49] ellipsis_0.3.1 rstudioapi_0.13 viridis_0.5.1 R6_2.5.0
[53] units_0.6-7 compiler_4.0.3
截图:
似乎它可能特定于图标(“地图标记”)。其他图标似乎可以工作…似乎它可能特定于图标(“地图标记”)。其他图标似乎工作。。。