Last active
February 7, 2016 17:04
-
-
Save aagarw30/709c46366910a5c8ce34 to your computer and use it in GitHub Desktop.
R Shiny and Leaflet # 3 - Demo of different types of base map tiles
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
library(leaflet) | |
shinyServer(function(input, output) { | |
output$mymap <- renderLeaflet({ | |
input$update # catching the action button event | |
isolate(leaflet() %>% | |
addProviderTiles(input$bmap)) | |
}) | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
library(leaflet) | |
shinyUI(bootstrapPage( | |
leafletOutput("mymap"), | |
absolutePanel(top = 25, right = 20, width = 150, draggable = TRUE, | |
selectInput("bmap", "Base map tile provider", choices = c("Stamen.Toner", | |
"CartoDB.Positron", | |
"Esri.WorldImagery", | |
"MapQuestOpen.OSM", | |
"Stamen.Watercolor"), | |
selected = "CartoDB.Positron"), | |
actionButton("update", "Update Map!")) | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment