Skip to content

Commit 8f5ea38

Browse files
committed
fixed extensions bug
1 parent b2fc9b0 commit 8f5ea38

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

R/misc_options.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ get_option_class = function(o, class = NULL, spatial_class = TRUE) {
1212

1313

1414
# add/merge options x to the full option set o: x can be style options
15-
complete_options = function(x, o) {
15+
complete_options = function(x, o, erase_style = TRUE) {
1616
nmx = names(x)
1717
nmo = names(o)
1818
if ("calls" %in% nmx) {
@@ -27,7 +27,7 @@ complete_options = function(x, o) {
2727
if (length(d)) o = c(o, x[d])
2828
if (length(e)) {
2929
for (i in e) {
30-
if (i %in% c("value.const", "value.na", "value.null", "value.blank", "values.var")) {
30+
if (i %in% c("value.const", "value.na", "value.null", "value.blank", "values.var") && erase_style) {
3131
# special case to cover the following issue
3232
# if o = list(value.const = list(fill = "red", fill.polygons = "blue", fill.dots = "black)), and
3333
# x = list(value.const = list(fill = "white", fill.polygons = "grey"))

R/tmap_options.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -638,13 +638,13 @@ tmapSubmitOptions = function(options = NULL, styleOptions = NULL) {
638638

639639
if (!is.null(options)) {
640640
backup = o[names(options)]
641-
o[names(options)] = complete_options(options, backup)
641+
o[names(options)] = complete_options(options, backup, erase_style = FALSE)
642642
}
643643

644644
if (!is.null(styleOptions)) {
645645
for (st in names(styleOptions)) {
646646
backup = s[[st]]
647-
s[[st]] = complete_options(styleOptions[[st]], backup)
647+
s[[st]] = complete_options(styleOptions[[st]], backup, erase_style = FALSE)
648648
}
649649
}
650650
.TMAP$defaultTmapOptions = o

0 commit comments

Comments
 (0)