google_map-shiny: Shiny bindings for google_map

Description Usage Arguments Examples

Description

Output and render functions for using google_map within Shiny applications and interactive Rmd documents.

Usage

1
2
3
google_mapOutput(outputId, width = "100%", height = "400px")

renderGoogle_map(expr, env = parent.frame(), quoted = FALSE)

Arguments

outputId

output variable to read from

width, height

Must be a valid CSS unit (like '100%', '400px', 'auto') or a number, which will be coerced to a string and have 'px' appended.

expr

An expression that generates a google_map

env

The environment in which to evaluate expr.

quoted

Is expr a quoted expression (with quote())? This is useful if you want to save an expression in a variable.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
## Not run: 
library(shiny)
library(googleway)

ui <- fluidPage(google_mapOutput("map"))

server <- function(input, output, session){

  api_key <- "your_api_key"

  output$map <- renderGoogle_map({
    google_map(key = api_key)
  })
}

shinyApp(ui, server)

## using split view

library(shinydashboard)
library(googleway)

ui <- dashboardPage(

  dashboardHeader(),
  dashboardSidebar(),
  dashboardBody(
    box(width = 6,
        google_mapOutput(outputId = "map")
    ),
    box(width = 6,
        google_mapOutput(outputId = "pano")
    )
  )
)

server <- function(input, output) {
  #set_key("your_api_key")

  output$map <- renderGoogle_map({
    google_map(location = c(-37.817386, 144.967463),
                zoom = 10,
                split_view = "pano")
  })
}

shinyApp(ui, server)


## End(Not run)

googleway documentation built on Nov. 16, 2020, 9:08 a.m.