Skip to content

Commit f15492c

Browse files
authored
Merge pull request #425 from rstudio/joe/bugfix/na-opacity
Fix #424: incorrect opacity on NA entry in legend
2 parents 00bb41c + cc87111 commit f15492c

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ leaflet 1.1.1
77
* Fix bug with accessing columns in formulas when the data source is a Crosstalk
88
SharedData object wrapping a spatial data frame or sf object.
99

10+
* Fix incorrect opacity on NA entry in legend. (PR #425)
11+
1012
leaflet 1.1.0
1113
--------------------------------------------------------------------------------
1214

inst/htmlwidgets/leaflet.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1839,7 +1839,7 @@ methods.addLegend = function (options) {
18391839
});
18401840

18411841
if (options.na_color) {
1842-
(0, _jquery2.default)(div).append("<div><i style=\"background:" + options.na_color + "\"></i> " + options.na_label + "</div>");
1842+
(0, _jquery2.default)(div).append("<div><i style=\"background:" + options.na_color + ";opacity:" + options.opacity + ";\"></i> " + options.na_label + "</div>");
18431843
}
18441844
})();
18451845
} else {

javascript/src/methods.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,8 @@ methods.addLegend = function(options) {
774774

775775
if (options.na_color) {
776776
$(div).append("<div><i style=\"background:" + options.na_color +
777-
"\"></i> " + options.na_label + "</div>");
777+
";opacity:" + options.opacity +
778+
";\"></i> " + options.na_label + "</div>");
778779
}
779780
} else {
780781
if (options.na_color) {

0 commit comments

Comments
 (0)