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
stations <- userdata$appdata$getStations() if(length(comparison_station) == 0){
stations <- subset(stations, id %in% userdata$nearest_station) comparison_station <- userdata$nearest_station
if(nrow(stations) > 0){ }
txt <- stations$label ui <- NULL
txt <- strsplit(txt, "-")[[1]] if(length(comparison_station) > 0){
txt <- trimws(txt) stations <- userdata$appdata$getStations()
txt <- HTML(paste(txt, collapse = "<br>")) stations <- subset(stations, id %in% comparison_station)
ui <- valueBox(txt, caption = "Vergelijk met officieel meetstation") if(nrow(stations) > 0){
}else{ txt <- stations$label
ui <- NULL txt <- strsplit(txt, "-")[[1]]
txt <- trimws(txt)
txt <- HTML(paste(txt, collapse = "<br>"))
ui <- valueBox(txt, caption = "Vergelijk met officieel meetstation")
}
} }
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