From 6fdf2bd46a3b5eaba3a64da09b97e89235e39223 Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Tue, 15 May 2018 13:36:23 -0400 Subject: [PATCH] remove method changed for scalebar (#547) * remove method changed for scalebar * add news line about remove scalebar fix --- NEWS | 2 ++ inst/htmlwidgets/leaflet.js | 2 +- javascript/src/methods.js | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 35ec16f0d..7ec90ca55 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,8 @@ leaflet 2.0.0.9000 BUG FIXES * `.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) +* Use correct Leaflet.js scale control remove method (#547) + leaflet 2.0.0 -------------------------------------------------------------------------------- diff --git a/inst/htmlwidgets/leaflet.js b/inst/htmlwidgets/leaflet.js index b997ce948..a3fd217b5 100644 --- a/inst/htmlwidgets/leaflet.js +++ b/inst/htmlwidgets/leaflet.js @@ -2058,7 +2058,7 @@ methods.addScaleBar = function (options) { methods.removeScaleBar = function () { if (this.currentScaleBar) { - this.currentScaleBar.removeFrom(this); + this.currentScaleBar.remove(); this.currentScaleBar = null; } }; diff --git a/javascript/src/methods.js b/javascript/src/methods.js index 3dc825626..6a236750d 100644 --- a/javascript/src/methods.js +++ b/javascript/src/methods.js @@ -896,7 +896,7 @@ methods.addScaleBar = function(options) { methods.removeScaleBar = function() { if (this.currentScaleBar) { - this.currentScaleBar.removeFrom(this); + this.currentScaleBar.remove(); this.currentScaleBar = null; } };