Commit cf36f4ec by Jan Wijffels

Add selection of official station

parent c291b99e
...@@ -30,8 +30,8 @@ data("ca", package = "citizenair") ...@@ -30,8 +30,8 @@ data("ca", package = "citizenair")
dashinput <- list() dashinput <- list()
dashinput$endpoint <- as.Endpoint("http://geo.irceline.be/sos/api/v1") dashinput$endpoint <- as.Endpoint("http://geo.irceline.be/sos/api/v1")
#dashinput$appdata <- CitizenAir$new(endpoint = dashinput$endpoint)
dashinput$appdata <- ca dashinput$appdata <- ca
dashinput$appdata <- CitizenAir$new(endpoint = dashinput$endpoint)
dashinput$region <- subset(BE_ADMIN_REGION, TX_RGN_DESCR_NL %in% "Vlaams Gewest") dashinput$region <- subset(BE_ADMIN_REGION, TX_RGN_DESCR_NL %in% "Vlaams Gewest")
dashinput$stations_sp <- dashinput$appdata$getStations() dashinput$stations_sp <- dashinput$appdata$getStations()
dashinput$stations_sp <- dashinput$stations_sp[sapply(1:nrow(dashinput$stations_sp), dashinput$stations_sp <- dashinput$stations_sp[sapply(1:nrow(dashinput$stations_sp),
......
...@@ -33,7 +33,27 @@ g <- dyRangeSelector(g, height = 20) ...@@ -33,7 +33,27 @@ g <- dyRangeSelector(g, height = 20)
g g
``` ```
### Vergelijk met officieel meetstation
### Selecteer een officieel meetstation om te vergelijken
```{r}
leafletOutput("uiOutput_select_station", width = "100%", height = 400)
output$uiOutput_select_station <- renderLeaflet({
ca <- dashinput$appdata
stations <- ca$getStations()
map <- leaflet(data = stations)
map <- addTiles(map)
map <- addCircleMarkers(map = map, data = stations, radius = 5, opacity = 0.3, fillOpacity = 1, weight = 3,
layerId = stations$id,
popup = as.character(mapply(id = stations$id, label = stations$label, phenomena = stations$phenomena_label,
FUN=function(id, label, phenomena){
sprintf("<b>Station %s: %s</b> <br>Meetwaardes:<br> %s", id, label, paste(sprintf(" - %s ", phenomena), collapse = "<br>"))
})))
map
})
```
### Is mijn meettoestel correct ### Is mijn meettoestel correct
...@@ -85,5 +105,12 @@ renderUI({ ...@@ -85,5 +105,12 @@ renderUI({
} }
ui ui
}) })
```
###
```{r}
renderPrint({
input$uiOutput_select_station_marker_mouseover
})
``` ```
\ No newline at end of file
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