Skip to content

Commit 6fdf2bd

Browse files
authored
remove method changed for scalebar (#547)
* remove method changed for scalebar * add news line about remove scalebar fix
1 parent c2f386f commit 6fdf2bd

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ leaflet 2.0.0.9000
44
BUG FIXES
55

66
* `.leaflet-map-pane` `z-index` switched to 'auto'. Allows for map panes to appear above the map if they appear later in the dom. (#537)
7+
* Use correct Leaflet.js scale control remove method (#547)
8+
79

810
leaflet 2.0.0
911
--------------------------------------------------------------------------------

inst/htmlwidgets/leaflet.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2058,7 +2058,7 @@ methods.addScaleBar = function (options) {
20582058

20592059
methods.removeScaleBar = function () {
20602060
if (this.currentScaleBar) {
2061-
this.currentScaleBar.removeFrom(this);
2061+
this.currentScaleBar.remove();
20622062
this.currentScaleBar = null;
20632063
}
20642064
};

javascript/src/methods.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,7 @@ methods.addScaleBar = function(options) {
896896

897897
methods.removeScaleBar = function() {
898898
if (this.currentScaleBar) {
899-
this.currentScaleBar.removeFrom(this);
899+
this.currentScaleBar.remove();
900900
this.currentScaleBar = null;
901901
}
902902
};

0 commit comments

Comments
 (0)