Brilliant Story: GoogleMaps Internet Explorer vs Chrome

I am trying to get plotGoogleMaps when using Shiny running in Internet Explorer as well as in Google Chrome, and wondered what I need to do to fix this.

The code I use uses the answer for another question

The code works when Chrome is the browser, but does not work when IE is the browser.

Repeat the code again:

library(plotGoogleMaps) library(shiny) runApp(list( ui = pageWithSidebar( headerPanel('Map'), sidebarPanel(""), mainPanel(uiOutput('mymap')) ), server = 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 = "100%", height = "600px" ) }) } )) 

Given that the file was created, I think this is probably a download problem.

As always, any help would be greatly appreciated.

+7
google-chrome internet-explorer r shiny
source share
1 answer

Your problem is not in R, shiny or plotGoogleMaps, but in IE support for the html5 standard. IE support for srcdoc is not good, read this link. You can use polyfill to support IE, but I don’t think it is necessary, since you already create the necessary html file in the plotGoogleMaps step.

Try using the following code. Instead of providing an iframe srcdoc, I use the src property. Also google map html is created in the www directory, so brilliant will be able to see it. I did this in IE 11. I think it should work in IE10.

I changed my answer to the usual brilliant solution for applications, as it seems that problems with a single file are also a problem. This is a link to shinyapps . And see also modern.ie screenshots and all IE screenshots here ,

ui.R

 library(plotGoogleMaps) library(shiny) shinyUI(fluidPage( pageWithSidebar( headerPanel('Map'), sidebarPanel(""), mainPanel(uiOutput('mymap')) ) )) 

server.R

 library(plotGoogleMaps) library(shiny) shinyServer(function(input, output) { if (!file.exists("www")) { dir.create("www") } output$mymap <- renderUI({ data(meuse) coordinates(meuse) = ~x+y proj4string(meuse) <- CRS("+init=epsg:28992") m <- plotGoogleMaps(meuse, filename = 'www/myMap1.html', openMap = F) tags$iframe( src = 'myMap1.html', width = "100%", height = "600px" ) }) }) 
+4
source share

All Articles