r - .html plotGoogleMap does not load in shiny App when deployed on shinyapps.io -
i trying embed plotgooglemap
in shiny app online. locally app works perfectly, when uploading via shinyapps
shinyapps.io .html map not load.
any ideas how solve issue?
see code below.
ui.r
library('markdown') library('shiny') shinyui(navbarpage("plotgoolemaps in shinyapps", mainpanel(uioutput('mymap')) ) )
server.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" ) }) })
deploy app with shinyapps
library('shinyapps') setwd("~/working directory ui.r , server.r located locally") deployapp()
this error log dont know conclude it:
[blocked] page @ 'about:srcdoc' loaded on https, ran insecure content 'http://maps.google.com/maps/api/js?sensor=false': content should loaded on https. about:srcdoc:1 uncaught referenceerror: google not defined about:srcdoc:21 https://chamaoskurumi.shinyapps.io/testmapshiny /_w_cf38cbc66a336eaf0ab8b4e184402cba949ec9bc0b5cc5c0/legendf4d2427a4.png 404 (not found) about:srcdoc:3419 uncaught referenceerror: google not defined about:srcdoc:1989 initializeabout:srcdoc:1989 onloadabout:srcdoc:3411
someone on shinyapps forum solved issue. http
needs replaced https
in map file. codewise, means that:
readlines('mymap1.html')
needs replaced by
gsub("http://maps.google.com/", "https://maps.google.com/", readlines('mymap1.html'), fixed=true)
i contacted author fix in next update of plotgooglemaps
package. note legend not function, seems another issue
Comments
Post a Comment