Skip to content

Instantly share code, notes, and snippets.

@cpsievert
Created March 28, 2019 15:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cpsievert/cfb21c7b38a78c7266c2a3f12e9587d9 to your computer and use it in GitHub Desktop.
Save cpsievert/cfb21c7b38a78c7266c2a3f12e9587d9 to your computer and use it in GitHub Desktop.
---
title: "Untitled"
output: html_document
runtime: shiny_prerendered
---
```{r}
library(leaflet)
leafletOutput("map")
```
```{r, context="server"}
output$map <- renderLeaflet({
addTiles(leaflet())
})
```
```{r, context="server"}
observe({
invalidateLater(500)
leafletProxy("map", session) %>%
addCircles(
rnorm(1, sd = 100),
rnorm(1, sd = 100),
layerId = "a"
)
})
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment