A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/SymbolixAU/mapdeck/issues/322 below:

update_style() locks the zoom & location of map. · Issue #322 · SymbolixAU/mapdeck · GitHub

Describe the bug
I'm using update_style() along with an Rshiny selectInput() input to give the user the option to chance the background, but it seems to lock the zoom level and location of the map. I lose the ability to drag the map around with my mouse.

# ##############################################################################################
# ##############################################################################################
# # Sec 1a. Needed Libaries & Input Files

library(shiny)
library(shinydashboard)
library(mapdeck)
library(dplyr)

MapDeckStyleList <- c("dark", "light", "outdoors", "streets", "satellite", "satellite-streets")

##############################################################################################
##############################################################################################
#UI
ui <- dashboardPage(
  dashboardHeader(), 
  dashboardSidebar(
    selectInput(inputId="MapDeckBGInput",label="Background Layer", 
                choices=MapDeckStyleList, selected="dark")
    ), 
  dashboardBody(
    fluidRow(mapdeckOutput(outputId = 'mapA'))
  )
)

##############################################################################################
##############################################################################################
server <- function(input, output) {
  
  ##The MapDeck Token
  # key <- '## put your own token here ##'
  set_token(key) ## set your access token
  
  
  ### The Map
  output$mapA <- renderMapdeck({
    mapdeck()
  })
  
  
  ##Incremental Changes to the Map
  observe({
    mapdeck_update(map_id = 'mapA') %>%
      update_style(style = mapdeck_style(input$MapDeckBGInput))
  })
}

##############################################################################################
##############################################################################################
shinyApp(ui = ui, server = server)

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4