mapdeck icon indicating copy to clipboard operation
mapdeck copied to clipboard

Click-event circular references

Open dcooley opened this issue 1 year ago • 0 comments

https://github.com/SymbolixAU/mapdeck/issues/364 is now happening with click-events

library(shinydashboard)
library(mapdeck)
library(sf)
set_token(secret::get_secret("MAPBOX"))

ui <- shinydashboard::dashboardPage(
	header = shinydashboard::dashboardHeader()
	, body = shinydashboard::dashboardBody(
		mapdeck::mapdeckOutput(
			outputId = "map"
		)
	)
	, sidebar = shinydashboard::dashboardSidebar()
)

server <- function(input, output, session) {
	
	nc <- sf::st_read(system.file("shape/nc.shp", package = "sf"))
	
	output$map <- mapdeck::renderMapdeck({
		
		mapdeck::mapdeck() %>%
			add_polygon(
				data = nc		
			)
	})
	
	observeEvent({input$map_polygon_click}, {
		print(input$map_polygon_click)
	})
	
}

shiny::shinyApp(ui = ui, server = server)

dcooley avatar Oct 02 '24 22:10 dcooley