diff --git a/R/tm_layers_lines.R b/R/tm_layers_lines.R index 3a5298c1..51f5e663 100644 --- a/R/tm_layers_lines.R +++ b/R/tm_layers_lines.R @@ -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"), @@ -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"), diff --git a/R/tm_layers_polygons.R b/R/tm_layers_polygons.R index fe270ed8..ac648ef3 100644 --- a/R/tm_layers_polygons.R +++ b/R/tm_layers_polygons.R @@ -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"), @@ -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) } diff --git a/R/tm_layers_raster.R b/R/tm_layers_raster.R index f95f1321..764be215 100644 --- a/R/tm_layers_raster.R +++ b/R/tm_layers_raster.R @@ -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"), diff --git a/R/tm_layers_symbols.R b/R/tm_layers_symbols.R index 64682ca1..f5ee7092 100644 --- a/R/tm_layers_symbols.R +++ b/R/tm_layers_symbols.R @@ -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"), @@ -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"), @@ -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"), diff --git a/R/tm_layers_text.R b/R/tm_layers_text.R index 5564f6a3..8e8e15fb 100644 --- a/R/tm_layers_text.R +++ b/R/tm_layers_text.R @@ -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"), @@ -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"),