Skip to content

Commit

Permalink
link leaflet to member
Browse files Browse the repository at this point in the history
  • Loading branch information
iramosgutierrez committed Jan 30, 2025
1 parent 9bff1c7 commit dd85b6d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions miembros.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,13 @@ readr::write_csv(coords.table, "institutioncoords.csv")
# combine both table by its affiliation and add coordinates (POINTS)
member.table.coords <- left_join(member.table, coords.table) |>
filter(!is.na(lon)) |>
st_as_sf(coords = c("lon", "lat"))
st_as_sf(coords = c("lon", "lat")) |>
mutate(weblink =paste0('<a href="',
'https://ecoinfaeet.github.io/new_website/miembros/',
gsub(" ", "_", `Nombre y apellidos`),
".html",
'" target="_blank">', `Nombre y apellidos`,
'</a>'))
# plot map
Expand All @@ -54,8 +60,8 @@ custom_icon <- makeIcon(
leaflet(member.table.coords) |>
addTiles() |>
addMarkers(popup = ~(Institución),
addTiles(options = providerTileOptions(noWrap = TRUE)) |>
addMarkers(popup = ~(weblink),
label = ~(`Nombre y apellidos`),
labelOptions = labelOptions(zoomAnimation = T),
clusterOptions = markerClusterOptions(),
Expand Down

0 comments on commit dd85b6d

Please sign in to comment.