Skip to content

Commit c6762e3

Browse files
temp fix for leaflet-measure but need to rewrite some legacy controls to use ControlStore
1 parent 6899951 commit c6762e3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

inst/htmlwidgets/leaflet.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2256,14 +2256,14 @@ methods.addMeasure = function (options) {
22562256
// if a measureControl already exists, then remove it and
22572257
// replace with a new one
22582258
if (this.measureControl) {
2259-
this.measureControl.removeFrom(this);
2259+
this.removeControl(this.measureControl);
22602260
}
22612261
this.measureControl = _leaflet2.default.control.measure(options);
22622262
this.measureControl.addTo(this);
22632263
};
22642264

22652265
methods.removeMeasure = function () {
2266-
this.measureControl.removeFrom(this);
2266+
this.removeControl(this.measureControl);
22672267
delete this.measureControl;
22682268
};
22692269

javascript/src/methods.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,14 +1191,14 @@ methods.addMeasure = function(options){
11911191
// if a measureControl already exists, then remove it and
11921192
// replace with a new one
11931193
if(this.measureControl) {
1194-
this.measureControl.removeFrom( this );
1194+
this.removeControl(this.measureControl);
11951195
}
11961196
this.measureControl = L.control.measure(options);
11971197
this.measureControl.addTo(this);
11981198
};
11991199

12001200
methods.removeMeasure = function() {
1201-
this.measureControl.removeFrom( this );
1201+
this.removeControl(this.measureControl);
12021202
delete this.measureControl;
12031203
};
12041204

0 commit comments

Comments
 (0)