-
-
Save ramnathv/275fe2a088e539f6b1ca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | |
) | |
}) | |
} | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi Ramnath,
using your code I tried to embed in Shiny this HTML document http://bl.ocks.org/zross/raw/6a31f4ef9e778d94c204/ containing leaflet JavaScript commands. The map is shown but the animation is not. Do you have any idea, why this is?
library("shiny")
runApp(list(
ui = pageWithSidebar(
headerPanel('Map'),
sidebarPanel(""),
mainPanel(uiOutput('mymap'))
),
server = function(input, output){
output$mymap <- renderUI({
tags$iframe(
srcdoc = paste(readLines('http://bl.ocks.org/zross/raw/6a31f4ef9e778d94c204/'), collapse = '\n'),
width = "100%",
height = "600px"
)
})
}
))
I would greatly appreciate any help!
Kind regards,
Jannes