我正在尝试plotGoogleMap
在线嵌入一个闪亮的应用程序。该应用程序在本地运行良好,但通过上传shinyapps
到 shinyapps.io 时,.html 地图不会加载。
任何想法如何解决这个问题?
请参阅下面的代码。
用户界面
library('markdown')
library('shiny')
shinyUI(navbarPage("plotGooleMaps in shinyapps",
mainPanel(uiOutput('mymap'))
)
)
服务器.R
library('shiny')
library('plotGoogleMaps')
shinyServer(function(input, output){
output$mymap <- renderUI({
data(meuse)
coordinates(meuse) = ~x+y
proj4string(meuse) <- CRS("+init=epsg:28992")
m <- plotGoogleMaps(meuse, filename = 'myMap1.html', openMap = F)
tags$iframe(
srcdoc = paste(readLines('myMap1.html'), collapse = '\n'),
width = "900Px",
height = "500Px"
)
})
})
部署应用程序 shinyapps
library('shinyapps')
setwd("~/working directory where ui.R and server.R are located locally")
deployApp()
这是错误日志,但我不知道从中得出什么结论:
[blocked] The page at 'about:srcdoc' was loaded over HTTPS, but ran
insecure content from 'http://maps.google.com/maps/api/js?sensor=false':
this content should also be loaded over HTTPS. about:srcdoc:1
Uncaught ReferenceError: google is not defined about:srcdoc:21
GET https://chamaoskurumi.shinyapps.io/TESTmapSHINY
/_w_cf38cbc66a336eaf0ab8b4e184402cba949ec9bc0b5cc5c0/Legendf4d2427a4.png
404 (Not Found) about:srcdoc:3419
Uncaught ReferenceError: google is not defined about:srcdoc:1989
initializeabout:srcdoc:1989
onloadabout:srcdoc:3411