Skip to content

Commit

Permalink
update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
trafficonese committed Sep 1, 2024
1 parent fe2197b commit 81a1709
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 1 deletion.
19 changes: 19 additions & 0 deletions R/buildings.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@ addBuildings <- function(
#' @param time a timestamp that can be converted to POSIXct
#' @family OSM-Buildings Plugin
#' @export
#' @examples
#' library(leaflet)
#' library(leaflet.extras2)
#'
#' leaflet() %>%
#' addTiles() %>%
#' addBuildings() %>%
#' updateBuildingTime(as.POSIXct("2024-09-01 19:00:00 CET")) %>%
#' setView(13.40, 52.51836,15)
updateBuildingTime <- function(map, time) {
invokeMethod(map, NULL, "updateBuildingTime", time)
}
Expand All @@ -80,6 +89,16 @@ updateBuildingTime <- function(map, time) {
#' @param style A named list of styles
#' @family OSM-Buildings Plugin
#' @export
#' @examples
#' library(leaflet)
#' library(leaflet.extras2)
#'
#' style <- list(color = "#0000ff", wallColor = "gray", roofColor = "orange", shadows = TRUE)
#' leaflet() %>%
#' addTiles() %>%
#' addBuildings() %>%
#' setBuildingStyle(style) %>%
#' setView(13.40, 52.51836,15)
setBuildingStyle <- function(map, style = list(color = "#ffcc00",
wallColor = "#ffcc00",
roofColor = "orange",
Expand Down
2 changes: 1 addition & 1 deletion inst/examples/leafletsync/sync_basic.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ server <- function(input, output, session) {
})
output$map2 <- renderLeaflet({
leaflet() %>%
addProviderTiles(provider = "Stamen") %>%
addProviderTiles(provider = "CartoDB") %>%
addCircleMarkers(data = df, color = "orange")
})
output$map3 <- renderLeaflet({
Expand Down
11 changes: 11 additions & 0 deletions man/setBuildingStyle.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions man/updateBuildingTime.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 81a1709

Please sign in to comment.