-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinteractive_map.Rmd
59 lines (49 loc) · 2.03 KB
/
interactive_map.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
---
title: "Kitsap Bike Parking Map"
output: html_document
date: "`r Sys.Date()`"
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
#kitsap-bike-parking
#Kitsap Bike Parking Interactive Map
#a crowdsourced map of places to park your bike in Kitsap County Washington
library(tidyverse)
dpath <- "https://raw.githubusercontent.com/monkeywithacupcake/kitsap-bike-parking/main/kitsap-bike-parking.csv"
ipath <- "https://raw.githubusercontent.com/monkeywithacupcake/kitsap-bike-parking/main/img/racks/"
bikeparking <- read_csv(dpath)
df <- bikeparking %>%
mutate(CIMG = if_else(!is.na(IMG), IMG, "no_img.png"),
POPUP = paste(sep = "<br/>",
paste0("<b>",NAME,"</b>"),
paste("Variant:", VARIANT),
paste("Covered?:", COVERED),
paste0("<img src = '", ipath, CIMG, "' width = 200>") #img
)
)
```
This map shows locations of bike parking in Kitsap County, Washington. We have `r nrow(bikeparking)` bike racks identified so far.
If you know of bike parking that is missing, submit an issue on github [kitsap-bike-parking](https://github.com/monkeywithacupcake/kitsap-bike-parking)
```{r}
library(leaflet)
leaflet(df) %>% addTiles(
options = tileOptions(minZoom = 9, maxZoom = 17)
) %>%
#addMarkers(lng = ~LNG, lat = ~LAT,
#popup = ~POPUP,
# clusterOptions = markerClusterOptions()
# ) %>%
addCircleMarkers(lng = ~LNG, lat = ~LAT, color = "#301934",
#label = ~NAME,
clusterOptions = markerClusterOptions(
maxClusterRadius = 30,
spiderLegPolylineOptions = list(weight = 1.5, color = "#222", opacity = 0.0),
zoomToBoundsOnClick = TRUE),
radius = 7, fillOpacity = 0.7, fillColor = "#D8BFD8",
popup = ~POPUP)
```
```{r}
library(formattable)
formattable(arrange(select(bikeparking, -IMG, -LAT, -LNG), NAME))
```
Data are from `r dpath`.