From c70e662c9506293e158c6b9a55c091acb54594b1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Grelot?= <frederic.grelot@irstea.fr>
Date: Thu, 17 Feb 2022 16:40:39 +0100
Subject: [PATCH] so.ii Version 1.0.17.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

- map_so_ii
	- meilleure gestion des paramètres par défaut pour dataset_legend
---
 so.ii/DESCRIPTION   |  2 +-
 so.ii/R/map_so_ii.r | 10 ++++------
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/so.ii/DESCRIPTION b/so.ii/DESCRIPTION
index d645a8e..2a093be 100644
--- a/so.ii/DESCRIPTION
+++ b/so.ii/DESCRIPTION
@@ -1,6 +1,6 @@
 Package: so.ii
 Title: Utilities very useful to share within so_ii team
-Version: 1.0.16.0
+Version: 1.0.17.0
 Authors@R:
     c(
         person(given = "Frédéric",
diff --git a/so.ii/R/map_so_ii.r b/so.ii/R/map_so_ii.r
index 56fbf1f..865b173 100644
--- a/so.ii/R/map_so_ii.r
+++ b/so.ii/R/map_so_ii.r
@@ -160,12 +160,10 @@ map_so_ii = function(
 
     ## Plotdataset_legend if any
     if (!is.null(dataset_legend)) {
-        dataset_legend = c(
-            x = "bottomright",
-            cex = .8,
-            bg = "white",
-            inset = 0.01,
-            dataset_legend)
+        if (is.null(dataset_legend[["x"]])) dataset_legend[["x"]] = "bottomright"
+        if (is.null(dataset_legend[["cex"]])) dataset_legend[["cex"]] = 0.8
+        if (is.null(dataset_legend[["bg"]])) dataset_legend[["bg"]] = "white"
+        if (is.null(dataset_legend[["inset"]])) dataset_legend[["inset"]] = 0.01
         do.call(graphics::legend, dataset_legend)
     }
 
-- 
GitLab