Description Usage Arguments Value Examples
View source: R/leafletmap_module.R
Leaflet map module, Server logic
1 2 3 4 5 6 7 8 9 10 | leafletMap(
input,
output,
session,
data,
date_col = "datetime",
points_col = "person_id",
v_anim = 24,
traj_col = "trajectory_id"
)
|
data |
A Dataframe, is supposed to contains "lat" and "lng" cols, otherwise things won't work |
date_col |
Chr. Name of the column identifying Date time reference. |
points_col |
Chr.Name of the colum of the Points in the map. (circles) The trajectories(polylines) are always represented with respect to this column reference. |
v_anim |
num. Speed of the time animation. |
traj_col |
Column idenifying the trajectories |
A shiny Module
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | require(shiny)
require(dplyr)
if(interactive()) {
df <- feather::read_feather("C://Users//Utente//Desktop//Maputo//transport_mode_detection//data_speed_acc_new.feather") %>%
slice(1:100)
df <- rename(df, time = datetime, pid = person_id, tid = trajectory_id,)
ui <- fluidPage(
leafletMapUi("map")
)
server <- function(input, output, session) {
callModule(leafletMap, "map", data = df, v_anim = 1, date_col = "time", points_col = "pid", traj_col = "tid")
}
shinyApp(ui, server)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.