mages / googleVis

Interface between R and the Google Chart Tools
https://mages.github.io/googleVis/
360 stars 155 forks source link

gvisMap failing to load map in shinyapp on AWS #54

Open ghost opened 7 years ago

ghost commented 7 years ago

Hi, I have a shiny app which is using googleVis package in R. I am using gvisMap to plot some latlong. The app runs fine on my local machine without any issues but he same app loads the MAP for some seconds and than dis-appears citing a java script error: Google Maps API error: MissingKeyMapError.

I have gone through the googleVis documentation and there is no way to provide an API key. Can someone help me. Here is the code in R that is generating the the map output.

output$chart1 <- renderGvis({ if(input$state=="All"){ gvisMap(cplex_user_state, "latlong" , "num_users", options=list(showTip=TRUE, showLine=TRUE, enableScrollWheel=TRUE, mapType='terrain', useMapTypeControl=TRUE,width=600,height=400)) } else { gvisMap(filter(cplex_user_state,state==input$state), "latlong" , "num_users", options=list(showTip=TRUE, showLine=TRUE, enableScrollWheel=TRUE, mapType='terrain', useMapTypeControl=TRUE,width=600,height=400)) } })

mages commented 7 years ago

Can you please provide a self-contained minimal reproducible example.

On 3 February 2017 at 12:16, deep2843 notifications@github.com wrote:

Hi, I have a shiny app which is using googleVis package in R. I am using gvisMap to plot some latlong. The app runs fine on my local machine without any issues but he same app loads the MAP for some seconds and than dis-appears citing a java script error: Google Maps API error: MissingKeyMapError.

I have gone through the googleVis documentation and there is no way to provide an API key. Can someone help me. Here is the code in R that is generating the the map output.

output$chart1 <- renderGvis({ if(input$state=="All"){ gvisMap(cplex_user_state, "latlong" , "num_users", options=list(showTip=TRUE, showLine=TRUE, enableScrollWheel=TRUE, mapType='terrain', useMapTypeControl=TRUE,width=600,height=400)) } else { gvisMap(filter(cplex_user_state,state==input$state), "latlong" , "num_users", options=list(showTip=TRUE, showLine=TRUE, enableScrollWheel=TRUE, mapType='terrain', useMapTypeControl=TRUE,width=600,height=400)) } })

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mages/googleVis/issues/54, or mute the thread https://github.com/notifications/unsubscribe-auth/ABF-1c0-3fNkP8j78LEj8jhG8JUBF3Seks5rYxqfgaJpZM4L2Qyt .

jps-mads commented 7 years ago

I am having the same issue. Here is an example M1 <- gvisMap(Andrew, "LatLong" , "Tip", options=list(showTip=TRUE, showLine=TRUE, enableScrollWheel=TRUE, mapType='hybrid', useMapTypeControl=TRUE, width=800,height=400))

plot(M1)

jps-mads commented 7 years ago

The above is using data(Andrew) from library(googleVis)

mages commented 7 years ago

The above works fine for me. Can you please provide a self-contained minimal reproducible Shiny example.