如何解决为什么在 R Shiny 中使用 Shinyscreenshot 包时,传单地图截图会损坏?
你能帮我吗?
我使用闪亮的、闪亮的仪表板、传单、闪亮的屏幕截图......包
ui.R
tags$div(
id = "main",style = "",tags$div(
class = "Box-body",leafletoutput("map",width=150,height=150)
)
)
server.R
observeEvent(input$go2,{
screenshot(
selector = "body",filename = "shinyscreenshot11",scale = 1,timer = 1
)})
output$map <- renderLeaflet({
leaflet() %>%
addTiles() %>%
setView(127.68110377512068,36.35494189163784,zoom = 6)%>%
addpolygons(data=data_map,color = 'black',weight = 1,stroke = T,fillOpacity = 0.5,label = vec_label,layerId = ~ CTPRVN_CD,#popup = vec_popup,#popupOptions = popupOptions(maxWidth ="100%",cloSEOnClick = TRUE),fillColor = ~pal_SIG_CD(CTPRVN_CD),highlight = highlightOptions(
weight = 2.5))%>%
addMinicharts(
mydata$lng,mydata$Lat,type = "bar",chartdata = mydata$VALUE,width = 20,height = 45
)})
global.R
library(shiny)
library(shinydashboard)
library(shinyjs)
library(shinyscreenshot)
library(leaflet)
library(leaflet.minicharts)
setwd("C:/Users/khoh/Desktop/R/nosaDataVisualization")
data_map<-shapefile("./CTPRVN_202101/TL_SCCO_CTPRVN.shp")
data_map = spTransform(data_map,CRSobj = CRS('+proj=longlat +datum=wgs84'))
test=read_excel("./test.xlsx")
mydata=as.data.frame(test)
mydata$Lat <- as.numeric(mydata$Lat)
mydata$lng <- as.numeric(mydata$lng)
截图结果:
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。