Skip to content

Instantly share code, notes, and snippets.

@aagarw30
Last active January 23, 2016 08:05
Show Gist options
  • Save aagarw30/77c51ead64d62964f941 to your computer and use it in GitHub Desktop.
Save aagarw30/77c51ead64d62964f941 to your computer and use it in GitHub Desktop.
R Shiny and Leaflet # 6 - Mapping my birth location - Demo addPopups() with minimal reproducible example
library(shiny)
library(leaflet)
shinyServer(function(input, output) {
output$mymap <- renderLeaflet({
# define the leaflet map object
leaflet() %>%
addTiles() %>%
setView(lng = 82.9739144,lat = 25.3176452, zoom = 2) %>%
# Add a pop up to map by using addPopups() function
addPopups(lng = 82.9739144, lat = 25.3176452, popup = "Varanasi - My Birth Place")
})
})
library(shiny)
library(leaflet)
shinyUI(fluidPage(
leafletOutput("mymap")
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment