qfes / rdeck

Deck.gl widget for R
https://qfes.github.io/rdeck
MIT License
98 stars 0 forks source link

Fullscreen control #32

Open anthonynorth opened 3 years ago

anthonynorth commented 3 years ago

Add a map control to toggle fullscreen on & off for a single map.

pdbentley commented 7 months ago

Hey, realise this is an older post; here as an integrated solution using bslib which wraps the map in a container that can generate a full screen map:

library(rdeck)
library(bslib)

Sys.setenv("MAPBOX_ACCESS_TOKEN" = 'fruit-salad')
rdeck::mapbox_access_token()

card(fillable=T, full_screen = T, height = 300,

    rdeck(
             map_style = 'https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json',
             initial_view_state = view_state(center = c(146,-20), zoom =4),
             editor = F,
             layer_selector = TRUE
    )

)

So far have been using this approach in both quarto documents and shinyapps; works well in both.