Full-screen version in R?

The following code creates a brilliant application with (almost) the same output twice. One uses the rcharts package, the other uses a flyer package

The first card has a fullscreen button. Is this accessible via leaflet ()?

library(shiny)
library(rCharts)
library(leaflet)

runApp(

  ## UI ####
  list(ui = (basicPage(
    headerPanel("tests"),
    mainPanel(
      chartOutput("map1", "leaflet"),
      "some text...",
      leafletOutput('map2')
    )
  )),

  ## server ####
  server = function(input, output) {

    output$map1  <- renderMap({
      map1 <- Leaflet$new()
      map1$fullScreen(TRUE)
      map1$setView(c(39.603609, -8.415081), 10)
      map1
    })

    output$map2 <- renderLeaflet({
      leaflet() %>%
        addTiles() %>%
        setView(lng = -8.415081, lat = 39.603609, zoom = 10)
    })
    }
      ))

thanks

+4
source share
1 answer

There is a plugin for the javascript Leaflet library called Leaflet.Control.FullScreen .

However, this plugin is not yet implemented in the version of the R leaflet. I posted a function request on the leaflet Github page , but still haven't heard anything.

+1
source

Source: https://habr.com/ru/post/1625916/


All Articles