Commit c869fadc by Jan Wijffels

update valuebox of comparison station

parent 7b17b6aa
...@@ -299,19 +299,22 @@ fillCol( ...@@ -299,19 +299,22 @@ fillCol(
```{r} ```{r}
renderValueBox({ renderValueBox({
## Triggers each time a user clicks on the leaflet app or when a user uploads new data ## Triggers each time a user clicks on the leaflet app or when a user uploads new data
input$uiOutput_select_station_marker_click
userdata <- citizenair_userdata() userdata <- citizenair_userdata()
userdata$nearest_station <- userdata$appdata$getComparisonStation() comparison_station <- input$uiOutput_select_station_marker_click
if(length(comparison_station) == 0){
comparison_station <- userdata$nearest_station
}
ui <- NULL
if(length(comparison_station) > 0){
stations <- userdata$appdata$getStations() stations <- userdata$appdata$getStations()
stations <- subset(stations, id %in% userdata$nearest_station) stations <- subset(stations, id %in% comparison_station)
if(nrow(stations) > 0){ if(nrow(stations) > 0){
txt <- stations$label txt <- stations$label
txt <- strsplit(txt, "-")[[1]] txt <- strsplit(txt, "-")[[1]]
txt <- trimws(txt) txt <- trimws(txt)
txt <- HTML(paste(txt, collapse = "<br>")) txt <- HTML(paste(txt, collapse = "<br>"))
ui <- valueBox(txt, caption = "Vergelijk met officieel meetstation") ui <- valueBox(txt, caption = "Vergelijk met officieel meetstation")
}else{ }
ui <- NULL
} }
ui ui
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment