30 lines
660 B
R
30 lines
660 B
R
library("dplyr")
|
|
library("stringr")
|
|
library("sf")
|
|
library("leaflet")
|
|
library("htmltools")
|
|
library("htmlwidgets")
|
|
|
|
setwd("/home/francois/frigos_localisation")
|
|
|
|
frigo_table_sf <- read.csv("frigo_table.csv") %>%
|
|
st_as_sf(frigo_table3, coords = c("lon", "lat"))
|
|
|
|
if (file.exists("frigo_table_sf.geojson")){
|
|
file.remove("frigo_table_sf.geojson")
|
|
}
|
|
frigo_table_sf %>% write_sf("frigo_table_sf.geojson")
|
|
|
|
l <- leaflet(data = frigo_table_sf) %>%
|
|
addTiles() %>%
|
|
addMarkers(popup = ~paste0(
|
|
'<h2>',
|
|
Quoi,
|
|
'</h2><p>',
|
|
Adresse,
|
|
"</p>",
|
|
Particularités %>%
|
|
str_replace_all("\\n", "<br>")
|
|
))
|
|
|
|
saveWidget(l, file = "frigo_carte.html")
|