Skip to content

Commit

Permalink
add in zoom functionality when sample is selected
Browse files Browse the repository at this point in the history
  • Loading branch information
Chuck Thompson authored and Chuck Thompson committed Oct 7, 2017
1 parent 449bd1f commit 7873368
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions leaflet.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ output$map <- renderLeaflet({
setView(lng = 14.815333, lat = 46.119944, zoom = 8)
})

observeEvent(input$uploadSampleData_row_last_clicked, {
x <- inputFileSamples()
selectedRow <- input$uploadSampleData_row_last_clicked

leafletProxy('map') %>%
setView(lng = x[selectedRow, 'lng'], lat = x[selectedRow, 'lat'], zoom = 10)

}, ignoreInit = TRUE)

# Add markers and lines for selected animals to map
observe({
PS <- PS()
Expand Down
2 changes: 1 addition & 1 deletion view_data.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
output$uploadSampleData <- renderDataTable({
x <- inputFileSamples()
DT::datatable(data = x, filter = "top", options = list(pageLength = 15))
DT::datatable(data = x, filter = "top", options = list(pageLength = 15), selection = 'single')
})

observe({
Expand Down

0 comments on commit 7873368

Please sign in to comment.