Skip to content

Fullpage scrolling with map #9

@mschnetzer

Description

@mschnetzer

Hi,
first of all, thanks for the amazing implementation of fullPage in R!

I'd like to have a slide with a fullpage map where scrolling does not zoom but scroll to the next slide. To avoid zooming, I set the leaflet options. But scrolling to the next slide does not work. Is there any workaround?

Thanks a lot!!

Here is some example code:

library(shiny)
library(fullPage)
library(tmap)

data("World")

ui <- 
  fullPage::pagePiling(
    sections.color = c('#fff','#000', '#fff'),
    menu = c("Full Page" = "Link1",
             "Map" = "Map",
             "Another Full Page" = "Link2"),

    fullSection(menu = "Link1", center = TRUE, tags$h1("FULL PAGE 1")),

    fullSection(menu = "Map", tmapOutput("fpmap", width = "100%", height = "100%")),

    fullSection(menu = "Link2", center = TRUE, tags$h1("FULL PAGE 2"))
  )

server <- function(input, output, session) {
  
  output$fpmap <- renderTmap({
      tm_shape(World) +
      tm_view(set.view = c(11.57549, 56.13743, 4),
              control.position = c("right","bottom"),
              leaflet.options = list(minZoom=4, maxZoom=4,
                                     zoomControl = FALSE, dragging = FALSE,
                                     keyboard = FALSE)) +
      tm_polygons("HPI")
  })
}

shinyApp(ui = ui, server = server)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions