Dragging Javascript errors
dcooley opened this issue · comments
Dave commented
related to #349, this seems to be happening again
e.g. - drag on the polygon
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
)
})
}
shiny::shinyApp(ui = ui, server = server)
Dave commented
I've disabled the drag
events on the master branch while this is investigated
Dave commented
In absence of a complete solution, I'm building a dragObject
function buildDragObject(info) {
var dragObject = {
coordinate: info.coordinate,
viewport: info.viewport,
x: info.x,
y: info.y
};
return(dragObject);
}
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_drag_start}, {
print(input$map_drag_start)
})
observeEvent({input$map_drag}, {
print(input$map_drag)
})
observeEvent({input$map_drag_end}, {
print(input$map_drag_end)
})
}
shiny::shinyApp(ui = ui, server = server)
Dave commented
merged in to master. Calling this a fix