Skip to content

Commit 5aa8ef6

Browse files
committed
Merge branch 'legend_zoom' of https://github.com/nikolai-b/leaflet into brclear
2 parents 586b8c4 + 770eb67 commit 5aa8ef6

File tree

3 files changed

+23
-19
lines changed

3 files changed

+23
-19
lines changed

inst/htmlwidgets/leaflet.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1844,7 +1844,7 @@ methods.addLegend = function (options) {
18441844
var leftDiv = (0, _jquery2.default)("<div/>").css("float", "left"),
18451845
rightDiv = (0, _jquery2.default)("<div/>").css("float", "left");
18461846
leftDiv.append(gradSpan);
1847-
(0, _jquery2.default)(div).append(leftDiv).append(rightDiv).append((0, _jquery2.default)("<br clear=\"both\"/>"));
1847+
(0, _jquery2.default)(div).append(leftDiv).append(rightDiv).append((0, _jquery2.default)("<br>"));
18481848

18491849
// Have to attach the div to the body at this early point, so that the
18501850
// svg text getComputedTextLength() actually works, below.
@@ -1892,7 +1892,7 @@ methods.addLegend = function (options) {
18921892
labels.push(options.na_label);
18931893
}
18941894
for (var i = 0; i < colors.length; i++) {
1895-
legendHTML += "<i style=\"background:" + colors[i] + ";opacity:" + options.opacity + "\"></i> " + labels[i] + "<br clear='both'/>";
1895+
legendHTML += "<i style=\"background:" + colors[i] + ";opacity:" + options.opacity + "\"></i> " + labels[i];
18961896
}
18971897
div.innerHTML = legendHTML;
18981898
}

inst/htmlwidgets/lib/leafletfix/leafletfix.css

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,31 @@ img.leaflet-tile {
66
border: none;
77
}
88
.info {
9-
padding: 6px 8px;
10-
font: 14px/16px Arial, Helvetica, sans-serif;
11-
background: white;
12-
background: rgba(255,255,255,0.8);
13-
box-shadow: 0 0 15px rgba(0,0,0,0.2);
14-
border-radius: 5px;
9+
padding: 6px 8px;
10+
font: 14px/16px Arial, Helvetica, sans-serif;
11+
background: white;
12+
background: rgba(255,255,255,0.8);
13+
box-shadow: 0 0 15px rgba(0,0,0,0.2);
14+
border-radius: 5px;
1515
}
1616
.legend {
17-
line-height: 18px;
18-
color: #555;
17+
line-height: 18px;
18+
color: #555;
1919
}
2020
.legend svg text {
21-
fill: #555;
21+
fill: #555;
2222
}
2323
.legend svg line {
24-
stroke: #555;
24+
stroke: #555;
2525
}
2626
.legend i {
27-
width: 18px;
28-
height: 18px;
29-
float: left;
30-
margin-right: 8px;
31-
opacity: 0.7;
27+
width: 18px;
28+
height: 18px;
29+
margin-right: 4px;
30+
opacity: 0.7;
31+
display: inline-block;
32+
vertical-align: top;
33+
/*For IE 7*/
34+
zoom: 1;
35+
*display: inline;
3236
}

javascript/src/methods.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ methods.addLegend = function(options) {
739739
rightDiv = $("<div/>").css("float", "left");
740740
leftDiv.append(gradSpan);
741741
$(div).append(leftDiv).append(rightDiv)
742-
.append($("<br clear=\"both\"/>"));
742+
.append($("<br>"));
743743

744744
// Have to attach the div to the body at this early point, so that the
745745
// svg text getComputedTextLength() actually works, below.
@@ -800,7 +800,7 @@ methods.addLegend = function(options) {
800800
}
801801
for (let i = 0; i < colors.length; i++) {
802802
legendHTML += "<i style=\"background:" + colors[i] + ";opacity:" +
803-
options.opacity + "\"></i> " + labels[i] + "<br clear='both'/>";
803+
options.opacity + "\"></i> " + labels[i];
804804
}
805805
div.innerHTML = legendHTML;
806806
}

0 commit comments

Comments
 (0)