From 6c8de25d89f55060b84e78893979475f8724a703 Mon Sep 17 00:00:00 2001 From: mtennekes Date: Sun, 5 May 2024 21:08:25 +0200 Subject: [PATCH] fixed #871 and #872 --- R/tm_layers_polygons.R | 4 ++-- R/tm_layout.R | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/R/tm_layers_polygons.R b/R/tm_layers_polygons.R index ac648ef3..ed0206b0 100644 --- a/R/tm_layers_polygons.R +++ b/R/tm_layers_polygons.R @@ -132,7 +132,7 @@ tm_polygons = function(fill = tm_const(), layer_fun = if ("called_from" %in% names(args)) { args$called_from } else { - "polygons" + "tm_polygons" } v3_start_message() @@ -203,7 +203,7 @@ tm_polygons = function(fill = tm_const(), v3_convert2density(layer_fun) } - if ("col" %in% names(args_called) && (!args$called_from %in% c("tm_fill", "qtm"))) { + if ("col" %in% names(args_called) && (!layer_fun %in% c("tm_fill", "qtm"))) { fill = col col = tm_const() v3_message_col_fill(layer_fun = layer_fun) diff --git a/R/tm_layout.R b/R/tm_layout.R index a5481008..9c11e144 100644 --- a/R/tm_layout.R +++ b/R/tm_layout.R @@ -115,9 +115,9 @@ tm_layout = function( NULL } title2 = if (!is.null(main.title)) { - main.title.args = args[substr(names(args), 1, 5) == "main.title"] + main.title.args = args[substr(names(args), 1, 10) == "main.title"] main.title.args$main.title = NULL - names(main.title.args) = substr(names(main.title.args), 7, nchar(names(main.title.args))) + names(main.title.args) = substr(names(main.title.args), 12, nchar(names(main.title.args))) warning("The 'main.title' argument of 'tm_layout()' is deprecated as of tmap 4.0. Please use 'tm_title()' instead.", call. = FALSE) args$main.title = NULL do.call(tm_title, c(list(text = main.title), main.title.args))