-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsample_map.Rmd
97 lines (86 loc) · 4.94 KB
/
sample_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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
---
title: "<span style='font-size: 20px'>Zoom to see sample locations</style>"
---
```{r, echo = FALSE, message=FALSE, warning=FALSE, fig.width=10, fig.height=7}
library(leaflet)
library(rgdal)
library(dataRetrieval)
# grp <- c("USGS Topo", "USGS Imagery Only", "USGS Imagery Topo",
# "USGS Shaded Relief", "Hydrography")
#
# att <- paste0("<a href='https://www.usgs.gov/'>",
# "U.S. Geological Survey</a> | ",
# "<a href='https://www.usgs.gov/laws/policies_notices.html'>",
# "Policies</a>")
# GetURL <- function(service, host = "basemap.nationalmap.gov") {
# sprintf("https://%s/arcgis/services/%s/MapServer/WmsServer", host, service)
# }
sites <- read.csv("./sample_coords.csv")
# create specific icon for every type of point
icon.walleye <- makeAwesomeIcon(icon= 'flag', markerColor = 'blue', iconColor = 'black')
icon.darter <- makeAwesomeIcon(icon = 'flag', markerColor = 'red', iconColor = 'black')
icon.sculpin <- makeAwesomeIcon(icon = 'flag', markerColor = 'green', iconColor = 'black')
icon.smelt <- makeAwesomeIcon(icon = 'flag', markerColor = 'orange', iconColor = 'black')
icon.mysis <- makeAwesomeIcon(icon = 'flag', markerColor = 'cadetblue', iconColor = 'black')
icon.whitefish <- makeAwesomeIcon(icon = 'flag', markerColor = 'white', iconColor = 'black')
icon.smallmouth <- makeAwesomeIcon(icon = 'flag', markerColor = 'black', iconColor = 'red')
icon.sockeye <- makeAwesomeIcon(icon = 'flag', markerColor = 'firebrick', iconColor = 'black')
leaflet() %>%
addTiles() %>%
addAwesomeMarkers(data = sites[sites$species == "walleye",],
group = "walleye",
icon = icon.walleye,
label = ~as.character(species),
clusterOptions = markerClusterOptions(),
popup= paste(sep = "<br/>","Euclide et al. in prep",
"<b><a href='https://doi.org/10.1002/tafs.10215'>Chen et al. 2020</a></b>")) %>%
addAwesomeMarkers(data = sites[sites$species == "smallmouth bass",],
group = "smallmouth bass",
icon = icon.smallmouth,
label = ~as.character(species),
clusterOptions = markerClusterOptions(),
popup= "<b><a href='https://afspubs.onlinelibrary.wiley.com/doi/abs/10.1002/tafs.10238'>Euclide et al. 2020</a></b>") %>%
addAwesomeMarkers(data = sites[sites$species == "tessellated darters",],
group = "tessellated darters",
icon = icon.darter,
label = ~as.character(species),
clusterOptions = markerClusterOptions(),
popup='<b><a href="https://doi.org/10.1007/s10592-018-1107-2">Euclide & Marsden 2018</a></b>')%>%
addAwesomeMarkers(data = sites[sites$species == "slimy sculpin",],
group = "slimy sculpin",
icon = icon.sculpin,
label = ~as.character(species),
clusterOptions = markerClusterOptions(),
popup='<b><a href="https://doi.org/10.1111/eff.12385">Euclide et al. 2017</a></b>')%>%
addAwesomeMarkers(data = sites[sites$species == "rainbow smelt",],
group = "rainbow smelt",
icon = icon.smelt,
label = ~as.character(species),
clusterOptions = markerClusterOptions(),
popup= '<b><a href="https://doi.org/10.1016/j.jglr.2020.02.009">Euclide et al. 2020</a></b>')%>%
addAwesomeMarkers(data = sites[sites$species == "mysis",],
group = "mysis",
icon = icon.mysis,
label = ~as.character(species),
clusterOptions = markerClusterOptions(),
popup= paste(sep = "<br/>",
"<b><a href='10.1007/s10750-016-2982-5'>Euclide et al. 2017</a></b>",
"<b><a href='https://doi.org/10.1016/j.jglr.2015.05.002'>Euclide & Stockwell 2015</a></b>")) %>%
addAwesomeMarkers(data = sites[sites$species == "whitefish",],
group = "whitefish",
icon = icon.whitefish,
label = ~as.character(species),
clusterOptions = markerClusterOptions(),
popup= "<b><a href='https://doi.org/10.1016/j.jglr.2019.09.010'>Euclide et al. 2019</a></b>") %>%
addAwesomeMarkers(data = sites[sites$species == "sockeye salmon",],
group = "sockeye salmon",
icon = icon.sockeye,
label = ~as.character(species),
clusterOptions = markerClusterOptions(),
popup= "in progress research") %>%
addLayersControl(
overlayGroups = c("walleye", "tessellated darters", "rainbow smelt", "slimy sculpin", "mysis", "whitefish", "smallmouth bass",
"sockeye salmon"),
options = layersControlOptions(collapsed = FALSE), position = "topright"
)
```