'Open new webpage or empty browser tab from existing UI
I have shiny UI already built . Now I added new button . after clicking that button I want it to open new page on browser . I just want to display my leaflet output , how can I do that? Here's my code below .
observeEvent(input$show_map_view,{
print(shapefile_output)
print("BELOW THIS")
logged_user <- Sys.info()[["user"]]
zip_shp <- (paste0("C:/Users/",logged_user,"/Downloads","/",input$enter_file_name,".zip"))
shp_1 <- paste0(input$enter_file_name,".shp")
setwd(paste0("C:/Users/",logged_user,"/Downloads","/"))
down_dir <- paste0("C:/Users/",logged_user,"/Downloads","/")
unzip(zip_shp, exdir = down_dir)
shpfile <- (paste0("C:/Users/",logged_user,"/Downloads","/",input$enter_file_name,".shp"))
cb_shp_map <- readOGR(shpfile)
print(cb_shp_map)
output$show_map <- renderLeaflet({
leaflet(data = cb_shp_map) %>%
addTiles() %>%
setView(lat = 10 , lng = 0, zoom = 10) %>%
addPolygons(fillColor = "green",
highlight = highlightOptions(weight = 5,
color = "red",
fillOpacity = 0.7,
bringToFront = TRUE),
label =~BLOCKID10)
})
})
ui.r (below)
ui <- dashboardPage(title = "MAPVIEW",
skin="blue",
header,
body=body,
sidebar = dashboardSidebar(disable = TRUE)
)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
