-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsoundmap.r
More file actions
34 lines (22 loc) · 915 Bytes
/
soundmap.r
File metadata and controls
34 lines (22 loc) · 915 Bytes
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
library(leaflet)
library(htmlwidgets) # saveWidget
dat <- read.csv2("soundmap.csv", fileEncoding="UTF-8-BOM")
dat$lat <- as.numeric(dat$lat)
dat$long <- as.numeric(dat$long)
# icons <- awesomeIcons(
# icon = 'tree-conifer',
# iconColor = 'black',
# library = 'glyphicon',
# markerColor = c("red", "orange", "beige", "green", "blue", "purple", "white", "gray", "pink", "lightgray", "black", "darkred", "lightred", "darkgreen", "lightgreen", "darkblue", "lightblue", "darkpurple", "cadetblue")[dat$Kategorie %>% factor]
# )
(m <- leaflet() %>%
addTiles() %>%
addAwesomeMarkers(lat=dat$lat, lng=dat$long, popup=
paste0(
dat$Kategorie,
"<h3>", dat$Titel, "</h3>",
"<p>", dat$Text, "</p>",
dat$Link),
# icon=icons,
clusterOptions = markerClusterOptions()))
saveWidget(m, file="soundmap.html", title="Chabacha's Soundmap")