Skip to content

Commit

Permalink
#861 working again
Browse files Browse the repository at this point in the history
  • Loading branch information
mtennekes committed May 1, 2024
1 parent f3a3b94 commit 93554e8
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions R/tm_layers_lines.R
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ tm_lines = function(col = tm_const(),
v3_tm_legend_hide(layer_fun, arg = "legend.col.show", vv = "col")
lwd.legend = tm_legend_hide()
} else {
col.legend.args = list(title = v3_impute(args, "title.col", NA, "title"),
col.legend.args = alist(title = v3_impute(args, "title.col", NA, "title"),
na.show = v3_impute(args, "showNA", NA),
format = v3_impute(args, "legend.format", list(), "format"),
orientation = ifelse(v3_impute(args, "legend.col.is.portrait", TRUE, "orientation"), "portrait", "landscape"),
Expand All @@ -197,7 +197,7 @@ tm_lines = function(col = tm_const(),
v3_tm_legend_hide(layer_fun, arg = "legend.lwd.show", vv = "lwd")
lwd.legend = tm_legend_hide()
} else {
lwd.legend.args = list(title = v3_impute(args, "title.lwd", NA, "title"),
lwd.legend.args = alist(title = v3_impute(args, "title.lwd", NA, "title"),
na.show = v3_impute(args, "showNA", NA),
format = v3_impute(args, "legend.format", list(), "format"),
orientation = ifelse(v3_impute(args, "legend.lwd.is.portrait", FALSE), "portrait", "landscape"),
Expand Down
5 changes: 3 additions & 2 deletions R/tm_layers_polygons.R
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ tm_polygons = function(fill = tm_const(),
v3_tm_legend_hide(layer_fun, arg = "legend.show", vv = "fill")
fill.legend = tm_legend_hide()
} else {
fill.legend.args = list(title = v3_impute(args, "title", NA),
fill.legend.args = alist(title = v3_impute(args, "title", NA),
na.show = v3_impute(args, "showNA", NA, "na.show"),
format = v3_impute(args, "legend.format", list(), "format"),
orientation = ifelse(v3_impute(args, "legend.is.portrait", TRUE, "orientation"), "portrait", "landscape"),
Expand Down Expand Up @@ -327,10 +327,11 @@ tm_polygons = function(fill = tm_const(),
#' @export
tm_fill = function(...) {
args = list(...)
# tricks to make backward comp. work
if (!("col" %in% names(args))) {
args$col = NA
}
args$called_from = "tm_fill"
args$called_from = if (names(args)[1] == "") "tm_fill" else "tm_polygons"
do.call(tm_polygons, args)
}

Expand Down
2 changes: 1 addition & 1 deletion R/tm_layers_raster.R
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ tm_raster = function(col = tm_shape_vars(),
v3_tm_legend_hide(layer_fun, arg = "legend.show", vv = "col")
lwd.legend = tm_legend_hide()
} else {
col.legend.args = list(title = v3_impute(args, "title", NA, "title"),
col.legend.args = alist(title = v3_impute(args, "title", NA, "title"),
na.show = v3_impute(args, "showNA", NA),
format = v3_impute(args, "legend.format", list(), "format"),
orientation = ifelse(v3_impute(args, "legend.is.portrait", TRUE, "orientation"), "portrait", "landscape"),
Expand Down
6 changes: 3 additions & 3 deletions R/tm_layers_symbols.R
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ v3_symbols = function(args, args_called) {
v3_tm_legend_hide(layer_fun, arg = "legend.show", vv = "fill")
fill.legend = tm_legend_hide()
} else {
fill.legend.args = list(title = v3_impute(args, "title.col", NA, "title"),
fill.legend.args = list(atitle = v3_impute(args, "title.col", NA, "title"),
na.show = v3_impute(args, "showNA", NA, "na.show"),
format = v3_impute(args, "legend.format", list(), "format"),
orientation = ifelse(v3_impute(args, "legend.is.portrait", TRUE, "orientation"), "portrait", "landscape"),
Expand Down Expand Up @@ -410,7 +410,7 @@ v3_symbols = function(args, args_called) {
v3_tm_legend_hide(layer_fun, arg = "legend.size.show", vv = "size")
size.legend = tm_legend_hide()
} else {
size.legend.args = list(title = v3_impute(args, "title.size", NA, "title"),
size.legend.args = alist(title = v3_impute(args, "title.size", NA, "title"),
na.show = v3_impute(args, "showNA", NA),
format = v3_impute(args, "legend.format", list(), "format"),
orientation = ifelse(v3_impute(args, "legend.size.is.portrait", FALSE), "portrait", "landscape"),
Expand Down Expand Up @@ -460,7 +460,7 @@ v3_symbols = function(args, args_called) {
v3_tm_legend_hide(layer_fun, arg = "legend.shape.show", vv = "shape")
shape.legend = tm_legend_hide()
} else {
shape.legend.args = list(title = v3_impute(args, "title.shape", NA),
shape.legend.args = alist(title = v3_impute(args, "title.shape", NA),
na.show = v3_impute(args, "shape.showNA ", NA),
format = v3_impute(args, "legend.format", list(), "format"),
orientation = ifelse(v3_impute(args, "legend.shape.is.portrait", TRUE), "portrait", "landscape"),
Expand Down
4 changes: 2 additions & 2 deletions R/tm_layers_text.R
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ tm_text = function(text = tm_const(),
col.scale = do.call("tm_scale", args = col.scale.args)

v3_list_init()
col.legend.args = list(title = v3_impute(args, "title.col", NA, "title"),
col.legend.args = alist(title = v3_impute(args, "title.col", NA, "title"),
show = v3_impute(args, "legend.col.show", NULL, "show"),
na.show = v3_impute(args, "showNA", NA, "na.show"),
format = v3_impute(args, "legend.format", list(), "format"),
Expand Down Expand Up @@ -329,7 +329,7 @@ tm_text = function(text = tm_const(),


v3_list_init()
size.legend.args = list(title = v3_impute(args, "title.size", NA, "title"),
size.legend.args = alist(title = v3_impute(args, "title.size", NA, "title"),
show = v3_impute(args, "legend.size.show", NULL, "show"),
na.show = v3_impute(args, "showNA", NA, "na.show"),
format = v3_impute(args, "legend.format", list(), "format"),
Expand Down

0 comments on commit 93554e8

Please sign in to comment.