Skip to content

Commit

Permalink
Task #18 - Adds more data types to map (WIP)
Browse files Browse the repository at this point in the history
  • Loading branch information
ccamara committed Jul 28, 2021
1 parent 50db6f5 commit 1484251
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 24 deletions.
21 changes: 14 additions & 7 deletions tulcea/tulcea_dashboard.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,14 @@ library(tidyverse)
library(wfenexus)
# Load data
salepoints_df <- read_csv("data/salepoints.csv")
salepoints_df <- read_csv("data/salepoints.csv") %>%
mutate(data_type = "Sale Points")
producers_df <- read.csv("data/producers.csv") %>%
mutate(data_type = "Producers")
combined_df <- salepoints_df %>%
full_join(producers_df)
# Colours
Expand Down Expand Up @@ -72,7 +79,7 @@ Interactive Map {data-icon="ion-map"}
=====================================

```{r}
sd <- SharedData$new(salepoints_df)
sd <- SharedData$new(combined_df)
```


Expand All @@ -84,10 +91,10 @@ Column {data-width=400}

```{r filters}
filter_select(
id = "type",
label = "Type",
id = "sel_data_type",
label = "Type of Point",
sharedData = sd,
group = ~type
group = ~data_type
)
bscols(
Expand Down Expand Up @@ -181,7 +188,7 @@ Column {.tabset .tabset-fade data-width=600}
### Interactive map

```{r}
groups <- c("Sale points")
groups <- c("Sale Points")
map <- leaflet(sd) %>%
addProviderTiles("CartoDB.Positron", group = "Positron (default)",
Expand All @@ -200,7 +207,7 @@ map <- leaflet(sd) %>%
# Adds controls
addLayersControl(
baseGroups = c("Positron (default)", "OSM", "Toner", "Toner Lite"),
overlayGroups = c("Sale Points", "Outline"),
overlayGroups = groups,
options = layersControlOptions(collapsed = TRUE)
) %>%
leaflet::addMeasure()
Expand Down
Loading

0 comments on commit 1484251

Please sign in to comment.