Skip to content

Commit

Permalink
finished showing of proper raster when user clicks on Disease outbrea…
Browse files Browse the repository at this point in the history
…k tab
  • Loading branch information
osalamon committed Oct 17, 2024
1 parent f70f88a commit e5e0fa7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
18 changes: 9 additions & 9 deletions app/logic/disease_outbreaks/disease_leaflet_map.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
box::use(
terra[rast, project],
leaflet[leaflet, addTiles, addRasterImage, setView, leafletProxy, removeImage]
leaflet[leaflet, addTiles, addRasterImage, setView, leafletProxy, removeImage, addRasterLegend, addLegend]
)

#' @export
Expand All @@ -25,14 +25,14 @@ disease_leaflet_map <- function(map_raster,
opacity = 0.9,
project = FALSE,
group = "Disease layer"
) |>
addRasterLegend(
map_raster,
opacity = 0.9,
position = "bottomright",
group = "Diseaselayer",
className = "info legend Diseaselayer"
)
) # |>
# addLegend(
# map_raster,
# opacity = 0.9,
# position = "bottomright",
# group = "Diseaselayer",
# className = "info legend Diseaselayer"
# )

return(leaflet_map)
}
4 changes: 2 additions & 2 deletions app/view/disease_outbreaks/disease_app/disease_app.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ disease_app_server <- function(id, tab_disease_selected) {
map() |>
disease_leaflet_map(
add_control = TRUE,
main_map_features = TRUE,
main_map_features = TRUE
) |>
leaflet_map()

# MAP itself ----
disease_map_server(
"disease_map",
leaflet_map = leaflet_map,
leaflet_map = leaflet_map
)
}
)
Expand Down
2 changes: 1 addition & 1 deletion app/view/disease_outbreaks/disease_app/disease_map.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
box::use(
shiny[NS, moduleServer, tags, observeEvent, reactive, actionButton, reactiveVal, checkboxInput, updateCheckboxInput],
shiny[NS, moduleServer, tags, observeEvent, reactive, actionButton, reactiveVal, checkboxInput, updateCheckboxInput, req],
bslib[card, card_header, card_body],
leaflet[setView, leaflet, leafletOptions, leafletOutput, renderLeaflet, addTiles, leafletProxy, addRasterImage, clearImages],
terra[rast, project],
Expand Down

0 comments on commit e5e0fa7

Please sign in to comment.