Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/symbolixau/mapdeck
Browse files Browse the repository at this point in the history
:wq# especially if it merges an updated upstream into a topic branch.
  • Loading branch information
dcooley committed Mar 27, 2024
2 parents dedbdbf + 01870a6 commit 0db39c5
Show file tree
Hide file tree
Showing 46 changed files with 188 additions and 788 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@
^vignettes/trips.Rmd
.github
^\.github$
^CRAN-SUBMISSION$
39 changes: 17 additions & 22 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: mapdeck
Type: Package
Title: Interactive Maps Using 'Mapbox GL JS' and 'Deck.gl'
Version: 0.3.40006
Date: 2024-01-04
Version: 0.3.5
Date: 2024-01-29
Authors@R: c(
person("David", "Cooley", ,"[email protected]", role = c("aut", "cre"))
)
Expand All @@ -16,17 +16,29 @@ BugReports: https://github.com/SymbolixAU/mapdeck/issues
Encoding: UTF-8
LazyData: true
Depends: R (>= 3.5.0)
SystemRequirements: C++14
Imports:
colourvalues (>= 0.3.8),
colourvalues (>= 0.3.9),
googlePolylines (>= 0.7.2),
geojsonsf (>= 1.3.3),
geojsonsf (>= 2.0.3),
htmlwidgets,
jsonify (>= 1.1.1),
jsonify (>= 1.2.2),
magrittr,
Rcpp (>= 1.0.10),
shiny,
sfheaders (>= 0.4.4)
RoxygenNote: 7.2.3
LinkingTo:
BH,
colourvalues (>= 0.3.9),
geojsonsf (>= 2.0.3),
geometries (>= 0.2.4),
interleave (>= 0.1.2),
jsonify (>= 1.2.2),
rapidjsonr,
Rcpp (>= 1.0.10),
sfheaders (>= 0.4.4),
spatialwidget (>= 0.2.5)
Suggests:
covr,
googleway,
Expand All @@ -36,20 +48,3 @@ Suggests:
spatialwidget,
testthat
VignetteBuilder: knitr
LinkingTo:
BH,
colourvalues (>= 0.3.8),
geojsonsf (>= 1.3.3),
geometries (>= 0.2.4),
interleave (>= 0.1.2),
jsonify (>= 1.1.1),
rapidjsonr,
Rcpp (>= 1.0.10),
sfheaders (>= 0.4.2),
spatialwidget (>= 0.2.5)
Remotes:
dcooley/geometries,
dcooley/interleave,
dcooley/sfheaders,
SymbolixAU/geojsonsf,
SymbolixAU/spatialwidget
4 changes: 4 additions & 0 deletions R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,7 @@
#'
"city_trail"

#' road_safety
#'
#' A data.frame of counts of traffic accidents in the UK
"road_safety"
10 changes: 2 additions & 8 deletions R/map_layer_h3.R
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ add_h3 <- function(
legend_format = NULL,
update_view = TRUE,
focus_layer = FALSE,
digits = 6,
transitions = NULL
) {

Expand Down Expand Up @@ -146,11 +145,6 @@ add_h3 <- function(
l[["data"]] <- NULL
}

# if( !is.null(l[["bbox"]] ) ) {
# bbox <- l[["bbox"]]
# l[["bbox"]] <- NULL
# }

checkHexAlpha(highlight_colour)
layer_id <- layerId(layer_id, "h3")

Expand All @@ -162,9 +156,9 @@ add_h3 <- function(
jsfunc <- "add_h3_hexagon_geo"

geometry_column <- "hexagon"
shape <- rcpp_point_polyline( data, l, geometry_column, "h3_hexagon")

#return(shape)
## use 'polyline' method because we have strings (cells), not lat/lon coordinates
shape <- rcpp_point_polyline( data, l, geometry_column, "h3_hexagon")

jsfunc <- "add_h3_hexagon"

Expand Down
6 changes: 3 additions & 3 deletions R/map_layer_mesh.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ find_mesh_index <- function( data ) {
#' m <- melbourne_mesh
#' m$vb[3, ] <- m$vb[3, ] * 50
#'
#'mapdeck() %>%
#' mapdeck() %>%
#' add_mesh(
#' data = m
#' )
Expand Down Expand Up @@ -74,8 +74,8 @@ add_mesh <- function(
brush_radius = NULL
) {

if( nrow( data ) == 0 ) {
return( clear_mesh( map, layer_id, ... ) )
if( length( data ) == 0 ) {
return( clear_mesh( map = map, layer_id = layer_id, update_view = update_view, clear_legend = clear_legend ) )
}

experimental_layer( "mesh" )
Expand Down
2 changes: 1 addition & 1 deletion R/map_layer_path.R
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ mapdeckPathDependency <- function() {
#' , y = "y"
#' , linestring_id = "id"
#' , list_columns = "col"
#' , keep = T
#' , keep = TRUE
#' )
#'
#' mapdeck(
Expand Down
2 changes: 2 additions & 0 deletions R/map_layer_scatterplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ mapdeckScatterplotDependency <- function() {
#' small for the given zoom level
#' @param radius_max_pixels the maximum radius in pixels. Can prevent the circle from
#' getting too big when zoomed in
#' @param collision_filter set to `TRUE` if you want to hide features that overlap
#' other features. Default is `FALSE`
#'
#' @inheritSection add_polygon data
#' @inheritSection add_arc legend
Expand Down
2 changes: 1 addition & 1 deletion R/map_layer_terrain.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ mapdeckTerrainDependency <- function() {
#'
#' @inheritParams add_arc
#' @param elevation_data Image URL that encodes height data. When \code{elevation_data}
#' is a URL template, i.e. a string containing '{x}' and '{y}', it loads terrain tiles on demand
#' is a URL template, i.e. a string containing `\{x\}` and `\{y\}`, it loads terrain tiles on demand
#' and renders a mesh for each tile. If \code{elevation_data} is an absolute URL, as ingle mesh is used,
#' and the \code{bounds} argument is required to position it into the world space.
#' @param texture Image URL to use as the texture
Expand Down
2 changes: 1 addition & 1 deletion R/map_layer_tile3d.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ mapdeckTile3DDependency <- function() {
#' Add Cesium
#'
#' Renders 3D tiles data from Cesium ION assets. To use this layer you need a
#' Cesium ION account \url{https://cesium.com/docs/tutorials/getting-started/#your-first-app}.
#' Cesium ION account \url{https://cesium.com/learn/cesiumjs-learn/cesiumjs-quickstart/#your-first-app}.
#' This layer is experimental
#'
#' @inheritParams add_pointcloud
Expand Down
1 change: 0 additions & 1 deletion R/map_layer_trips.R
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ add_trips <- function(

#' @rdname clear
#' @export

clear_trips <- function( map, layer_id = NULL, update_view = TRUE, clear_legend = TRUE) {
layer_id <- layerId(layer_id, "trips")
## TRIPS needs to be stopped first
Expand Down
Loading

0 comments on commit 0db39c5

Please sign in to comment.